Chromium Code Reviews| 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") | |
| 8 | 9 |
| 9 assert(is_android) | 10 assert(is_android) |
| 10 | 11 |
| 11 # These identify targets that have .build_config files (except for android_apk, | 12 # 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). | 13 # java_binary, resource_rewriter, since we never need to depend on these). |
| 13 _java_target_whitelist = [ | 14 _java_target_whitelist = [ |
| 14 "*:*_java", | 15 "*:*_java", |
| 15 "*:*_javalib", | 16 "*:*_javalib", |
| 16 "*:*_java_*", # e.g. java_test_support | 17 "*:*_java_*", # e.g. java_test_support |
| 17 "*:java", | 18 "*:java", |
| (...skipping 276 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 | 295 # 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 | 296 # avoid having to depend on the runtime_deps target. See comment in |
| 296 # rules.gni for why we do this. | 297 # rules.gni for why we do this. |
| 297 args += [ | 298 args += [ |
| 298 "--shared-libraries-runtime-deps", | 299 "--shared-libraries-runtime-deps", |
| 299 rebase_path(invoker.shared_libraries_runtime_deps_file, | 300 rebase_path(invoker.shared_libraries_runtime_deps_file, |
| 300 root_build_dir), | 301 root_build_dir), |
| 301 ] | 302 ] |
| 302 } | 303 } |
| 303 | 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 | |
| 304 if (defined(invoker.proguard_enabled) && invoker.proguard_enabled) { | 316 if (defined(invoker.proguard_enabled) && invoker.proguard_enabled) { |
| 305 args += [ | 317 args += [ |
| 306 "--proguard-enabled", | 318 "--proguard-enabled", |
| 307 "--proguard-info", | 319 "--proguard-info", |
| 308 rebase_path(invoker.proguard_info, root_build_dir), | 320 rebase_path(invoker.proguard_info, root_build_dir), |
| 309 ] | 321 ] |
| 310 } | 322 } |
| 311 | 323 |
| 312 if (defined(invoker.apk_path)) { | 324 if (defined(invoker.apk_path)) { |
| 313 _rebased_apk_path = rebase_path(invoker.apk_path, root_build_dir) | 325 _rebased_apk_path = rebase_path(invoker.apk_path, root_build_dir) |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1272 if (invoker.native_libs != []) { | 1284 if (invoker.native_libs != []) { |
| 1273 _rebased_native_libs = rebase_path(invoker.native_libs, root_build_dir) | 1285 _rebased_native_libs = rebase_path(invoker.native_libs, root_build_dir) |
| 1274 args += [ "--native-libs=$_rebased_native_libs" ] | 1286 args += [ "--native-libs=$_rebased_native_libs" ] |
| 1275 } | 1287 } |
| 1276 if (defined(invoker.native_libs_filearg)) { | 1288 if (defined(invoker.native_libs_filearg)) { |
| 1277 args += [ "--native-libs=${invoker.native_libs_filearg}" ] | 1289 args += [ "--native-libs=${invoker.native_libs_filearg}" ] |
| 1278 } | 1290 } |
| 1279 if (_native_lib_placeholders != []) { | 1291 if (_native_lib_placeholders != []) { |
| 1280 args += [ "--native-lib-placeholders=$_native_lib_placeholders" ] | 1292 args += [ "--native-lib-placeholders=$_native_lib_placeholders" ] |
| 1281 } | 1293 } |
| 1282 if (defined(invoker.secondary_native_libs) && | 1294 |
| 1283 invoker.secondary_native_libs != []) { | 1295 # TODO (michaelbai): Remove the secondary_native_libs variable. |
| 1296 if (defined(invoker.secondary_abi_native_libs_filearg)) { | |
| 1297 assert(defined(android_app_secondary_abi)) | |
| 1298 args += [ | |
| 1299 "--secondary-native-libs=${invoker.secondary_abi_native_libs_filearg}" , | |
| 1300 "--secondary-android-abi=$android_app_secondary_abi", | |
| 1301 ] | |
| 1302 } else if (defined(invoker.secondary_native_libs) && | |
| 1303 invoker.secondary_native_libs != []) { | |
| 1284 assert(defined(android_app_secondary_abi)) | 1304 assert(defined(android_app_secondary_abi)) |
| 1285 inputs += invoker.secondary_native_libs | 1305 inputs += invoker.secondary_native_libs |
| 1286 _secondary_native_libs = rebase_path(invoker.secondary_native_libs) | 1306 _secondary_native_libs = rebase_path(invoker.secondary_native_libs) |
| 1287 args += [ | 1307 args += [ |
| 1288 "--secondary-native-libs=$_secondary_native_libs", | 1308 "--secondary-native-libs=$_secondary_native_libs", |
| 1289 "--secondary-android-abi=$android_app_secondary_abi", | 1309 "--secondary-android-abi=$android_app_secondary_abi", |
| 1290 ] | 1310 ] |
| 1291 } | 1311 } |
| 1292 | 1312 |
| 1293 if (defined(invoker.emma_instrument) && invoker.emma_instrument) { | 1313 if (defined(invoker.emma_instrument) && invoker.emma_instrument) { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1601 } | 1621 } |
| 1602 | 1622 |
| 1603 package_target = "${target_name}__package" | 1623 package_target = "${target_name}__package" |
| 1604 package_apk(package_target) { | 1624 package_apk(package_target) { |
| 1605 forward_variables_from(invoker, | 1625 forward_variables_from(invoker, |
| 1606 [ | 1626 [ |
| 1607 "assets_build_config", | 1627 "assets_build_config", |
| 1608 "emma_instrument", | 1628 "emma_instrument", |
| 1609 "native_lib_placeholders", | 1629 "native_lib_placeholders", |
| 1610 "native_libs_filearg", | 1630 "native_libs_filearg", |
| 1631 "secondary_abi_native_libs_filearg", | |
| 1611 "secondary_native_libs", | 1632 "secondary_native_libs", |
| 1612 "uncompress_shared_libraries", | 1633 "uncompress_shared_libraries", |
| 1613 "write_asset_list", | 1634 "write_asset_list", |
| 1614 ]) | 1635 ]) |
| 1615 deps = _deps + [ ":${_package_resources_target_name}" ] | 1636 deps = _deps + [ ":${_package_resources_target_name}" ] |
| 1616 native_libs = _native_libs + _native_libs_even_when_incremental | 1637 native_libs = _native_libs + _native_libs_even_when_incremental |
| 1617 | 1638 |
| 1618 if (defined(_dex_path)) { | 1639 if (defined(_dex_path)) { |
| 1619 dex_path = _dex_path | 1640 dex_path = _dex_path |
| 1620 } | 1641 } |
| (...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2647 outputs = [ | 2668 outputs = [ |
| 2648 depfile, | 2669 depfile, |
| 2649 invoker.out_manifest, | 2670 invoker.out_manifest, |
| 2650 ] | 2671 ] |
| 2651 inputs = [ | 2672 inputs = [ |
| 2652 invoker.main_manifest, | 2673 invoker.main_manifest, |
| 2653 ] | 2674 ] |
| 2654 } | 2675 } |
| 2655 } | 2676 } |
| 2656 } | 2677 } |
| 2678 | |
| 2679 template("pack_relocation_section") { | |
| 2680 assert(defined(invoker.file_list_json)) | |
| 2681 assert(defined(invoker.libraries_filearg)) | |
| 2682 action(target_name) { | |
| 2683 forward_variables_from(invoker, | |
| 2684 [ | |
| 2685 "deps", | |
| 2686 "public_deps", | |
| 2687 "file_list_json", | |
|
agrieve
2016/09/08 01:02:15
nit: don't forward file_list_json and libraries_fi
michaelbai
2016/09/08 18:52:51
Thanks, sometime, I am confused about what should
| |
| 2688 "inputs", | |
| 2689 "libraries_filearg", | |
| 2690 "testonly", | |
| 2691 ]) | |
| 2692 script = "//build/android/gyp/pack_relocations.py" | |
| 2693 depfile = "$target_gen_dir/$target_name.d" | |
| 2694 packed_libraries_dir = "$target_gen_dir/$target_name/packed-libs" | |
|
agrieve
2016/09/08 01:02:15
nit: prefix with _
michaelbai
2016/09/08 18:52:51
Done.
| |
| 2695 outputs = [ | |
| 2696 file_list_json, | |
| 2697 ] | |
| 2698 deps += [ relocation_packer_target ] | |
| 2699 | |
| 2700 args = [ | |
| 2701 "--depfile", | |
| 2702 rebase_path(depfile, root_build_dir), | |
| 2703 "--enable-packing=1", | |
| 2704 "--android-pack-relocations", | |
| 2705 rebase_path(relocation_packer_exe, root_build_dir), | |
| 2706 "--stripped-libraries-dir", | |
| 2707 rebase_path(root_build_dir, root_build_dir), | |
| 2708 "--packed-libraries-dir", | |
| 2709 rebase_path(packed_libraries_dir, root_build_dir), | |
| 2710 "--libraries=$libraries_filearg", | |
| 2711 "--filelistjson", | |
| 2712 rebase_path(file_list_json, root_build_dir), | |
| 2713 ] | |
| 2714 } | |
| 2715 } | |
| OLD | NEW |