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.
7 from build import trace_viewer_project
9 GYP_FILE = "trace_viewer.gyp"
10 FILE_GROUPS = ["tracing_html_files",
16 f = open(GYP_FILE, 'r')
22 for group in FILE_GROUPS:
23 gyp_files.extend(map(os.path.normpath, data["variables"][group]))
25 project = trace_viewer_project.TraceViewerProject()
27 def handle(dirpath, dirnames, filenames):
28 for name in filenames:
29 if not (name.endswith(("_test.js", "_test_data.js", "tests.html")) or
30 name.startswith(("."))):
31 x = os.path.relpath(os.path.normpath(os.path.join(dirpath, name)),
32 project.trace_viewer_path)
34 if '.svn' in dirnames:
35 dirnames.remove('.svn')
37 for (dirpath, dirnames, filenames) in os.walk(project.src_path):
38 handle(dirpath, dirnames, filenames)
40 for (dirpath, dirnames, filenames) in os.walk(
41 os.path.join(project.tvcm_path, 'src')):
42 handle(dirpath, dirnames, filenames)
44 u = set(gyp_files).union(set(known_files))
45 i = set(gyp_files).intersection(set(known_files))
51 error = 'Entries in ' + GYP_FILE + ' do not match files on disk:\n'
52 in_gyp_only = list(set(gyp_files) - set(known_files))
53 in_known_only = list(set(known_files) - set(gyp_files))
55 if len(in_gyp_only) > 0:
56 error += ' In GYP only:\n ' + '\n '.join(sorted(in_gyp_only))
57 if len(in_known_only) > 0:
58 if len(in_gyp_only) > 0:
60 error += ' On disk only:\n ' + '\n '.join(sorted(in_known_only))