Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: build/config/android/internal_rules.gni

Issue 2594803002: Android: Delete rezip in favor of zipalign -p (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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. 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. 6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in.
7 import("//build_overrides/build.gni") 7 import("//build_overrides/build.gni")
8 import("//build/config/android/config.gni") 8 import("//build/config/android/config.gni")
9 import("//build/config/dcheck_always_on.gni") 9 import("//build/config/dcheck_always_on.gni")
10 import("//build/config/sanitizers/sanitizers.gni") 10 import("//build/config/sanitizers/sanitizers.gni")
(...skipping 14 matching lines...) Expand all
25 "*:*_assets", 25 "*:*_assets",
26 "*android*:assets", 26 "*android*:assets",
27 "*:*_apk_*resources", 27 "*:*_apk_*resources",
28 "*android*:resources", 28 "*android*:resources",
29 "*:*_resources", 29 "*:*_resources",
30 "*:*_grd", 30 "*:*_grd",
31 "*:*locale_paks", 31 "*:*locale_paks",
32 32
33 # TODO(agrieve): Rename targets below to match above patterns. 33 # TODO(agrieve): Rename targets below to match above patterns.
34 "*android_webview/glue:glue", 34 "*android_webview/glue:glue",
35 "//build/android/rezip:rezip",
36 "//chrome/test/android/cast_emulator:cast_emulator", 35 "//chrome/test/android/cast_emulator:cast_emulator",
37 ] 36 ]
38 37
39 # Targets that match the whitelist but are not actually java targets. 38 # Targets that match the whitelist but are not actually java targets.
40 _java_target_blacklist = [ 39 _java_target_blacklist = [
41 "//chrome:packed_resources", 40 "//chrome:packed_resources",
42 "//remoting/android:remoting_android_raw_resources", 41 "//remoting/android:remoting_android_raw_resources",
43 "*:*_unpack_aar", 42 "*:*_unpack_aar",
44 ] 43 ]
45 44
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 } 1377 }
1379 1378
1380 # Signs & zipaligns an apk. 1379 # Signs & zipaligns an apk.
1381 # 1380 #
1382 # Variables 1381 # Variables
1383 # input_apk_path: Path of the .apk to be finalized. 1382 # input_apk_path: Path of the .apk to be finalized.
1384 # output_apk_path: Output path for the generated .apk. 1383 # output_apk_path: Output path for the generated .apk.
1385 # keystore_path: Path to keystore to use for signing. 1384 # keystore_path: Path to keystore to use for signing.
1386 # keystore_name: Key alias to use. 1385 # keystore_name: Key alias to use.
1387 # keystore_password: Keystore password. 1386 # keystore_password: Keystore password.
1388 # rezip_apk: Whether to add crazy-linker alignment.
1389 template("finalize_apk") { 1387 template("finalize_apk") {
1390 action(target_name) { 1388 action(target_name) {
1391 deps = [] 1389 deps = []
1392 script = "//build/android/gyp/finalize_apk.py" 1390 script = "//build/android/gyp/finalize_apk.py"
1393 depfile = "$target_gen_dir/$target_name.d" 1391 depfile = "$target_gen_dir/$target_name.d"
1394 forward_variables_from(invoker, 1392 forward_variables_from(invoker,
1395 [ 1393 [
1396 "deps", 1394 "deps",
1397 "data_deps", 1395 "data_deps",
1398 "public_deps", 1396 "public_deps",
(...skipping 22 matching lines...) Expand all
1421 rebase_path(invoker.input_apk_path, root_build_dir), 1419 rebase_path(invoker.input_apk_path, root_build_dir),
1422 "--final-apk-path", 1420 "--final-apk-path",
1423 rebase_path(invoker.output_apk_path, root_build_dir), 1421 rebase_path(invoker.output_apk_path, root_build_dir),
1424 "--key-path", 1422 "--key-path",
1425 rebase_path(invoker.keystore_path, root_build_dir), 1423 rebase_path(invoker.keystore_path, root_build_dir),
1426 "--key-name", 1424 "--key-name",
1427 invoker.keystore_name, 1425 invoker.keystore_name,
1428 "--key-passwd", 1426 "--key-passwd",
1429 invoker.keystore_password, 1427 invoker.keystore_password,
1430 ] 1428 ]
1431 if (defined(invoker.rezip_apk) && invoker.rezip_apk) {
1432 deps += [ "//build/android/rezip" ]
1433 _rezip_jar_path = "$root_build_dir/lib.java/rezip_apk.jar"
1434 args += [
1435 "--load-library-from-zip=1",
1436 "--rezip-apk-jar-path",
1437 rebase_path(_rezip_jar_path, root_build_dir),
1438 ]
1439 }
1440
1441 if (defined(invoker.page_align_shared_libraries) &&
1442 invoker.page_align_shared_libraries) {
1443 args += [ "--page-align-shared-libraries" ]
1444 }
1445 } 1429 }
1446 } 1430 }
1447 1431
1448 # Packages resources, assets, dex, and native libraries into an apk. Signs and 1432 # Packages resources, assets, dex, and native libraries into an apk. Signs and
1449 # zipaligns the apk. 1433 # zipaligns the apk.
1450 template("create_apk") { 1434 template("create_apk") {
1451 set_sources_assignment_filter([]) 1435 set_sources_assignment_filter([])
1452 forward_variables_from(invoker, [ "testonly" ]) 1436 forward_variables_from(invoker, [ "testonly" ])
1453 1437
1454 _android_manifest = invoker.android_manifest 1438 _android_manifest = invoker.android_manifest
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 [ 1661 [
1678 "assets_build_config", 1662 "assets_build_config",
1679 "emma_instrument", 1663 "emma_instrument",
1680 "native_lib_placeholders", 1664 "native_lib_placeholders",
1681 "native_libs_filearg", 1665 "native_libs_filearg",
1682 "secondary_abi_native_libs_filearg", 1666 "secondary_abi_native_libs_filearg",
1683 "secondary_native_libs", 1667 "secondary_native_libs",
1684 "uncompress_shared_libraries", 1668 "uncompress_shared_libraries",
1685 "write_asset_list", 1669 "write_asset_list",
1686 ]) 1670 ])
1671 if (!defined(uncompress_shared_libraries)) {
1672 uncompress_shared_libraries = _load_library_from_apk
1673 }
1687 deps = _deps + [ ":${_package_resources_target_name}" ] 1674 deps = _deps + [ ":${_package_resources_target_name}" ]
1688 native_libs = _native_libs + _native_libs_even_when_incremental 1675 native_libs = _native_libs + _native_libs_even_when_incremental
1689 1676
1690 if (defined(_dex_path)) { 1677 if (defined(_dex_path)) {
1691 dex_path = _dex_path 1678 dex_path = _dex_path
1692 } 1679 }
1693 1680
1694 output_apk_path = _packaged_apk_path 1681 output_apk_path = _packaged_apk_path
1695 resource_packaged_apk_path = _resource_packaged_apk_path 1682 resource_packaged_apk_path = _resource_packaged_apk_path
1696 } 1683 }
1697 1684
1698 _incremental_package_target = "${target_name}_incremental__package" 1685 _incremental_package_target = "${target_name}_incremental__package"
1699 package_apk(_incremental_package_target) { 1686 package_apk(_incremental_package_target) {
1700 forward_variables_from(invoker, 1687 forward_variables_from(invoker,
1701 [ 1688 [
1702 "assets_build_config", 1689 "assets_build_config",
1703 "emma_instrument", 1690 "emma_instrument",
1704 "secondary_native_libs", 1691 "secondary_native_libs",
1705 "uncompress_shared_libraries", 1692 "uncompress_shared_libraries",
1706 ]) 1693 ])
1694 if (!defined(uncompress_shared_libraries)) {
1695 uncompress_shared_libraries = _load_library_from_apk
1696 }
1707 _dex_target = "//build/android/incremental_install:bootstrap_java__dex" 1697 _dex_target = "//build/android/incremental_install:bootstrap_java__dex"
1708 deps = _incremental_deps + [ 1698 deps = _incremental_deps + [
1709 ":${_incremental_package_resources_target_name}", 1699 ":${_incremental_package_resources_target_name}",
1710 _dex_target, 1700 _dex_target,
1711 ] 1701 ]
1712 1702
1713 if (defined(_dex_path)) { 1703 if (defined(_dex_path)) {
1714 dex_path = 1704 dex_path =
1715 get_label_info(_dex_target, "target_gen_dir") + "/bootstrap.dex" 1705 get_label_info(_dex_target, "target_gen_dir") + "/bootstrap.dex"
1716 } 1706 }
1717 1707
1718 native_libs = _native_libs_even_when_incremental 1708 native_libs = _native_libs_even_when_incremental
1719 1709
1720 # http://crbug.com/384638 1710 # http://crbug.com/384638
1721 _has_native_libs = 1711 _has_native_libs =
1722 defined(invoker.native_libs_filearg) || _native_libs != [] 1712 defined(invoker.native_libs_filearg) || _native_libs != []
1723 if (_has_native_libs && _native_libs_even_when_incremental == []) { 1713 if (_has_native_libs && _native_libs_even_when_incremental == []) {
1724 native_lib_placeholders = [ "libfix.crbug.384638.so" ] 1714 native_lib_placeholders = [ "libfix.crbug.384638.so" ]
1725 } 1715 }
1726 1716
1727 output_apk_path = _incremental_packaged_apk_path 1717 output_apk_path = _incremental_packaged_apk_path
1728 resource_packaged_apk_path = _incremental_resource_packaged_apk_path 1718 resource_packaged_apk_path = _incremental_resource_packaged_apk_path
1729 } 1719 }
1730 1720
1731 _finalize_apk_rule_name = "${target_name}__finalize" 1721 _finalize_apk_rule_name = "${target_name}__finalize"
1732 finalize_apk(_finalize_apk_rule_name) { 1722 finalize_apk(_finalize_apk_rule_name) {
1733 forward_variables_from(invoker, [ "page_align_shared_libraries" ])
1734
1735 input_apk_path = _packaged_apk_path 1723 input_apk_path = _packaged_apk_path
1736 output_apk_path = _final_apk_path 1724 output_apk_path = _final_apk_path
1737 keystore_path = _keystore_path 1725 keystore_path = _keystore_path
1738 keystore_name = _keystore_name 1726 keystore_name = _keystore_name
1739 keystore_password = _keystore_password 1727 keystore_password = _keystore_password
1740 rezip_apk = _load_library_from_apk
1741 1728
1742 public_deps = [ 1729 public_deps = [
1743 # Generator of the _packaged_apk_path this target takes as input. 1730 # Generator of the _packaged_apk_path this target takes as input.
1744 ":$package_target", 1731 ":$package_target",
1745 ] 1732 ]
1746 } 1733 }
1747 1734
1748 _incremental_finalize_apk_rule_name = "${target_name}_incremental__finalize" 1735 _incremental_finalize_apk_rule_name = "${target_name}_incremental__finalize"
1749 finalize_apk(_incremental_finalize_apk_rule_name) { 1736 finalize_apk(_incremental_finalize_apk_rule_name) {
1750 input_apk_path = _incremental_packaged_apk_path 1737 input_apk_path = _incremental_packaged_apk_path
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
2805 rebase_path(root_build_dir, root_build_dir), 2792 rebase_path(root_build_dir, root_build_dir),
2806 "--packed-libraries-dir", 2793 "--packed-libraries-dir",
2807 rebase_path(_packed_libraries_dir, root_build_dir), 2794 rebase_path(_packed_libraries_dir, root_build_dir),
2808 "--libraries=${invoker.libraries_filearg}", 2795 "--libraries=${invoker.libraries_filearg}",
2809 "--filelistjson", 2796 "--filelistjson",
2810 rebase_path(invoker.file_list_json, root_build_dir), 2797 rebase_path(invoker.file_list_json, root_build_dir),
2811 ] 2798 ]
2812 } 2799 }
2813 } 2800 }
2814 } 2801 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698