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