blob: 255c62e993111f82f0d47d2445ed89312ea28c16 [file] [log] [blame]
Paweł Hajdan, Jr17683f22015-02-17 15:53:551#!/usr/bin/env python
2# Copyright 2015 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 os.path.join(common.SRC_DIR, 'android_webview', 'tools',
18 'webview_licenses.py'),
19 'scan',
20 '--json', tempfile_path
21 ])
22
23 with open(tempfile_path) as f:
24 results = json.load(f)
25
26 json.dump({
27 'valid': True,
28 'failures': results,
29 }, args.output)
30
31 return rc
32
33
34def main_compile_targets(args):
35 json.dump([], args.output)
36
37
38if __name__ == '__main__':
39 funcs = {
40 'run': main_run,
41 'compile_targets': main_compile_targets,
42 }
43 sys.exit(common.run_script(sys.argv[1:], funcs))