Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / devtools / scripts / build_applications.py
blob2ea7438469a85236d81207ec0ebf2d2b9785d493
1 #!/usr/bin/env python
3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 """
8 Invokes concatenate_application_code for applications specified on the command line.
9 """
11 from os import path
12 import concatenate_application_code
13 import modular_build
14 import sys
16 try:
17 import simplejson as json
18 except ImportError:
19 import json
22 def main(argv):
23 try:
24 input_path_flag_index = argv.index('--input_path')
25 input_path = argv[input_path_flag_index + 1]
26 output_path_flag_index = argv.index('--output_path')
27 output_path = argv[output_path_flag_index + 1]
28 application_names = argv[1:input_path_flag_index]
29 debug_flag_index = argv.index('--debug')
30 minify = argv[debug_flag_index + 1] == '0'
31 except:
32 print('Usage: %s app_1 app_2 ... app_N --input_path <input_path> --output_path <output_path> --debug <0_or_1>' % argv[0])
33 raise
35 loader = modular_build.DescriptorLoader(input_path)
36 for app in application_names:
37 concatenate_application_code.build_application(app, loader, input_path, output_path, minify)
39 if __name__ == '__main__':
40 sys.exit(main(sys.argv))