OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 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 """Process Android resources to generate R.java, and prepare for packaging. | 7 """Process Android resources to generate R.java, and prepare for packaging. |
8 | 8 |
9 This will crunch images and generate v14 compatible resources | 9 This will crunch images and generate v14 compatible resources |
10 (see generate_v14_compatible_resources.py). | 10 (see generate_v14_compatible_resources.py). |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 'android_manifest', | 117 'android_manifest', |
118 'dependencies_res_zips', | 118 'dependencies_res_zips', |
119 'resource_dirs', | 119 'resource_dirs', |
120 'resource_zip_out', | 120 'resource_zip_out', |
121 ) | 121 ) |
122 build_utils.CheckOptions(options, parser, required=required_options) | 122 build_utils.CheckOptions(options, parser, required=required_options) |
123 | 123 |
124 if (options.R_dir is None) == (options.srcjar_out is None): | 124 if (options.R_dir is None) == (options.srcjar_out is None): |
125 raise Exception('Exactly one of --R-dir or --srcjar-out must be specified.') | 125 raise Exception('Exactly one of --R-dir or --srcjar-out must be specified.') |
126 | 126 |
127 options.resource_dirs = build_utils.ParseGypList(options.resource_dirs) | 127 options.resource_dirs = build_utils.ParseGnList(options.resource_dirs) |
128 options.dependencies_res_zips = ( | 128 options.dependencies_res_zips = ( |
129 build_utils.ParseGypList(options.dependencies_res_zips)) | 129 build_utils.ParseGnList(options.dependencies_res_zips)) |
130 | 130 |
131 # Don't use [] as default value since some script explicitly pass "". | 131 # Don't use [] as default value since some script explicitly pass "". |
132 if options.extra_res_packages: | 132 if options.extra_res_packages: |
133 options.extra_res_packages = ( | 133 options.extra_res_packages = ( |
134 build_utils.ParseGypList(options.extra_res_packages)) | 134 build_utils.ParseGnList(options.extra_res_packages)) |
135 else: | 135 else: |
136 options.extra_res_packages = [] | 136 options.extra_res_packages = [] |
137 | 137 |
138 if options.extra_r_text_files: | 138 if options.extra_r_text_files: |
139 options.extra_r_text_files = ( | 139 options.extra_r_text_files = ( |
140 build_utils.ParseGypList(options.extra_r_text_files)) | 140 build_utils.ParseGnList(options.extra_r_text_files)) |
141 else: | 141 else: |
142 options.extra_r_text_files = [] | 142 options.extra_r_text_files = [] |
143 | 143 |
144 return options | 144 return options |
145 | 145 |
146 | 146 |
147 def CreateRJavaFiles(srcjar_dir, main_r_txt_file, packages, r_txt_files, | 147 def CreateRJavaFiles(srcjar_dir, main_r_txt_file, packages, r_txt_files, |
148 shared_resources): | 148 shared_resources): |
149 assert len(packages) == len(r_txt_files), 'Need one R.txt file per package' | 149 assert len(packages) == len(r_txt_files), 'Need one R.txt file per package' |
150 | 150 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 options, | 532 options, |
533 input_paths=input_paths, | 533 input_paths=input_paths, |
534 input_strings=input_strings, | 534 input_strings=input_strings, |
535 output_paths=output_paths, | 535 output_paths=output_paths, |
536 # TODO(agrieve): Remove R_dir when it's no longer used (used only by GYP). | 536 # TODO(agrieve): Remove R_dir when it's no longer used (used only by GYP). |
537 force=options.R_dir) | 537 force=options.R_dir) |
538 | 538 |
539 | 539 |
540 if __name__ == '__main__': | 540 if __name__ == '__main__': |
541 main(sys.argv[1:]) | 541 main(sys.argv[1:]) |
OLD | NEW |