OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 """Writes a build_config file. | 7 """Writes a build_config file. |
8 | 8 |
9 The build_config file for a target is a json file containing information about | 9 The build_config file for a target is a json file containing information about |
10 how to build that target based on the target's dependencies. This includes | 10 how to build that target based on the target's dependencies. This includes |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 help='GYP-list of .jar files to include on the classpath when compiling, ' | 286 help='GYP-list of .jar files to include on the classpath when compiling, ' |
287 'but not to include in the final binary.') | 287 'but not to include in the final binary.') |
288 parser.add_option('--gradle-treat-as-prebuilt', action='store_true', | 288 parser.add_option('--gradle-treat-as-prebuilt', action='store_true', |
289 help='Whether this library should be treated as a prebuilt library by ' | 289 help='Whether this library should be treated as a prebuilt library by ' |
290 'generate_gradle.py.') | 290 'generate_gradle.py.') |
291 parser.add_option('--main-class', help='Java class for java_binary targets.') | 291 parser.add_option('--main-class', help='Java class for java_binary targets.') |
292 parser.add_option('--java-resources-jar-path', | 292 parser.add_option('--java-resources-jar-path', |
293 help='Path to JAR that contains java resources. Everything ' | 293 help='Path to JAR that contains java resources. Everything ' |
294 'from this JAR except meta-inf/ content and .class files ' | 294 'from this JAR except meta-inf/ content and .class files ' |
295 'will be added to the final APK.') | 295 'will be added to the final APK.') |
| 296 parser.add_option('--bootclasspath', help='Path to custom android.jar/rt.jar') |
296 | 297 |
297 # android library options | 298 # android library options |
298 parser.add_option('--dex-path', help='Path to target\'s dex output.') | 299 parser.add_option('--dex-path', help='Path to target\'s dex output.') |
299 | 300 |
300 # native library options | 301 # native library options |
301 parser.add_option('--shared-libraries-runtime-deps', | 302 parser.add_option('--shared-libraries-runtime-deps', |
302 help='Path to file containing runtime deps for shared ' | 303 help='Path to file containing runtime deps for shared ' |
303 'libraries.') | 304 'libraries.') |
304 parser.add_option('--secondary-abi-shared-libraries-runtime-deps', | 305 parser.add_option('--secondary-abi-shared-libraries-runtime-deps', |
305 help='Path to file containing runtime deps for secondary ' | 306 help='Path to file containing runtime deps for secondary ' |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 if options.java_sources_file: | 413 if options.java_sources_file: |
413 gradle['java_sources_file'] = options.java_sources_file | 414 gradle['java_sources_file'] = options.java_sources_file |
414 if options.bundled_srcjars: | 415 if options.bundled_srcjars: |
415 gradle['bundled_srcjars'] = ( | 416 gradle['bundled_srcjars'] = ( |
416 build_utils.ParseGnList(options.bundled_srcjars)) | 417 build_utils.ParseGnList(options.bundled_srcjars)) |
417 | 418 |
418 gradle['dependent_android_projects'] = [] | 419 gradle['dependent_android_projects'] = [] |
419 gradle['dependent_java_projects'] = [] | 420 gradle['dependent_java_projects'] = [] |
420 gradle['dependent_prebuilt_jars'] = deps.GradlePrebuiltJarPaths() | 421 gradle['dependent_prebuilt_jars'] = deps.GradlePrebuiltJarPaths() |
421 | 422 |
| 423 if options.bootclasspath: |
| 424 gradle['bootclasspath'] = options.bootclasspath |
422 if options.main_class: | 425 if options.main_class: |
423 gradle['main_class'] = options.main_class | 426 gradle['main_class'] = options.main_class |
424 | 427 |
425 for c in deps.GradleLibraryProjectDeps(): | 428 for c in deps.GradleLibraryProjectDeps(): |
426 if c['requires_android']: | 429 if c['requires_android']: |
427 gradle['dependent_android_projects'].append(c['path']) | 430 gradle['dependent_android_projects'].append(c['path']) |
428 else: | 431 else: |
429 gradle['dependent_java_projects'].append(c['path']) | 432 gradle['dependent_java_projects'].append(c['path']) |
430 | 433 |
431 | 434 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 deps_info['java_resources_jar'] = options.java_resources_jar_path | 705 deps_info['java_resources_jar'] = options.java_resources_jar_path |
703 | 706 |
704 build_utils.WriteJson(config, options.build_config, only_if_changed=True) | 707 build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
705 | 708 |
706 if options.depfile: | 709 if options.depfile: |
707 build_utils.WriteDepfile(options.depfile, options.build_config, all_inputs) | 710 build_utils.WriteDepfile(options.depfile, options.build_config, all_inputs) |
708 | 711 |
709 | 712 |
710 if __name__ == '__main__': | 713 if __name__ == '__main__': |
711 sys.exit(main(sys.argv[1:])) | 714 sys.exit(main(sys.argv[1:])) |
OLD | NEW |