OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
6 # to build Android APKs in a consistent manner. | 6 # to build Android APKs in a consistent manner. |
7 # | 7 # |
8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
9 # { | 9 # { |
10 # 'target_name': 'my_package_apk', | 10 # 'target_name': 'my_package_apk', |
(...skipping 11 matching lines...) Expand all Loading... |
22 # java_in_dir - The top-level java directory. The src should be in | 22 # java_in_dir - The top-level java directory. The src should be in |
23 # <(java_in_dir)/src. | 23 # <(java_in_dir)/src. |
24 # Optional/automatic variables: | 24 # Optional/automatic variables: |
25 # additional_input_paths - These paths will be included in the 'inputs' list to | 25 # additional_input_paths - These paths will be included in the 'inputs' list to |
26 # ensure that this target is rebuilt when one of these paths changes. | 26 # ensure that this target is rebuilt when one of these paths changes. |
27 # additional_res_dirs - Additional directories containing Android resources. | 27 # additional_res_dirs - Additional directories containing Android resources. |
28 # additional_res_packages - Package names of the R.java files corresponding to | 28 # additional_res_packages - Package names of the R.java files corresponding to |
29 # each directory in additional_res_dirs. | 29 # each directory in additional_res_dirs. |
30 # additional_src_dirs - Additional directories with .java files to be compiled | 30 # additional_src_dirs - Additional directories with .java files to be compiled |
31 # and included in the output of this target. | 31 # and included in the output of this target. |
| 32 # additional_bundled_libs - Additional libraries what will be stripped and |
| 33 # bundled in the apk. |
32 # asset_location - The directory where assets are located. | 34 # asset_location - The directory where assets are located. |
33 # generated_src_dirs - Same as additional_src_dirs except used for .java files | 35 # generated_src_dirs - Same as additional_src_dirs except used for .java files |
34 # that are generated at build time. This should be set automatically by a | 36 # that are generated at build time. This should be set automatically by a |
35 # target's dependencies. The .java files in these directories are not | 37 # target's dependencies. The .java files in these directories are not |
36 # included in the 'inputs' list (unlike additional_src_dirs). | 38 # included in the 'inputs' list (unlike additional_src_dirs). |
37 # input_jars_paths - The path to jars to be included in the classpath. This | 39 # input_jars_paths - The path to jars to be included in the classpath. This |
38 # should be filled automatically by depending on the appropriate targets. | 40 # should be filled automatically by depending on the appropriate targets. |
39 # is_test_apk - Set to 1 if building a test apk. This prevents resources from | 41 # is_test_apk - Set to 1 if building a test apk. This prevents resources from |
40 # dependencies from being re-included. | 42 # dependencies from being re-included. |
41 # native_lib_target - The target_name of the target which generates the final | 43 # native_lib_target - The target_name of the target which generates the final |
(...skipping 26 matching lines...) Expand all Loading... |
68 # aapt generates this proguard.txt. | 70 # aapt generates this proguard.txt. |
69 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', | 71 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', |
70 'proguard_enabled%': 'false', | 72 'proguard_enabled%': 'false', |
71 'proguard_flags_paths': ['<(generated_proguard_file)'], | 73 'proguard_flags_paths': ['<(generated_proguard_file)'], |
72 'jar_name': 'chromium_apk_<(_target_name).jar', | 74 'jar_name': 'chromium_apk_<(_target_name).jar', |
73 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', | 75 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', |
74 'R_package%':'', | 76 'R_package%':'', |
75 'additional_R_text_files': [], | 77 'additional_R_text_files': [], |
76 'dependencies_res_zip_paths': [], | 78 'dependencies_res_zip_paths': [], |
77 'additional_res_packages': [], | 79 'additional_res_packages': [], |
| 80 'additional_bundled_libs%': [], |
78 'is_test_apk%': 0, | 81 'is_test_apk%': 0, |
79 'resource_input_paths': [], | 82 'resource_input_paths': [], |
80 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', | 83 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', |
81 'asset_location%': '<(intermediate_dir)/assets', | 84 'asset_location%': '<(intermediate_dir)/assets', |
82 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', | 85 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', |
83 'package_input_paths': [], | 86 'package_input_paths': [], |
84 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', | 87 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', |
| 88 'additional_ordered_libraries_file': '<(intermediate_dir)/additional_native_
libraries.json', |
85 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLib
raries.template', | 89 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLib
raries.template', |
86 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/', | 90 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/', |
87 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.
java', | 91 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.
java', |
88 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.st
amp', | 92 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.st
amp', |
89 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/
', | 93 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/
', |
90 'native_libraries_template_data_file': '<(native_libraries_template_data_dir
)/native_libraries_array.h', | 94 'native_libraries_template_data_file': '<(native_libraries_template_data_dir
)/native_libraries_array.h', |
91 'native_libraries_template_version_file': '<(native_libraries_template_data_
dir)/native_libraries_version.h', | 95 'native_libraries_template_version_file': '<(native_libraries_template_data_
dir)/native_libraries_version.h', |
92 'compile_stamp': '<(intermediate_dir)/compile.stamp', | 96 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
93 'lint_stamp': '<(intermediate_dir)/lint.stamp', | 97 'lint_stamp': '<(intermediate_dir)/lint.stamp', |
94 'lint_result': '<(intermediate_dir)/lint_result.xml', | 98 'lint_result': '<(intermediate_dir)/lint_result.xml', |
95 'lint_config': '<(intermediate_dir)/lint_config.xml', | 99 'lint_config': '<(intermediate_dir)/lint_config.xml', |
96 'never_lint%': 0, | 100 'never_lint%': 0, |
97 'instr_stamp': '<(intermediate_dir)/instr.stamp', | 101 'instr_stamp': '<(intermediate_dir)/instr.stamp', |
98 'jar_stamp': '<(intermediate_dir)/jar.stamp', | 102 'jar_stamp': '<(intermediate_dir)/jar.stamp', |
99 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', | 103 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp', |
100 'pack_arm_relocations_stamp': '<(intermediate_dir)/pack_arm_relocations.stam
p', | 104 'pack_arm_relocations_stamp': '<(intermediate_dir)/pack_arm_relocations.stam
p', |
101 'strip_stamp': '<(intermediate_dir)/strip.stamp', | 105 'strip_stamp': '<(intermediate_dir)/strip.stamp', |
102 'stripped_libraries_dir': '<(SHARED_INTERMEDIATE_DIR)/stripped_libraries', | 106 'stripped_libraries_dir': '<(SHARED_INTERMEDIATE_DIR)/stripped_libraries', |
| 107 'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp', |
103 'classes_dir': '<(intermediate_dir)/classes/2', | 108 'classes_dir': '<(intermediate_dir)/classes/2', |
104 'javac_includes': [], | 109 'javac_includes': [], |
105 'jar_excluded_classes': [], | 110 'jar_excluded_classes': [], |
106 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar', | 111 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar', |
107 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 112 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
108 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 113 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
109 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', | 114 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', |
110 'dex_path': '<(intermediate_dir)/classes.dex', | 115 'dex_path': '<(intermediate_dir)/classes.dex', |
111 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', | 116 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
112 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | 117 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 'input_paths': [ | 372 'input_paths': [ |
368 '<(strip_stamp)', | 373 '<(strip_stamp)', |
369 ], | 374 ], |
370 'stamp': '<(pack_arm_relocations_stamp)', | 375 'stamp': '<(pack_arm_relocations_stamp)', |
371 }, | 376 }, |
372 'dependencies': [ | 377 'dependencies': [ |
373 'strip_native_libraries', | 378 'strip_native_libraries', |
374 ], | 379 ], |
375 'includes': ['../build/android/pack_arm_relocations.gypi'], | 380 'includes': ['../build/android/pack_arm_relocations.gypi'], |
376 }, | 381 }, |
| 382 { |
| 383 'variables': { |
| 384 'input_libraries': [ |
| 385 '<@(additional_bundled_libs)', |
| 386 ], |
| 387 'ordered_libraries_file': '<(additional_ordered_libraries_file)', |
| 388 'subtarget': '_additional_libraries', |
| 389 }, |
| 390 'includes': ['../build/android/write_ordered_libraries.gypi'], |
| 391 }, |
| 392 { |
| 393 'action_name': 'strip_additional_libraries', |
| 394 'variables': { |
| 395 'ordered_libraries_file': '<(additional_ordered_libraries_file)', |
| 396 'stripped_libraries_dir%': '<(stripped_libraries_dir)', |
| 397 'input_paths': [ |
| 398 '<@(additional_bundled_libs)', |
| 399 '<(strip_stamp)', |
| 400 ], |
| 401 'stamp': '<(strip_additional_stamp)' |
| 402 }, |
| 403 'includes': ['../build/android/strip_native_libraries.gypi'], |
| 404 }, |
377 ], | 405 ], |
378 'conditions': [ | 406 'conditions': [ |
379 ['gyp_managed_install == 1', { | 407 ['gyp_managed_install == 1', { |
380 'variables': { | 408 'variables': { |
381 'libraries_top_dir': '<(intermediate_dir)/lib.stripped', | 409 'libraries_top_dir': '<(intermediate_dir)/lib.stripped', |
382 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)
', | 410 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)
', |
383 'device_library_dir': '<(device_intermediate_dir)/lib.stripped', | 411 'device_library_dir': '<(device_intermediate_dir)/lib.stripped', |
384 'configuration_name': '<(CONFIGURATION_NAME)', | 412 'configuration_name': '<(CONFIGURATION_NAME)', |
385 }, | 413 }, |
386 'dependencies': [ | 414 'dependencies': [ |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 ], | 446 ], |
419 'conditions': [ | 447 'conditions': [ |
420 ['create_standalone_apk == 1', { | 448 ['create_standalone_apk == 1', { |
421 'actions': [ | 449 'actions': [ |
422 { | 450 { |
423 'action_name': 'create standalone APK', | 451 'action_name': 'create standalone APK', |
424 'variables': { | 452 'variables': { |
425 'inputs': [ | 453 'inputs': [ |
426 '<(ordered_libraries_file)', | 454 '<(ordered_libraries_file)', |
427 '<(strip_stamp)', | 455 '<(strip_stamp)', |
| 456 '<(strip_additional_stamp)', |
428 ], | 457 ], |
429 'input_apk_path': '<(unsigned_apk_path)', | 458 'input_apk_path': '<(unsigned_apk_path)', |
430 'output_apk_path': '<(unsigned_standalone_apk_path)', | 459 'output_apk_path': '<(unsigned_standalone_apk_path)', |
431 'libraries_top_dir%': '<(libraries_top_dir)', | 460 'libraries_top_dir%': '<(libraries_top_dir)', |
432 }, | 461 }, |
433 'includes': [ 'android/create_standalone_apk_action.gypi' ], | 462 'includes': [ 'android/create_standalone_apk_action.gypi' ], |
434 }, | 463 }, |
435 ], | 464 ], |
436 }], | 465 }], |
437 ], | 466 ], |
438 }, { | 467 }, { |
439 # gyp_managed_install != 1 | 468 # gyp_managed_install != 1 |
440 'variables': { | 469 'variables': { |
441 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)', | 470 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)', |
442 'package_input_paths': [ '<(strip_stamp)' ], | 471 'package_input_paths': [ |
| 472 '<(strip_stamp)', |
| 473 '<(strip_additional_stamp)', |
| 474 ], |
443 }, | 475 }, |
444 }], | 476 }], |
445 ], | 477 ], |
446 }], # native_lib_target != '' | 478 }], # native_lib_target != '' |
447 ['gyp_managed_install == 0 or create_standalone_apk == 1', { | 479 ['gyp_managed_install == 0 or create_standalone_apk == 1', { |
448 'actions': [ | 480 'actions': [ |
449 { | 481 { |
450 'action_name': 'finalize standalone apk', | 482 'action_name': 'finalize standalone apk', |
451 'variables': { | 483 'variables': { |
452 'input_apk_path': '<(unsigned_standalone_apk_path)', | 484 'input_apk_path': '<(unsigned_standalone_apk_path)', |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 '-DEMMA_INSTRUMENT=<(emma_instrument)', | 880 '-DEMMA_INSTRUMENT=<(emma_instrument)', |
849 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', | 881 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', |
850 | 882 |
851 '-Dbasedir=.', | 883 '-Dbasedir=.', |
852 '-buildfile', | 884 '-buildfile', |
853 '<(DEPTH)/build/android/ant/apk-package.xml', | 885 '<(DEPTH)/build/android/ant/apk-package.xml', |
854 ] | 886 ] |
855 }, | 887 }, |
856 ], | 888 ], |
857 } | 889 } |
OLD | NEW |