OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//build_overrides/build.gni") | 5 import("//build_overrides/build.gni") |
6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
8 import("//third_party/android_platform/config.gni") | |
9 | 8 |
10 assert(is_android) | 9 assert(is_android) |
11 | 10 |
12 # These identify targets that have .build_config files (except for android_apk, | 11 # These identify targets that have .build_config files (except for android_apk, |
13 # java_binary, resource_rewriter, since we never need to depend on these). | 12 # java_binary, resource_rewriter, since we never need to depend on these). |
14 _java_target_whitelist = [ | 13 _java_target_whitelist = [ |
15 "*:*_java", | 14 "*:*_java", |
16 "*:*_javalib", | 15 "*:*_javalib", |
17 "*:*_java_*", # e.g. java_test_support | 16 "*:*_java_*", # e.g. java_test_support |
18 "*:java", | 17 "*:java", |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 # Don't list shared_libraries_runtime_deps_file as an input in order to | 293 # Don't list shared_libraries_runtime_deps_file as an input in order to |
295 # avoid having to depend on the runtime_deps target. See comment in | 294 # avoid having to depend on the runtime_deps target. See comment in |
296 # rules.gni for why we do this. | 295 # rules.gni for why we do this. |
297 args += [ | 296 args += [ |
298 "--shared-libraries-runtime-deps", | 297 "--shared-libraries-runtime-deps", |
299 rebase_path(invoker.shared_libraries_runtime_deps_file, | 298 rebase_path(invoker.shared_libraries_runtime_deps_file, |
300 root_build_dir), | 299 root_build_dir), |
301 ] | 300 ] |
302 } | 301 } |
303 | 302 |
304 if (defined(invoker.secondary_abi_shared_libraries_runtime_deps_file)) { | |
305 # Don't list secondary_abi_shared_libraries_runtime_deps_file as an | |
306 # input in order to avoid having to depend on the runtime_deps target. | |
307 # See comment in rules.gni for why we do this. | |
308 args += [ | |
309 "--secondary-abi-shared-libraries-runtime-deps", | |
310 rebase_path(invoker.secondary_abi_shared_libraries_runtime_deps_file, | |
311 root_build_dir), | |
312 ] | |
313 } | |
314 | |
315 if (defined(invoker.proguard_enabled) && invoker.proguard_enabled) { | 303 if (defined(invoker.proguard_enabled) && invoker.proguard_enabled) { |
316 args += [ | 304 args += [ |
317 "--proguard-enabled", | 305 "--proguard-enabled", |
318 "--proguard-info", | 306 "--proguard-info", |
319 rebase_path(invoker.proguard_info, root_build_dir), | 307 rebase_path(invoker.proguard_info, root_build_dir), |
320 ] | 308 ] |
321 } | 309 } |
322 | 310 |
323 if (defined(invoker.apk_path)) { | 311 if (defined(invoker.apk_path)) { |
324 _rebased_apk_path = rebase_path(invoker.apk_path, root_build_dir) | 312 _rebased_apk_path = rebase_path(invoker.apk_path, root_build_dir) |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 "--script-output-path", | 622 "--script-output-path", |
635 rebase_path(generated_script, root_build_dir), | 623 rebase_path(generated_script, root_build_dir), |
636 ] | 624 ] |
637 args += test_runner_args | 625 args += test_runner_args |
638 } | 626 } |
639 } | 627 } |
640 | 628 |
641 if (enable_java_templates) { | 629 if (enable_java_templates) { |
642 import("//build/config/zip.gni") | 630 import("//build/config/zip.gni") |
643 import("//third_party/ijar/ijar.gni") | 631 import("//third_party/ijar/ijar.gni") |
644 import("//third_party/android_platform/config.gni") | |
645 | 632 |
646 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) | 633 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) |
647 rebased_android_sdk_build_tools = | 634 rebased_android_sdk_build_tools = |
648 rebase_path(android_sdk_build_tools, root_build_dir) | 635 rebase_path(android_sdk_build_tools, root_build_dir) |
649 | 636 |
650 android_sdk_jar = "$android_sdk/android.jar" | 637 android_sdk_jar = "$android_sdk/android.jar" |
651 rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir) | 638 rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir) |
652 android_default_aapt_path = "$rebased_android_sdk_build_tools/aapt" | 639 android_default_aapt_path = "$rebased_android_sdk_build_tools/aapt" |
653 | 640 |
654 android_configuration_name = "Release" | 641 android_configuration_name = "Release" |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 if (invoker.native_libs != []) { | 1265 if (invoker.native_libs != []) { |
1279 _rebased_native_libs = rebase_path(invoker.native_libs, root_build_dir) | 1266 _rebased_native_libs = rebase_path(invoker.native_libs, root_build_dir) |
1280 args += [ "--native-libs=$_rebased_native_libs" ] | 1267 args += [ "--native-libs=$_rebased_native_libs" ] |
1281 } | 1268 } |
1282 if (defined(invoker.native_libs_filearg)) { | 1269 if (defined(invoker.native_libs_filearg)) { |
1283 args += [ "--native-libs=${invoker.native_libs_filearg}" ] | 1270 args += [ "--native-libs=${invoker.native_libs_filearg}" ] |
1284 } | 1271 } |
1285 if (_native_lib_placeholders != []) { | 1272 if (_native_lib_placeholders != []) { |
1286 args += [ "--native-lib-placeholders=$_native_lib_placeholders" ] | 1273 args += [ "--native-lib-placeholders=$_native_lib_placeholders" ] |
1287 } | 1274 } |
1288 | 1275 if (defined(invoker.secondary_native_libs) && |
1289 # TODO (michaelbai): Remove the secondary_native_libs variable. | 1276 invoker.secondary_native_libs != []) { |
1290 if (defined(invoker.secondary_abi_native_libs_filearg)) { | |
1291 assert(defined(android_app_secondary_abi)) | |
1292 args += [ | |
1293 "--secondary-native-libs=${invoker.secondary_abi_native_libs_filearg}"
, | |
1294 "--secondary-android-abi=$android_app_secondary_abi", | |
1295 ] | |
1296 } else if (defined(invoker.secondary_native_libs) && | |
1297 invoker.secondary_native_libs != []) { | |
1298 assert(defined(android_app_secondary_abi)) | 1277 assert(defined(android_app_secondary_abi)) |
1299 inputs += invoker.secondary_native_libs | 1278 inputs += invoker.secondary_native_libs |
1300 _secondary_native_libs = rebase_path(invoker.secondary_native_libs) | 1279 _secondary_native_libs = rebase_path(invoker.secondary_native_libs) |
1301 args += [ | 1280 args += [ |
1302 "--secondary-native-libs=$_secondary_native_libs", | 1281 "--secondary-native-libs=$_secondary_native_libs", |
1303 "--secondary-android-abi=$android_app_secondary_abi", | 1282 "--secondary-android-abi=$android_app_secondary_abi", |
1304 ] | 1283 ] |
1305 } | 1284 } |
1306 | 1285 |
1307 if (defined(invoker.emma_instrument) && invoker.emma_instrument) { | 1286 if (defined(invoker.emma_instrument) && invoker.emma_instrument) { |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 } | 1591 } |
1613 | 1592 |
1614 package_target = "${target_name}__package" | 1593 package_target = "${target_name}__package" |
1615 package_apk(package_target) { | 1594 package_apk(package_target) { |
1616 forward_variables_from(invoker, | 1595 forward_variables_from(invoker, |
1617 [ | 1596 [ |
1618 "assets_build_config", | 1597 "assets_build_config", |
1619 "emma_instrument", | 1598 "emma_instrument", |
1620 "native_lib_placeholders", | 1599 "native_lib_placeholders", |
1621 "native_libs_filearg", | 1600 "native_libs_filearg", |
1622 "secondary_abi_native_libs_filearg", | |
1623 "secondary_native_libs", | 1601 "secondary_native_libs", |
1624 "uncompress_shared_libraries", | 1602 "uncompress_shared_libraries", |
1625 "write_asset_list", | 1603 "write_asset_list", |
1626 ]) | 1604 ]) |
1627 deps = _deps + [ ":${_package_resources_target_name}" ] | 1605 deps = _deps + [ ":${_package_resources_target_name}" ] |
1628 native_libs = _native_libs + _native_libs_even_when_incremental | 1606 native_libs = _native_libs + _native_libs_even_when_incremental |
1629 | 1607 |
1630 if (defined(_dex_path)) { | 1608 if (defined(_dex_path)) { |
1631 dex_path = _dex_path | 1609 dex_path = _dex_path |
1632 } | 1610 } |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2655 | 2633 |
2656 script = "//build/android/gyp/generate_split_manifest.py" | 2634 script = "//build/android/gyp/generate_split_manifest.py" |
2657 outputs = [ | 2635 outputs = [ |
2658 invoker.out_manifest, | 2636 invoker.out_manifest, |
2659 ] | 2637 ] |
2660 inputs = [ | 2638 inputs = [ |
2661 invoker.main_manifest, | 2639 invoker.main_manifest, |
2662 ] | 2640 ] |
2663 } | 2641 } |
2664 } | 2642 } |
2665 | |
2666 template("pack_relocation_section") { | |
2667 assert(defined(invoker.file_list_json)) | |
2668 assert(defined(invoker.libraries_filearg)) | |
2669 action(target_name) { | |
2670 forward_variables_from(invoker, | |
2671 [ | |
2672 "deps", | |
2673 "public_deps", | |
2674 "inputs", | |
2675 "testonly", | |
2676 ]) | |
2677 script = "//build/android/gyp/pack_relocations.py" | |
2678 depfile = "$target_gen_dir/$target_name.d" | |
2679 _packed_libraries_dir = "$target_gen_dir/$target_name/packed-libs" | |
2680 outputs = [ | |
2681 invoker.file_list_json, | |
2682 ] | |
2683 deps += [ relocation_packer_target ] | |
2684 | |
2685 args = [ | |
2686 "--depfile", | |
2687 rebase_path(depfile, root_build_dir), | |
2688 "--enable-packing=1", | |
2689 "--android-pack-relocations", | |
2690 rebase_path(relocation_packer_exe, root_build_dir), | |
2691 "--stripped-libraries-dir", | |
2692 rebase_path(root_build_dir, root_build_dir), | |
2693 "--packed-libraries-dir", | |
2694 rebase_path(_packed_libraries_dir, root_build_dir), | |
2695 "--libraries=${invoker.libraries_filearg}", | |
2696 "--filelistjson", | |
2697 rebase_path(invoker.file_list_json, root_build_dir), | |
2698 ] | |
2699 } | |
2700 } | |
2701 } | 2643 } |
OLD | NEW |