| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 'tested_apk_dex_path%': '/', | 78 'tested_apk_dex_path%': '/', |
| 79 'tested_apk_is_multidex%': 0, | 79 'tested_apk_is_multidex%': 0, |
| 80 'additional_input_paths': [], | 80 'additional_input_paths': [], |
| 81 'additional_locale_input_paths': [], | 81 'additional_locale_input_paths': [], |
| 82 'create_density_splits%': 0, | 82 'create_density_splits%': 0, |
| 83 'language_splits': [], | 83 'language_splits': [], |
| 84 'library_jars_paths': [], | 84 'library_jars_paths': [], |
| 85 'input_jars_paths': [], | 85 'input_jars_paths': [], |
| 86 'library_dexed_jars_paths': [], | 86 'library_dexed_jars_paths': [], |
| 87 'additional_src_dirs': [], | 87 'additional_src_dirs': [], |
| 88 'generated_src_dirs': [ '<(native_libraries_java_dir)' ], | 88 'generated_src_dirs': [], |
| 89 'app_manifest_version_name%': '<(android_app_version_name)', | 89 'app_manifest_version_name%': '<(android_app_version_name)', |
| 90 'app_manifest_version_code%': '<(android_app_version_code)', | 90 'app_manifest_version_code%': '<(android_app_version_code)', |
| 91 # aapt generates this proguard.txt. | 91 # aapt generates this proguard.txt. |
| 92 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', | 92 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', |
| 93 'proguard_enabled%': 'false', | 93 'proguard_enabled%': 'false', |
| 94 'debug_build_proguard_enabled%': 'false', | 94 'debug_build_proguard_enabled%': 'false', |
| 95 'proguard_flags_paths': ['<(generated_proguard_file)'], | 95 'proguard_flags_paths': ['<(generated_proguard_file)'], |
| 96 'jar_name': 'chromium_apk_<(_target_name).jar', | 96 'jar_name': 'chromium_apk_<(_target_name).jar', |
| 97 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', | 97 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', |
| 98 'R_package%':'', | 98 'R_package%':'', |
| 99 'include_all_resources%': 0, | 99 'include_all_resources%': 0, |
| 100 'additional_R_text_files': [], | 100 'additional_R_text_files': [], |
| 101 'dependencies_locale_zip_alternative_paths%': [], | 101 'dependencies_locale_zip_alternative_paths%': [], |
| 102 'dependencies_locale_zip_paths': [], | 102 'dependencies_locale_zip_paths': [], |
| 103 'dependencies_res_zip_paths': [], | 103 'dependencies_res_zip_paths': [], |
| 104 'additional_res_packages': [], | 104 'additional_res_packages': [], |
| 105 'additional_bundled_libs%': [], | 105 'additional_bundled_libs%': [], |
| 106 'is_test_apk%': 0, | 106 'is_test_apk%': 0, |
| 107 # Allow icu data, v8 snapshots, and pak files to be loaded directly from the
.apk. | 107 # Allow icu data, v8 snapshots, and pak files to be loaded directly from the
.apk. |
| 108 # Note: These are actually suffix matches, not necessarily extensions. | 108 # Note: These are actually suffix matches, not necessarily extensions. |
| 109 'extensions_to_not_compress%': '.dat,.bin,.pak', | 109 'extensions_to_not_compress%': '.dat,.bin,.pak', |
| 110 'resource_input_paths': [], | 110 'resource_input_paths': [], |
| 111 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', | 111 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', |
| 112 'asset_location%': '<(intermediate_dir)/assets', | 112 'asset_location%': '<(intermediate_dir)/assets', |
| 113 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', | 113 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', |
| 114 'package_input_paths': [], | 114 'package_input_paths': [], |
| 115 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', | 115 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', |
| 116 'additional_ordered_libraries_file': '<(intermediate_dir)/additional_native_
libraries.json', | 116 'additional_ordered_libraries_file': '<(intermediate_dir)/additional_native_
libraries.json', |
| 117 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLib
raries.template', |
| 117 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/', | 118 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/', |
| 119 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.
java', |
| 118 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.st
amp', | 120 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.st
amp', |
| 119 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/
', | 121 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/
', |
| 120 'native_libraries_template_data_file': '<(native_libraries_template_data_dir
)/native_libraries_array.h', | 122 'native_libraries_template_data_file': '<(native_libraries_template_data_dir
)/native_libraries_array.h', |
| 121 'native_libraries_template_version_file': '<(native_libraries_template_data_
dir)/native_libraries_version.h', | 123 'native_libraries_template_version_file': '<(native_libraries_template_data_
dir)/native_libraries_version.h', |
| 122 'compile_stamp': '<(intermediate_dir)/compile.stamp', | 124 'compile_stamp': '<(intermediate_dir)/compile.stamp', |
| 123 'lint_stamp': '<(intermediate_dir)/lint.stamp', | 125 'lint_stamp': '<(intermediate_dir)/lint.stamp', |
| 124 'lint_result': '<(intermediate_dir)/lint_result.xml', | 126 'lint_result': '<(intermediate_dir)/lint_result.xml', |
| 125 'lint_config': '<(intermediate_dir)/lint_config.xml', | 127 'lint_config': '<(intermediate_dir)/lint_config.xml', |
| 126 'never_lint%': 0, | 128 'never_lint%': 0, |
| 127 'findbugs_stamp': '<(intermediate_dir)/findbugs.stamp', | 129 'findbugs_stamp': '<(intermediate_dir)/findbugs.stamp', |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | 175 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
| 174 'unsigned_abi_split_apk_path': '<(intermediate_dir)/<(apk_name)-abi-<(an
droid_app_abi)-unsigned.apk', | 176 'unsigned_abi_split_apk_path': '<(intermediate_dir)/<(apk_name)-abi-<(an
droid_app_abi)-unsigned.apk', |
| 175 'create_abi_split%': 0, | 177 'create_abi_split%': 0, |
| 176 'enable_multidex%': 0, | 178 'enable_multidex%': 0, |
| 177 }, | 179 }, |
| 178 'unsigned_apk_path': '<(unsigned_apk_path)', | 180 'unsigned_apk_path': '<(unsigned_apk_path)', |
| 179 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', | 181 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', |
| 180 'create_abi_split%': '<(create_abi_split)', | 182 'create_abi_split%': '<(create_abi_split)', |
| 181 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 183 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
| 182 'conditions': [ | 184 'conditions': [ |
| 183 ['is_test_apk == 1', { | |
| 184 'native_libraries_template': '<(DEPTH)/base/test/android/java/template
s/NativeTestLibraries.template', | |
| 185 'native_libraries_java_file_name': 'NativeTestLibraries.java', | |
| 186 }, { | |
| 187 'native_libraries_template': '<(DEPTH)/base/android/java/templates/Nat
iveLibraries.template', | |
| 188 'native_libraries_java_file_name': 'NativeLibraries.java', | |
| 189 }], | |
| 190 ['gyp_managed_install == 1 and native_lib_target != ""', { | 185 ['gyp_managed_install == 1 and native_lib_target != ""', { |
| 191 'conditions': [ | 186 'conditions': [ |
| 192 ['create_abi_split == 0', { | 187 ['create_abi_split == 0', { |
| 193 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-s
tandalone-unsigned.apk', | 188 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-s
tandalone-unsigned.apk', |
| 194 }, { | 189 }, { |
| 195 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-a
bi-<(android_app_abi)-standalone-unsigned.apk', | 190 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-a
bi-<(android_app_abi)-standalone-unsigned.apk', |
| 196 }], | 191 }], |
| 197 ], | 192 ], |
| 198 }, { | 193 }, { |
| 199 'unsigned_standalone_apk_path': '<(unsigned_apk_path)', | 194 'unsigned_standalone_apk_path': '<(unsigned_apk_path)', |
| (...skipping 17 matching lines...) Expand all Loading... |
| 217 }], | 212 }], |
| 218 ['enable_multidex == 1', { | 213 ['enable_multidex == 1', { |
| 219 'dex_path': '<(intermediate_dir)/classes.dex.zip', | 214 'dex_path': '<(intermediate_dir)/classes.dex.zip', |
| 220 }, { | 215 }, { |
| 221 'dex_path': '<(intermediate_dir)/classes.dex', | 216 'dex_path': '<(intermediate_dir)/classes.dex', |
| 222 }], | 217 }], |
| 223 ], | 218 ], |
| 224 }, | 219 }, |
| 225 'native_lib_target%': '', | 220 'native_lib_target%': '', |
| 226 'native_lib_version_name%': '', | 221 'native_lib_version_name%': '', |
| 227 'native_libraries_template': '<(native_libraries_template)', | |
| 228 'native_libraries_java_file': '<(native_libraries_java_dir)/<(native_librari
es_java_file_name)', | |
| 229 'use_chromium_linker%' : 0, | 222 'use_chromium_linker%' : 0, |
| 230 'load_library_from_zip%' : 0, | 223 'load_library_from_zip%' : 0, |
| 231 'use_relocation_packer%' : 0, | 224 'use_relocation_packer%' : 0, |
| 232 'enable_chromium_linker_tests%': 0, | 225 'enable_chromium_linker_tests%': 0, |
| 233 'emma_instrument%': '<(emma_instrument)', | 226 'emma_instrument%': '<(emma_instrument)', |
| 234 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', | 227 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', |
| 235 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', | 228 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', |
| 236 'unsigned_apk_path': '<(unsigned_apk_path)', | 229 'unsigned_apk_path': '<(unsigned_apk_path)', |
| 237 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', | 230 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', |
| 238 'create_abi_split%': '<(create_abi_split)', | 231 'create_abi_split%': '<(create_abi_split)', |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 'chromium_linker_path': [ | 310 'chromium_linker_path': [ |
| 318 '<(SHARED_LIB_DIR)/<(libchromium_android_linker)', | 311 '<(SHARED_LIB_DIR)/<(libchromium_android_linker)', |
| 319 ], | 312 ], |
| 320 } | 313 } |
| 321 }, { | 314 }, { |
| 322 'variables': { | 315 'variables': { |
| 323 'chromium_linker_path': [], | 316 'chromium_linker_path': [], |
| 324 }, | 317 }, |
| 325 }], | 318 }], |
| 326 ], | 319 ], |
| 320 'generated_src_dirs': [ '<(native_libraries_java_dir)' ], |
| 327 'native_libs_paths': [ | 321 'native_libs_paths': [ |
| 328 '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)', | 322 '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)', |
| 329 '<@(chromium_linker_path)' | 323 '<@(chromium_linker_path)' |
| 330 ], | 324 ], |
| 331 'package_input_paths': [ | 325 'package_input_paths': [ |
| 332 '<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver', | 326 '<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver', |
| 333 ], | 327 ], |
| 334 }, | 328 }, |
| 335 'copies': [ | 329 'copies': [ |
| 336 { | 330 { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 396 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 403 '<(DEPTH)/build/android/gyp/gcc_preprocess.py', | 397 '<(DEPTH)/build/android/gyp/gcc_preprocess.py', |
| 404 '<(ordered_libraries_file)', | 398 '<(ordered_libraries_file)', |
| 405 '<(native_libraries_template)', | 399 '<(native_libraries_template)', |
| 406 ], | 400 ], |
| 407 'outputs': [ | 401 'outputs': [ |
| 408 '<(native_libraries_java_stamp)', | 402 '<(native_libraries_java_stamp)', |
| 409 ], | 403 ], |
| 410 'action': [ | 404 'action': [ |
| 411 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', | 405 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', |
| 412 '--include-path=<(DEPTH)', | 406 '--include-path=', |
| 413 '--output=<(native_libraries_java_file)', | 407 '--output=<(native_libraries_java_file)', |
| 414 '--template=<(native_libraries_template)', | 408 '--template=<(native_libraries_template)', |
| 415 '--stamp=<(native_libraries_java_stamp)', | 409 '--stamp=<(native_libraries_java_stamp)', |
| 416 '--defines', 'NATIVE_LIBRARIES_LIST=@FileArg(<(ordered_libraries_fil
e):java_libraries_list)', | 410 '--defines', 'NATIVE_LIBRARIES_LIST=@FileArg(<(ordered_libraries_fil
e):java_libraries_list)', |
| 417 '--defines', 'NATIVE_LIBRARIES_VERSION_NUMBER="<(native_lib_version_
name)"', | 411 '--defines', 'NATIVE_LIBRARIES_VERSION_NUMBER="<(native_lib_version_
name)"', |
| 418 '<@(gcc_preprocess_defines)', | 412 '<@(gcc_preprocess_defines)', |
| 419 ], | 413 ], |
| 420 }, | 414 }, |
| 421 { | 415 { |
| 422 'action_name': 'strip_native_libraries', | 416 'action_name': 'strip_native_libraries', |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 # gyp_managed_install != 1 | 576 # gyp_managed_install != 1 |
| 583 'variables': { | 577 'variables': { |
| 584 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)', | 578 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)', |
| 585 'package_input_paths': [ | 579 'package_input_paths': [ |
| 586 '<(strip_additional_stamp)', | 580 '<(strip_additional_stamp)', |
| 587 '<(pack_relocations_stamp)', | 581 '<(pack_relocations_stamp)', |
| 588 ], | 582 ], |
| 589 }, | 583 }, |
| 590 }], | 584 }], |
| 591 ], | 585 ], |
| 592 }, { | |
| 593 'actions': [ | |
| 594 { | |
| 595 'action_name': 'empty_native_libraries_<(_target_name)', | |
| 596 'message': 'Creating empty NativeLibraries.java for <(_target_name)', | |
| 597 'inputs': [ | |
| 598 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
| 599 '<(DEPTH)/build/android/gyp/gcc_preprocess.py', | |
| 600 '<(native_libraries_template)', | |
| 601 ], | |
| 602 'outputs': [ | |
| 603 '<(native_libraries_java_stamp)', | |
| 604 ], | |
| 605 'action': [ | |
| 606 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py', | |
| 607 '--include-path=<(DEPTH)', | |
| 608 '--output=<(native_libraries_java_file)', | |
| 609 '--template=<(native_libraries_template)', | |
| 610 '--stamp=<(native_libraries_java_stamp)', | |
| 611 ], | |
| 612 }, | |
| 613 ], | |
| 614 }], # native_lib_target != '' | 586 }], # native_lib_target != '' |
| 615 ['gyp_managed_install == 0 or create_standalone_apk == 1 or create_abi_split
== 1', { | 587 ['gyp_managed_install == 0 or create_standalone_apk == 1 or create_abi_split
== 1', { |
| 616 'dependencies': [ | 588 'dependencies': [ |
| 617 '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar', | 589 '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar', |
| 618 ], | 590 ], |
| 619 }], | 591 }], |
| 620 ['create_abi_split == 1 or gyp_managed_install == 0 or create_standalone_apk
== 1', { | 592 ['create_abi_split == 1 or gyp_managed_install == 0 or create_standalone_apk
== 1', { |
| 621 'actions': [ | 593 'actions': [ |
| 622 { | 594 { |
| 623 'action_name': 'finalize_base', | 595 'action_name': 'finalize_base', |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 'native_libs_dir': '<(apk_package_native_libs_dir)', | 1207 'native_libs_dir': '<(apk_package_native_libs_dir)', |
| 1236 }, { | 1208 }, { |
| 1237 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', | 1209 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', |
| 1238 }], | 1210 }], |
| 1239 ], | 1211 ], |
| 1240 }, | 1212 }, |
| 1241 'includes': ['android/apkbuilder_action.gypi'], | 1213 'includes': ['android/apkbuilder_action.gypi'], |
| 1242 }, | 1214 }, |
| 1243 ], | 1215 ], |
| 1244 } | 1216 } |
| OLD | NEW |