OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import argparse | 7 import argparse |
8 import json | 8 import json |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 args = parser.parse_args(build_utils.ExpandFileArgs(args)) | 47 args = parser.parse_args(build_utils.ExpandFileArgs(args)) |
48 | 48 |
49 if args.multidex_configuration_path: | 49 if args.multidex_configuration_path: |
50 with open(args.multidex_configuration_path) as multidex_config_file: | 50 with open(args.multidex_configuration_path) as multidex_config_file: |
51 multidex_config = json.loads(multidex_config_file.read()) | 51 multidex_config = json.loads(multidex_config_file.read()) |
52 | 52 |
53 if not multidex_config.get('enabled', False): | 53 if not multidex_config.get('enabled', False): |
54 return 0 | 54 return 0 |
55 | 55 |
56 if args.inputs: | 56 if args.inputs: |
57 args.paths.extend(build_utils.ParseGypList(args.inputs)) | 57 args.paths.extend(build_utils.ParseGnList(args.inputs)) |
58 | 58 |
59 shrinked_android_jar = os.path.abspath( | 59 shrinked_android_jar = os.path.abspath( |
60 os.path.join(args.android_sdk_tools, 'lib', 'shrinkedAndroid.jar')) | 60 os.path.join(args.android_sdk_tools, 'lib', 'shrinkedAndroid.jar')) |
61 dx_jar = os.path.abspath( | 61 dx_jar = os.path.abspath( |
62 os.path.join(args.android_sdk_tools, 'lib', 'dx.jar')) | 62 os.path.join(args.android_sdk_tools, 'lib', 'dx.jar')) |
63 rules_file = os.path.abspath( | 63 rules_file = os.path.abspath( |
64 os.path.join(args.android_sdk_tools, 'mainDexClasses.rules')) | 64 os.path.join(args.android_sdk_tools, 'mainDexClasses.rules')) |
65 | 65 |
66 proguard_cmd = [ | 66 proguard_cmd = [ |
67 constants.PROGUARD_SCRIPT_PATH, | 67 constants.PROGUARD_SCRIPT_PATH, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 else: | 129 else: |
130 raise | 130 raise |
131 | 131 |
132 with open(main_dex_list_path, 'w') as main_dex_list_file: | 132 with open(main_dex_list_path, 'w') as main_dex_list_file: |
133 main_dex_list_file.write(main_dex_list) | 133 main_dex_list_file.write(main_dex_list) |
134 | 134 |
135 | 135 |
136 if __name__ == '__main__': | 136 if __name__ == '__main__': |
137 sys.exit(main(sys.argv[1:])) | 137 sys.exit(main(sys.argv[1:])) |
138 | 138 |
OLD | NEW |