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 13 matching lines...) Expand all Loading... |
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_packages - Package names of R.java files generated in addition | 27 # additional_res_packages - Package names of R.java files generated in addition |
28 # to the default package name defined in AndroidManifest.xml. | 28 # to the default package name defined in AndroidManifest.xml. |
29 # additional_src_dirs - Additional directories with .java files to be compiled | 29 # additional_src_dirs - Additional directories with .java files to be compiled |
30 # and included in the output of this target. | 30 # and included in the output of this target. |
31 # additional_bundled_libs - Additional libraries what will be stripped and | 31 # additional_bundled_libs - Additional libraries what will be stripped and |
32 # bundled in the apk. | 32 # bundled in the apk. |
33 # asset_location - The directory where assets are located. | 33 # asset_location - The directory where assets are located. |
| 34 # create_density_splits - Whether to create density-based apk splits. Splits |
| 35 # are supported only for minSdkVersion >= 21. |
34 # generated_src_dirs - Same as additional_src_dirs except used for .java files | 36 # generated_src_dirs - Same as additional_src_dirs except used for .java files |
35 # that are generated at build time. This should be set automatically by a | 37 # that are generated at build time. This should be set automatically by a |
36 # target's dependencies. The .java files in these directories are not | 38 # target's dependencies. The .java files in these directories are not |
37 # included in the 'inputs' list (unlike additional_src_dirs). | 39 # included in the 'inputs' list (unlike additional_src_dirs). |
38 # input_jars_paths - The path to jars to be included in the classpath. This | 40 # input_jars_paths - The path to jars to be included in the classpath. This |
39 # should be filled automatically by depending on the appropriate targets. | 41 # should be filled automatically by depending on the appropriate targets. |
40 # is_test_apk - Set to 1 if building a test apk. This prevents resources from | 42 # is_test_apk - Set to 1 if building a test apk. This prevents resources from |
41 # dependencies from being re-included. | 43 # dependencies from being re-included. |
42 # native_lib_target - The target_name of the target which generates the final | 44 # native_lib_target - The target_name of the target which generates the final |
43 # shared library to be included in this apk. A stripped copy of the | 45 # shared library to be included in this apk. A stripped copy of the |
44 # library will be included in the apk. | 46 # library will be included in the apk. |
45 # resource_dir - The directory for resources. | 47 # resource_dir - The directory for resources. |
46 # shared_resources - Make a resource package that can be loaded by a different | 48 # shared_resources - Make a resource package that can be loaded by a different |
47 # application at runtime to access the package's resources. | 49 # application at runtime to access the package's resources. |
48 # R_package - A custom Java package to generate the resource file R.java in. | 50 # R_package - A custom Java package to generate the resource file R.java in. |
49 # By default, the package given in AndroidManifest.xml will be used. | 51 # By default, the package given in AndroidManifest.xml will be used. |
50 # include_all_resources - Set to 1 to include all resource IDs in all generated | 52 # include_all_resources - Set to 1 to include all resource IDs in all generated |
51 # R.java files. | 53 # R.java files. |
52 # use_chromium_linker - Enable the content dynamic linker that allows sharing t
he | 54 # use_chromium_linker - Enable the content dynamic linker that allows sharing t
he |
53 # RELRO section of the native libraries between the different processes. | 55 # RELRO section of the native libraries between the different processes. |
54 # load_library_from_zip_file - When using the dynamic linker, load the library | 56 # load_library_from_zip - When using the dynamic linker, load the library |
55 # directly out of the zip file. | 57 # directly out of the zip file. |
56 # use_relocation_packer - Enable relocation packing. Relies on the chromium | 58 # use_relocation_packer - Enable relocation packing. Relies on the chromium |
57 # linker, so use_chromium_linker must also be enabled. | 59 # linker, so use_chromium_linker must also be enabled. |
58 # enable_chromium_linker_tests - Enable the content dynamic linker test support | 60 # enable_chromium_linker_tests - Enable the content dynamic linker test support |
59 # code. This allows a test APK to inject a Linker.TestRunner instance at | 61 # code. This allows a test APK to inject a Linker.TestRunner instance at |
60 # runtime. Should only be used by the chromium_linker_test_apk target!! | 62 # runtime. Should only be used by the chromium_linker_test_apk target!! |
61 # never_lint - Set to 1 to not run lint on this target. | 63 # never_lint - Set to 1 to not run lint on this target. |
62 # java_in_dir_suffix - To override the /src suffix on java_in_dir. | 64 # java_in_dir_suffix - To override the /src suffix on java_in_dir. |
63 # app_manifest_version_name - set the apps 'human readable' version number. | 65 # app_manifest_version_name - set the apps 'human readable' version number. |
64 # app_manifest_version_code - set the apps version number. | 66 # app_manifest_version_code - set the apps version number. |
65 { | 67 { |
66 'variables': { | 68 'variables': { |
67 'tested_apk_obfuscated_jar_path%': '/', | 69 'tested_apk_obfuscated_jar_path%': '/', |
68 'tested_apk_dex_path%': '/', | 70 'tested_apk_dex_path%': '/', |
69 'additional_input_paths': [], | 71 'additional_input_paths': [], |
| 72 'create_density_splits%': 0, |
70 'input_jars_paths': [], | 73 'input_jars_paths': [], |
71 'library_dexed_jars_paths': [], | 74 'library_dexed_jars_paths': [], |
72 'additional_src_dirs': [], | 75 'additional_src_dirs': [], |
73 'generated_src_dirs': [], | 76 'generated_src_dirs': [], |
74 'app_manifest_version_name%': '<(android_app_version_name)', | 77 'app_manifest_version_name%': '<(android_app_version_name)', |
75 'app_manifest_version_code%': '<(android_app_version_code)', | 78 'app_manifest_version_code%': '<(android_app_version_code)', |
76 # aapt generates this proguard.txt. | 79 # aapt generates this proguard.txt. |
77 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', | 80 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', |
78 'proguard_enabled%': 'false', | 81 'proguard_enabled%': 'false', |
79 'proguard_flags_paths': ['<(generated_proguard_file)'], | 82 'proguard_flags_paths': ['<(generated_proguard_file)'], |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 'version_stamp': '<(intermediate_dir)/version.stamp', | 122 'version_stamp': '<(intermediate_dir)/version.stamp', |
120 'javac_includes': [], | 123 'javac_includes': [], |
121 'jar_excluded_classes': [], | 124 'jar_excluded_classes': [], |
122 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar', | 125 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar', |
123 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 126 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
124 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 127 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
125 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', | 128 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', |
126 'dex_path': '<(intermediate_dir)/classes.dex', | 129 'dex_path': '<(intermediate_dir)/classes.dex', |
127 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', | 130 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
128 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | 131 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
| 132 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(androi
d_app_abi)/AndroidManifest.xml', |
129 'push_stamp': '<(intermediate_dir)/push.stamp', | 133 'push_stamp': '<(intermediate_dir)/push.stamp', |
130 'link_stamp': '<(intermediate_dir)/link.stamp', | 134 'link_stamp': '<(intermediate_dir)/link.stamp', |
131 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', | |
132 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', | 135 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', |
133 'resource_packaged_apk_name': '<(apk_name)-resources.ap_', | |
134 'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_n
ame)', | |
135 'shared_resources%': 0, | 136 'shared_resources%': 0, |
136 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | |
137 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 137 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
| 138 'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)', |
| 139 'final_abi_split_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name)-abi-<(android_
app_abi).apk', |
138 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', | 140 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', |
139 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', | 141 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', |
140 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t
arget_name)/<(CONFIGURATION_NAME)', | 142 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t
arget_name)/<(CONFIGURATION_NAME)', |
141 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', | 143 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', |
142 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', | 144 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', |
143 'create_standalone_apk%': 1, | 145 'create_standalone_apk%': 1, |
144 'res_v14_verify_only%': 0, | 146 'res_v14_skip%': 0, |
145 'variables': { | 147 'variables': { |
146 'variables': { | 148 'variables': { |
147 'native_lib_target%': '', | 149 'native_lib_target%': '', |
148 'native_lib_version_name%': '', | 150 'native_lib_version_name%': '', |
149 'use_chromium_linker%' : 0, | 151 'use_chromium_linker%' : 0, |
150 'load_library_from_zip_file%' : 0, | |
151 'use_relocation_packer%' : 0, | 152 'use_relocation_packer%' : 0, |
152 'enable_chromium_linker_tests%': 0, | 153 'enable_chromium_linker_tests%': 0, |
153 'is_test_apk%': 0, | 154 'is_test_apk%': 0, |
| 155 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
| 156 'unsigned_abi_split_apk_path': '<(intermediate_dir)/<(apk_name)-abi-<(an
droid_app_abi)-unsigned.apk', |
| 157 'create_abi_split%': 0, |
154 }, | 158 }, |
| 159 'unsigned_apk_path': '<(unsigned_apk_path)', |
| 160 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', |
| 161 'create_abi_split%': '<(create_abi_split)', |
155 'conditions': [ | 162 'conditions': [ |
156 ['gyp_managed_install == 1 and native_lib_target != ""', { | 163 ['gyp_managed_install == 1 and native_lib_target != ""', { |
157 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-stand
alone-unsigned.apk', | 164 'conditions': [ |
| 165 ['create_abi_split == 0', { |
| 166 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-s
tandalone-unsigned.apk', |
| 167 }, { |
| 168 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-a
bi-<(android_app_abi)-standalone-unsigned.apk', |
| 169 }], |
| 170 ], |
158 }, { | 171 }, { |
159 'unsigned_standalone_apk_path': '<(unsigned_apk_path)', | 172 'unsigned_standalone_apk_path': '<(unsigned_apk_path)', |
160 }], | 173 }], |
161 ['gyp_managed_install == 1', { | 174 ['gyp_managed_install == 1', { |
162 'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed', | 175 'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed', |
163 }, { | 176 }, { |
164 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', | 177 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', |
165 }], | 178 }], |
166 ['is_test_apk == 0 and emma_coverage != 0', { | 179 ['is_test_apk == 0 and emma_coverage != 0', { |
167 'emma_instrument%': 1, | 180 'emma_instrument%': 1, |
168 },{ | 181 },{ |
169 'emma_instrument%': 0, | 182 'emma_instrument%': 0, |
170 }], | 183 }], |
| 184 # When using abi splits, the abi split is modified by |
| 185 # gyp_managed_install rather than the main .apk |
| 186 ['create_abi_split == 1', { |
| 187 'managed_input_apk_path': '<(unsigned_abi_split_apk_path)', |
| 188 }, { |
| 189 'managed_input_apk_path': '<(unsigned_apk_path)', |
| 190 }], |
171 ], | 191 ], |
172 }, | 192 }, |
173 'native_lib_target%': '', | 193 'native_lib_target%': '', |
174 'native_lib_version_name%': '', | 194 'native_lib_version_name%': '', |
175 'use_chromium_linker%' : 0, | 195 'use_chromium_linker%' : 0, |
176 'load_library_from_zip_file%' : 0, | 196 'load_library_from_zip%' : 0, |
177 'use_relocation_packer%' : 0, | 197 'use_relocation_packer%' : 0, |
178 'enable_chromium_linker_tests%': 0, | 198 'enable_chromium_linker_tests%': 0, |
179 'emma_instrument%': '<(emma_instrument)', | 199 'emma_instrument%': '<(emma_instrument)', |
180 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', | 200 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', |
181 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', | 201 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', |
| 202 'unsigned_apk_path': '<(unsigned_apk_path)', |
| 203 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', |
| 204 'create_abi_split%': '<(create_abi_split)', |
| 205 'managed_input_apk_path': '<(managed_input_apk_path)', |
182 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_
extension)', | 206 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_
extension)', |
183 'extra_native_libs': [], | 207 'extra_native_libs': [], |
184 'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)/native_lib_placeholder.stamp', | 208 'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)/native_lib_placeholder.stamp', |
185 'native_lib_placeholders': [], | 209 'native_lib_placeholders': [], |
| 210 'main_apk_name': '<(apk_name)', |
186 }, | 211 }, |
187 # Pass the jar path to the apk's "fake" jar target. This would be better as | 212 # Pass the jar path to the apk's "fake" jar target. This would be better as |
188 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 213 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
189 # cannot be lifted in a dependent to all_dependent_settings. | 214 # cannot be lifted in a dependent to all_dependent_settings. |
190 'all_dependent_settings': { | 215 'all_dependent_settings': { |
191 'conditions': [ | 216 'conditions': [ |
192 ['proguard_enabled == "true"', { | 217 ['proguard_enabled == "true"', { |
193 'variables': { | 218 'variables': { |
194 'proguard_enabled': 'true', | 219 'proguard_enabled': 'true', |
195 } | 220 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 'variables': { | 303 'variables': { |
279 'linker_gcc_preprocess_defines': [ | 304 'linker_gcc_preprocess_defines': [ |
280 '--defines', 'ENABLE_CHROMIUM_LINKER', | 305 '--defines', 'ENABLE_CHROMIUM_LINKER', |
281 ], | 306 ], |
282 } | 307 } |
283 }, { | 308 }, { |
284 'variables': { | 309 'variables': { |
285 'linker_gcc_preprocess_defines': [], | 310 'linker_gcc_preprocess_defines': [], |
286 }, | 311 }, |
287 }], | 312 }], |
288 ['load_library_from_zip_file == 1', { | 313 ['load_library_from_zip == 1', { |
289 'variables': { | 314 'variables': { |
290 'linker_load_from_zip_file_preprocess_defines': [ | 315 'linker_load_from_zip_file_preprocess_defines': [ |
291 '--defines', 'ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE', | 316 '--defines', 'ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE', |
292 ], | 317 ], |
293 } | 318 } |
294 }, { | 319 }, { |
295 'variables': { | 320 'variables': { |
296 'linker_load_from_zip_file_preprocess_defines': [], | 321 'linker_load_from_zip_file_preprocess_defines': [], |
297 }, | 322 }, |
298 }], | 323 }], |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 ['create_standalone_apk == 1', { | 504 ['create_standalone_apk == 1', { |
480 'actions': [ | 505 'actions': [ |
481 { | 506 { |
482 'action_name': 'create standalone APK', | 507 'action_name': 'create standalone APK', |
483 'variables': { | 508 'variables': { |
484 'inputs': [ | 509 'inputs': [ |
485 '<(ordered_libraries_file)', | 510 '<(ordered_libraries_file)', |
486 '<(strip_additional_stamp)', | 511 '<(strip_additional_stamp)', |
487 '<(pack_arm_relocations_stamp)', | 512 '<(pack_arm_relocations_stamp)', |
488 ], | 513 ], |
489 'input_apk_path': '<(unsigned_apk_path)', | |
490 'output_apk_path': '<(unsigned_standalone_apk_path)', | 514 'output_apk_path': '<(unsigned_standalone_apk_path)', |
491 'libraries_top_dir%': '<(libraries_top_dir)', | 515 'libraries_top_dir%': '<(libraries_top_dir)', |
| 516 'input_apk_path': '<(managed_input_apk_path)', |
492 }, | 517 }, |
493 'includes': [ 'android/create_standalone_apk_action.gypi' ], | 518 'includes': [ 'android/create_standalone_apk_action.gypi' ], |
494 }, | 519 }, |
495 ], | 520 ], |
496 }], | 521 }], |
497 ], | 522 ], |
498 }, { | 523 }, { |
499 # gyp_managed_install != 1 | 524 # gyp_managed_install != 1 |
500 'variables': { | 525 'variables': { |
501 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)', | 526 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)', |
502 'package_input_paths': [ | 527 'package_input_paths': [ |
503 '<(strip_additional_stamp)', | 528 '<(strip_additional_stamp)', |
504 '<(pack_arm_relocations_stamp)', | 529 '<(pack_arm_relocations_stamp)', |
505 ], | 530 ], |
506 }, | 531 }, |
507 }], | 532 }], |
508 ], | 533 ], |
509 }], # native_lib_target != '' | 534 }], # native_lib_target != '' |
510 ['gyp_managed_install == 0 or create_standalone_apk == 1', { | 535 ['gyp_managed_install == 0 or create_standalone_apk == 1 or create_abi_split
== 1', { |
| 536 'dependencies': [ |
| 537 '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar', |
| 538 ], |
| 539 }], |
| 540 ['create_abi_split == 1 or gyp_managed_install == 0 or create_standalone_apk
== 1', { |
511 'actions': [ | 541 'actions': [ |
512 { | 542 { |
513 'action_name': 'finalize standalone apk', | 543 'action_name': 'finalize_base', |
514 'variables': { | 544 'variables': { |
515 'input_apk_path': '<(unsigned_standalone_apk_path)', | |
516 'output_apk_path': '<(final_apk_path)', | 545 'output_apk_path': '<(final_apk_path)', |
| 546 'conditions': [ |
| 547 ['create_abi_split == 0', { |
| 548 'input_apk_path': '<(unsigned_standalone_apk_path)', |
| 549 }, { |
| 550 'input_apk_path': '<(unsigned_apk_path)', |
| 551 'load_library_from_zip': 0, |
| 552 }] |
| 553 ], |
517 }, | 554 }, |
518 'includes': [ 'android/finalize_apk_action.gypi'] | 555 'includes': [ 'android/finalize_apk_action.gypi'] |
519 }, | 556 }, |
520 ], | 557 ], |
521 'dependencies': [ | 558 }], |
522 '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar', | 559 ['create_abi_split == 1', { |
| 560 'actions': [ |
| 561 { |
| 562 'action_name': 'generate_split_manifest_<(_target_name)', |
| 563 'inputs': [ |
| 564 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 565 '<(DEPTH)/build/android/gyp/generate_split_manifest.py', |
| 566 '<(android_manifest_path)', |
| 567 ], |
| 568 'outputs': [ |
| 569 '<(split_android_manifest_path)', |
| 570 ], |
| 571 'action': [ |
| 572 'python', '<(DEPTH)/build/android/gyp/generate_split_manifest.py', |
| 573 '--main-manifest', '<(android_manifest_path)', |
| 574 '--out-manifest', '<(split_android_manifest_path)', |
| 575 '--split', 'abi_<(android_app_abi)', |
| 576 ], |
| 577 }, |
| 578 { |
| 579 'variables': { |
| 580 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', |
| 581 'asset_location': '', |
| 582 'android_manifest_path': '<(split_android_manifest_path)', |
| 583 'create_density_splits': 0, |
| 584 }, |
| 585 'includes': [ 'android/package_resources_action.gypi' ], |
| 586 }, |
| 587 { |
| 588 'variables': { |
| 589 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', |
| 590 'apk_path': '<(unsigned_abi_split_apk_path)', |
| 591 'has_code': 0, |
| 592 'native_libs_dir': '<(apk_package_native_libs_dir)', |
| 593 'extra_inputs': ['<(native_lib_placeholder_stamp)'], |
| 594 }, |
| 595 'includes': ['android/apkbuilder_action.gypi'], |
| 596 }, |
| 597 ], |
| 598 }], |
| 599 ['create_abi_split == 1 and (gyp_managed_install == 0 or create_standalone_a
pk == 1)', { |
| 600 'actions': [ |
| 601 { |
| 602 'action_name': 'finalize_split', |
| 603 'variables': { |
| 604 'output_apk_path': '<(final_abi_split_apk_path)', |
| 605 'conditions': [ |
| 606 ['gyp_managed_install == 1', { |
| 607 'input_apk_path': '<(unsigned_standalone_apk_path)', |
| 608 }, { |
| 609 'input_apk_path': '<(unsigned_abi_split_apk_path)', |
| 610 }], |
| 611 ], |
| 612 }, |
| 613 'includes': [ 'android/finalize_apk_action.gypi'] |
| 614 }, |
523 ], | 615 ], |
524 }], | 616 }], |
525 ['gyp_managed_install == 1', { | 617 ['gyp_managed_install == 1', { |
526 'actions': [ | 618 'actions': [ |
527 { | 619 { |
528 'action_name': 'finalize incomplete apk', | 620 'action_name': 'finalize incomplete apk', |
529 'variables': { | 621 'variables': { |
530 'input_apk_path': '<(unsigned_apk_path)', | 622 'load_library_from_zip': 0, |
| 623 'input_apk_path': '<(managed_input_apk_path)', |
531 'output_apk_path': '<(incomplete_apk_path)', | 624 'output_apk_path': '<(incomplete_apk_path)', |
532 }, | 625 }, |
533 'includes': [ 'android/finalize_apk_action.gypi'] | 626 'includes': [ 'android/finalize_apk_action.gypi'] |
534 }, | 627 }, |
535 { | 628 { |
536 'action_name': 'apk_install_<(_target_name)', | 629 'action_name': 'apk_install_<(_target_name)', |
537 'message': 'Installing <(apk_name).apk', | 630 'message': 'Installing <(apk_name).apk', |
538 'inputs': [ | 631 'inputs': [ |
539 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 632 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
540 '<(DEPTH)/build/android/gyp/apk_install.py', | 633 '<(DEPTH)/build/android/gyp/apk_install.py', |
541 '<(build_device_config_path)', | 634 '<(build_device_config_path)', |
542 '<(incomplete_apk_path)', | 635 '<(incomplete_apk_path)', |
543 ], | 636 ], |
544 'outputs': [ | 637 'outputs': [ |
545 '<(apk_install_record)', | 638 '<(apk_install_record)', |
546 ], | 639 ], |
547 'action': [ | 640 'action': [ |
548 'python', '<(DEPTH)/build/android/gyp/apk_install.py', | 641 'python', '<(DEPTH)/build/android/gyp/apk_install.py', |
549 '--apk-path=<(incomplete_apk_path)', | |
550 '--build-device-configuration=<(build_device_config_path)', | 642 '--build-device-configuration=<(build_device_config_path)', |
551 '--install-record=<(apk_install_record)', | 643 '--install-record=<(apk_install_record)', |
552 '--configuration-name=<(CONFIGURATION_NAME)', | 644 '--configuration-name=<(CONFIGURATION_NAME)', |
| 645 '--android-sdk-tools', '<(android_sdk_tools)', |
| 646 ], |
| 647 'conditions': [ |
| 648 ['create_abi_split == 1', { |
| 649 'inputs': [ |
| 650 '<(final_apk_path)', |
| 651 ], |
| 652 'action': [ |
| 653 '--apk-path=<(final_apk_path)', |
| 654 '--split-apk-path=<(incomplete_apk_path)', |
| 655 ], |
| 656 }, { |
| 657 'action': [ |
| 658 '--apk-path=<(incomplete_apk_path)', |
| 659 ], |
| 660 }], |
| 661 ['create_density_splits == 1', { |
| 662 'inputs': [ |
| 663 '<(final_apk_path_no_extension)-density-hdpi.apk', |
| 664 '<(final_apk_path_no_extension)-density-xhdpi.apk', |
| 665 '<(final_apk_path_no_extension)-density-xxhdpi.apk', |
| 666 '<(final_apk_path_no_extension)-density-tvdpi.apk', |
| 667 ], |
| 668 'action': [ |
| 669 '--split-apk-path=<(final_apk_path_no_extension)-density-hdpi.ap
k', |
| 670 '--split-apk-path=<(final_apk_path_no_extension)-density-xhdpi.a
pk', |
| 671 '--split-apk-path=<(final_apk_path_no_extension)-density-xxhdpi.
apk', |
| 672 '--split-apk-path=<(final_apk_path_no_extension)-density-tvdpi.a
pk', |
| 673 ], |
| 674 }], |
553 ], | 675 ], |
554 }, | 676 }, |
555 ], | 677 ], |
556 'dependencies': [ | 678 }], |
557 '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar', | 679 ['create_density_splits == 1', { |
| 680 'actions': [ |
| 681 { |
| 682 'action_name': 'finalize_density_splits', |
| 683 'variables': { |
| 684 'density_splits': 1, |
| 685 }, |
| 686 'includes': [ 'android/finalize_splits_action.gypi'] |
| 687 }, |
558 ], | 688 ], |
559 }], | 689 }], |
560 ['is_test_apk == 1', { | 690 ['is_test_apk == 1', { |
561 'dependencies': [ | 691 'dependencies': [ |
562 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm
ands', | 692 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm
ands', |
563 '<(DEPTH)/tools/android/android_tools.gyp:android_tools', | 693 '<(DEPTH)/tools/android/android_tools.gyp:android_tools', |
564 ] | 694 ] |
565 }], | 695 }], |
566 ['run_findbugs == 1', { | 696 ['run_findbugs == 1', { |
567 'actions': [ | 697 'actions': [ |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 'variables': { | 730 'variables': { |
601 # Write the inputs list to a file, so that its mtime is updated when | 731 # Write the inputs list to a file, so that its mtime is updated when |
602 # the list of inputs changes. | 732 # the list of inputs changes. |
603 'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(additional
_input_paths) >@(resource_input_paths))', | 733 'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(additional
_input_paths) >@(resource_input_paths))', |
604 'process_resources_options': [], | 734 'process_resources_options': [], |
605 'conditions': [ | 735 'conditions': [ |
606 ['is_test_apk == 1', { | 736 ['is_test_apk == 1', { |
607 'dependencies_res_zip_paths=': [], | 737 'dependencies_res_zip_paths=': [], |
608 'additional_res_packages=': [], | 738 'additional_res_packages=': [], |
609 }], | 739 }], |
610 ['res_v14_verify_only == 1', { | 740 ['res_v14_skip == 1', { |
611 'process_resources_options+': ['--v14-verify-only'] | 741 'process_resources_options+': ['--v14-skip'] |
612 }], | 742 }], |
613 ['shared_resources == 1', { | 743 ['shared_resources == 1', { |
614 'process_resources_options+': ['--shared-resources'] | 744 'process_resources_options+': ['--shared-resources'] |
615 }], | 745 }], |
616 ['R_package != ""', { | 746 ['R_package != ""', { |
617 'process_resources_options+': ['--custom-package', '<(R_package)'] | 747 'process_resources_options+': ['--custom-package', '<(R_package)'] |
618 }], | 748 }], |
619 ['include_all_resources == 1', { | 749 ['include_all_resources == 1', { |
620 'process_resources_options+': ['--include-all-resources'] | 750 'process_resources_options+': ['--include-all-resources'] |
621 }] | 751 }] |
622 ], | 752 ], |
623 }, | 753 }, |
624 'inputs': [ | 754 'inputs': [ |
625 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 755 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
626 '<(DEPTH)/build/android/gyp/process_resources.py', | 756 '<(DEPTH)/build/android/gyp/process_resources.py', |
627 '<(android_manifest_path)', | 757 '<(android_manifest_path)', |
628 '>@(additional_input_paths)', | 758 '>@(additional_input_paths)', |
629 '>@(resource_input_paths)', | 759 '>@(resource_input_paths)', |
630 '>@(dependencies_res_zip_paths)', | 760 '>@(dependencies_res_zip_paths)', |
631 '>(inputs_list_file)', | 761 '>(inputs_list_file)', |
632 ], | 762 ], |
633 'outputs': [ | 763 'outputs': [ |
634 '<(resource_zip_path)', | 764 '<(resource_zip_path)', |
635 '<(generated_proguard_file)', | 765 '<(generated_proguard_file)', |
636 '<(codegen_stamp)', | 766 '<(codegen_stamp)', |
637 ], | 767 ], |
638 'action': [ | 768 'action': [ |
639 'python', '<(DEPTH)/build/android/gyp/process_resources.py', | 769 'python', '<(DEPTH)/build/android/gyp/process_resources.py', |
640 '--android-sdk', '<(android_sdk)', | 770 '--android-sdk', '<(android_sdk)', |
641 '--android-sdk-tools', '<(android_sdk_tools)', | 771 '--aapt-path', '<(android_aapt_path)', |
642 | 772 |
643 '--android-manifest', '<(android_manifest_path)', | 773 '--android-manifest', '<(android_manifest_path)', |
644 '--dependencies-res-zips', '>(dependencies_res_zip_paths)', | 774 '--dependencies-res-zips', '>(dependencies_res_zip_paths)', |
645 | 775 |
646 '--extra-res-packages', '>(additional_res_packages)', | 776 '--extra-res-packages', '>(additional_res_packages)', |
647 '--extra-r-text-files', '>(additional_R_text_files)', | 777 '--extra-r-text-files', '>(additional_R_text_files)', |
648 | 778 |
649 '--proguard-file', '<(generated_proguard_file)', | 779 '--proguard-file', '<(generated_proguard_file)', |
650 | 780 |
651 '--resource-dirs', '<(resource_dir)', | 781 '--resource-dirs', '<(resource_dir)', |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 }], | 986 }], |
857 ['proguard_enabled == "true"', { | 987 ['proguard_enabled == "true"', { |
858 'inputs': [ '<(obfuscate_stamp)' ] | 988 'inputs': [ '<(obfuscate_stamp)' ] |
859 }, { | 989 }, { |
860 'inputs': [ '<(instr_stamp)' ] | 990 'inputs': [ '<(instr_stamp)' ] |
861 }], | 991 }], |
862 ], | 992 ], |
863 'includes': [ 'android/dex_action.gypi' ], | 993 'includes': [ 'android/dex_action.gypi' ], |
864 }, | 994 }, |
865 { | 995 { |
866 'action_name': 'package_resources', | |
867 'message': 'packaging resources for <(_target_name)', | |
868 'variables': { | 996 'variables': { |
869 'package_resources_options': [], | 997 'extra_inputs': ['<(codegen_stamp)'], |
870 'package_resource_zip_input_paths': [ | 998 'resource_zips': [ |
871 '<(resource_zip_path)', | 999 '<(resource_zip_path)', |
872 '>@(dependencies_res_zip_paths)', | |
873 ], | 1000 ], |
874 'conditions': [ | 1001 'conditions': [ |
875 ['shared_resources == 1', { | 1002 ['is_test_apk == 0', { |
876 'package_resources_options+': ['--shared-resources'] | 1003 'resource_zips': [ |
| 1004 '>@(dependencies_res_zip_paths)', |
| 1005 ], |
877 }], | 1006 }], |
878 ], | 1007 ], |
879 }, | 1008 }, |
880 'conditions': [ | 1009 'includes': [ 'android/package_resources_action.gypi' ], |
881 ['is_test_apk == 1', { | |
882 'variables': { | |
883 'dependencies_res_zip_paths=': [], | |
884 'additional_res_packages=': [], | |
885 } | |
886 }], | |
887 ], | |
888 'inputs': [ | |
889 # TODO: This isn't always rerun correctly, http://crbug.com/351928 | |
890 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
891 '<(DEPTH)/build/android/gyp/package_resources.py', | |
892 '<(android_manifest_path)', | |
893 | |
894 '>@(package_resource_zip_input_paths)', | |
895 | |
896 '<(codegen_stamp)', | |
897 ], | |
898 'outputs': [ | |
899 '<(resource_packaged_apk_path)', | |
900 ], | |
901 'action': [ | |
902 'python', '<(DEPTH)/build/android/gyp/package_resources.py', | |
903 '--android-sdk', '<(android_sdk)', | |
904 '--android-sdk-tools', '<(android_sdk_tools)', | |
905 | |
906 '--configuration-name', '<(CONFIGURATION_NAME)', | |
907 | |
908 '--android-manifest', '<(android_manifest_path)', | |
909 '--version-code', '<(app_manifest_version_code)', | |
910 '--version-name', '<(app_manifest_version_name)', | |
911 | |
912 '--asset-dir', '<(asset_location)', | |
913 '--resource-zips', '>(package_resource_zip_input_paths)', | |
914 | |
915 '--no-compress', '<(extensions_to_not_compress)', | |
916 | |
917 '--apk-path', '<(resource_packaged_apk_path)', | |
918 | |
919 '<@(package_resources_options)', | |
920 ], | |
921 }, | 1010 }, |
922 { | 1011 { |
923 'action_name': 'ant_package_<(_target_name)', | |
924 'message': 'Packaging <(_target_name)', | |
925 'variables': { | 1012 'variables': { |
926 # Write the inputs list to a file, so that its mtime is updated when | 1013 'apk_path': '<(unsigned_apk_path)', |
927 # the list of inputs changes. | 1014 'conditions': [ |
928 'inputs_list_file': '>|(apk_package.<(_target_name).gypcmd >@(package_in
put_paths))' | 1015 ['native_lib_target != ""', { |
| 1016 'extra_inputs': ['<(native_lib_placeholder_stamp)'], |
| 1017 }], |
| 1018 ['create_abi_split == 0', { |
| 1019 'native_libs_dir': '<(apk_package_native_libs_dir)', |
| 1020 }, { |
| 1021 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', |
| 1022 }], |
| 1023 ], |
929 }, | 1024 }, |
930 'inputs': [ | 1025 'includes': ['android/apkbuilder_action.gypi'], |
931 '<(DEPTH)/build/android/ant/apk-package.xml', | |
932 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
933 '<(DEPTH)/build/android/gyp/ant.py', | |
934 '<(dex_path)', | |
935 '<(codegen_stamp)', | |
936 '<(obfuscate_stamp)', | |
937 '<(resource_packaged_apk_path)', | |
938 '>@(package_input_paths)', | |
939 '>(inputs_list_file)', | |
940 ], | |
941 'outputs': [ | |
942 '<(unsigned_apk_path)', | |
943 ], | |
944 'conditions': [ | |
945 ['native_lib_target != ""', { | |
946 'inputs': ['<(native_lib_placeholder_stamp)'], | |
947 }], | |
948 ], | |
949 'action': [ | |
950 'python', '<(DEPTH)/build/android/gyp/ant.py', | |
951 '--', | |
952 '-quiet', | |
953 '-DDEX_FILE_PATH=<(intermediate_dir)/classes.dex', | |
954 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | |
955 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', | |
956 '-DRESOURCE_PACKAGED_APK_NAME=<(resource_packaged_apk_name)', | |
957 '-DAPK_NAME=<(apk_name)', | |
958 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | |
959 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)', | |
960 '-DOUT_DIR=<(intermediate_dir)', | |
961 '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)', | |
962 '-DEMMA_INSTRUMENT=<(emma_instrument)', | |
963 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', | |
964 | |
965 '-Dbasedir=.', | |
966 '-buildfile', | |
967 '<(DEPTH)/build/android/ant/apk-package.xml', | |
968 ] | |
969 }, | 1026 }, |
970 ], | 1027 ], |
971 } | 1028 } |
OLD | NEW |