1# Copyright (c) 2013 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import sys 6import os 7 8tracing_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 9 '..', '..')) 10if tracing_path not in sys.path: 11 sys.path.append(tracing_path) 12 13from tracing.build import check_common 14 15GYPI_FILE = os.path.abspath(os.path.join(os.path.dirname(__file__), 16 '..', 'trace_viewer.gypi')) 17 18 19def GypiCheck(): 20 f = open(GYPI_FILE, 'r') 21 gyp = f.read() 22 f.close() 23 24 data = eval(gyp) 25 listed_files = [] 26 error = '' 27 for group in check_common.FILE_GROUPS: 28 filenames = map(os.path.normpath, data['variables'][group]) 29 error += check_common.CheckListedFilesSorted(GYPI_FILE, group, filenames) 30 listed_files.extend(filenames) 31 32 return error + check_common.CheckCommon(GYPI_FILE, listed_files) 33 34 35if __name__ == '__main__': 36 print GypiCheck() 37