blob: cb2520c3b32ccf845330b7757a95197571d94164 [file] [log] [blame]
wychenf7d9e912017-06-05 19:35:171#!/usr/bin/env python
2# Copyright 2017 The Chromium Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6import json
7import os
8import sys
9
10
11import common
12
13
14def main_run(args):
15 with common.temporary_file() as tempfile_path:
16 rc = common.run_command([
17 sys.executable,
18 os.path.join(common.SRC_DIR, 'build', 'check_gn_headers.py'),
19 '--out-dir',
20 os.path.join(args.paths['checkout'], 'out', args.build_config_fs),
21 '--whitelist',
22 os.path.join(common.SRC_DIR, 'build', 'check_gn_headers_whitelist.txt'),
wychen8cc31232017-06-13 10:21:2323 '--json', tempfile_path,
24 '--verbose',
wychenf7d9e912017-06-05 19:35:1725 ], cwd=common.SRC_DIR)
26
27 with open(tempfile_path) as f:
28 failures = json.load(f)
29
30 json.dump({
31 'valid': True,
32 'failures': failures,
33 }, args.output)
34
35 return rc
36
37
38def main_compile_targets(args):
39 json.dump([], args.output)
40
41
42if __name__ == '__main__':
43 funcs = {
44 'run': main_run,
45 'compile_targets': main_compile_targets,
46 }
47 sys.exit(common.run_script(sys.argv[1:], funcs))