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("//base/android/linker/config.gni") | 5 import("//base/android/linker/config.gni") |
6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
7 import("//build/config/android/internal_rules.gni") | 7 import("//build/config/android/internal_rules.gni") |
8 import("//build/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
9 import("//third_party/android_platform/config.gni") | 9 import("//third_party/android_platform/config.gni") |
10 import("//tools/grit/grit_rule.gni") | 10 import("//tools/grit/grit_rule.gni") |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 # "transitive closure" of these dependencies will be included in the apk. | 1184 # "transitive closure" of these dependencies will be included in the apk. |
1185 # Note: this "transitive closure" actually only includes such targets if | 1185 # Note: this "transitive closure" actually only includes such targets if |
1186 # they are depended on through android_library or android_resources targets | 1186 # they are depended on through android_library or android_resources targets |
1187 # (and so not through builtin targets like 'action', 'group', etc). | 1187 # (and so not through builtin targets like 'action', 'group', etc). |
1188 # java_files: List of .java files to include in the apk. | 1188 # java_files: List of .java files to include in the apk. |
1189 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars | 1189 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars |
1190 # will be added to java_files and be included in this apk. | 1190 # will be added to java_files and be included in this apk. |
1191 # apk_name: Name for final apk. | 1191 # apk_name: Name for final apk. |
1192 # final_apk_path: Path to final built apk. Default is | 1192 # final_apk_path: Path to final built apk. Default is |
1193 # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name. | 1193 # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name. |
| 1194 # loadable_modules: List of paths to native libraries to include. Different |
| 1195 # from |native_libs| in that: |
| 1196 # * dependencies of this .so are not automatically included |
| 1197 # * ".cr.so" is never added |
| 1198 # * they are not side-loaded for _incremental targets. |
| 1199 # * load_library_from_apk, use_chromium_linker, |
| 1200 # and enable_relocation_packing do not apply |
| 1201 # Use this instead of native_libs when you are going to load the library |
| 1202 # conditionally, and only when native_libs doesn't work for you. |
1194 # native_libs: List paths of native libraries to include in this apk. If these | 1203 # native_libs: List paths of native libraries to include in this apk. If these |
1195 # libraries depend on other shared_library targets, those dependencies will | 1204 # libraries depend on other shared_library targets, those dependencies will |
1196 # also be included in the apk. | 1205 # also be included in the apk. When building with is_component_build, |
| 1206 # The extension is automatically changed to ".cr.so". |
1197 # native_lib_placeholders: List of placeholder filenames to add to the apk | 1207 # native_lib_placeholders: List of placeholder filenames to add to the apk |
1198 # (optional). | 1208 # (optional). |
1199 # apk_under_test: For an instrumentation test apk, this is the target of the | 1209 # apk_under_test: For an instrumentation test apk, this is the target of the |
1200 # tested apk. | 1210 # tested apk. |
1201 # include_all_resources - If true include all resource IDs in all generated | 1211 # include_all_resources - If true include all resource IDs in all generated |
1202 # R.java files. | 1212 # R.java files. |
1203 # testonly: Marks this target as "test-only". | 1213 # testonly: Marks this target as "test-only". |
1204 # write_asset_list: Adds an extra file to the assets, which contains a list of | 1214 # write_asset_list: Adds an extra file to the assets, which contains a list of |
1205 # all other asset files. | 1215 # all other asset files. |
1206 # | 1216 # |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1620 "--packed-libraries-dir", | 1630 "--packed-libraries-dir", |
1621 rebase_path(_native_libs_dir, root_build_dir), | 1631 rebase_path(_native_libs_dir, root_build_dir), |
1622 "--libraries=@FileArg(${_rebased_build_config}:native:libraries)", | 1632 "--libraries=@FileArg(${_rebased_build_config}:native:libraries)", |
1623 "--filelistjson=$_rebased_native_libs_json", | 1633 "--filelistjson=$_rebased_native_libs_json", |
1624 ] | 1634 ] |
1625 } | 1635 } |
1626 } | 1636 } |
1627 | 1637 |
1628 _extra_native_libs = [] | 1638 _extra_native_libs = [] |
1629 _extra_native_libs_deps = [] | 1639 _extra_native_libs_deps = [] |
| 1640 _extra_native_libs_even_when_incremental = [] |
| 1641 _extra_native_libs_even_when_incremental_deps = [] |
| 1642 assert(_extra_native_libs_even_when_incremental_deps == []) # Mark as used. |
1630 if (_native_libs != []) { | 1643 if (_native_libs != []) { |
1631 _extra_native_libs_even_when_incremental = [] | |
1632 _extra_native_libs_even_when_incremental_deps = [] | |
1633 | |
1634 if (is_debug) { | 1644 if (is_debug) { |
1635 _extra_native_libs_even_when_incremental = [ android_gdbserver ] | 1645 _extra_native_libs_even_when_incremental = [ android_gdbserver ] |
1636 } | 1646 } |
1637 | 1647 |
1638 if (_use_chromium_linker) { | 1648 if (_use_chromium_linker) { |
1639 _extra_native_libs = | 1649 _extra_native_libs = |
1640 [ "$root_shlib_dir/libchromium_android_linker$shlib_extension" ] | 1650 [ "$root_shlib_dir/libchromium_android_linker$shlib_extension" ] |
1641 _extra_native_libs_deps += | 1651 _extra_native_libs_deps += |
1642 [ "//base/android/linker:chromium_android_linker" ] | 1652 [ "//base/android/linker:chromium_android_linker" ] |
1643 } | 1653 } |
1644 } | 1654 } |
| 1655 if (defined(invoker.loadable_modules) && invoker.loadable_modules != []) { |
| 1656 _extra_native_libs_even_when_incremental += invoker.loadable_modules |
| 1657 } |
1645 | 1658 |
1646 _final_deps += [ ":${_template_name}__create" ] | 1659 _final_deps += [ ":${_template_name}__create" ] |
1647 create_apk("${_template_name}__create") { | 1660 create_apk("${_template_name}__create") { |
1648 deps = [] | 1661 deps = [] |
1649 forward_variables_from(invoker, | 1662 forward_variables_from(invoker, |
1650 [ | 1663 [ |
1651 "asset_location", | 1664 "asset_location", |
1652 "deps", | 1665 "deps", |
1653 "extensions_to_not_compress", | 1666 "extensions_to_not_compress", |
1654 "language_splits", | 1667 "language_splits", |
(...skipping 30 matching lines...) Expand all Loading... |
1685 ":$process_resources_target", | 1698 ":$process_resources_target", |
1686 ] | 1699 ] |
1687 | 1700 |
1688 # This target generates the input file _all_resources_zip_path. | 1701 # This target generates the input file _all_resources_zip_path. |
1689 deps += _android_manifest_deps + [ | 1702 deps += _android_manifest_deps + [ |
1690 ":$build_config_target", | 1703 ":$build_config_target", |
1691 ":$process_resources_target", | 1704 ":$process_resources_target", |
1692 ":$final_dex_target_name", | 1705 ":$final_dex_target_name", |
1693 ] | 1706 ] |
1694 | 1707 |
1695 if (_native_libs != [] && !_create_abi_split) { | 1708 if ((_native_libs != [] || _extra_native_libs_even_when_incremental != []) &
& !_create_abi_split) { |
1696 deps += _native_libs_deps + _extra_native_libs_deps + | 1709 deps += _native_libs_deps + _extra_native_libs_deps + |
1697 _extra_native_libs_even_when_incremental_deps + | 1710 _extra_native_libs_even_when_incremental_deps + |
1698 [ _native_libs_file_arg_dep ] | 1711 [ _native_libs_file_arg_dep ] |
1699 native_libs_filearg = _native_libs_file_arg | 1712 native_libs_filearg = _native_libs_file_arg |
1700 native_libs = _extra_native_libs | 1713 native_libs = _extra_native_libs |
1701 native_libs_even_when_incremental = | 1714 native_libs_even_when_incremental = |
1702 _extra_native_libs_even_when_incremental | 1715 _extra_native_libs_even_when_incremental |
1703 | 1716 |
1704 # Placeholders necessary for some older devices. | 1717 # Placeholders necessary for some older devices. |
1705 # http://crbug.com/395038 | 1718 # http://crbug.com/395038 |
1706 forward_variables_from(invoker, [ "native_lib_placeholders" ]) | 1719 forward_variables_from(invoker, [ "native_lib_placeholders" ]) |
1707 } | 1720 } |
1708 } | 1721 } |
1709 | 1722 |
1710 if (_native_libs != [] && _create_abi_split) { | 1723 if ((_native_libs != [] || _extra_native_libs_even_when_incremental != []) && |
| 1724 _create_abi_split) { |
1711 _manifest_rule = "${_template_name}__split_manifest_abi_${android_app_abi}" | 1725 _manifest_rule = "${_template_name}__split_manifest_abi_${android_app_abi}" |
1712 generate_split_manifest(_manifest_rule) { | 1726 generate_split_manifest(_manifest_rule) { |
1713 main_manifest = _android_manifest | 1727 main_manifest = _android_manifest |
1714 out_manifest = | 1728 out_manifest = |
1715 "$gen_dir/split-manifests/${android_app_abi}/AndroidManifest.xml" | 1729 "$gen_dir/split-manifests/${android_app_abi}/AndroidManifest.xml" |
1716 split_name = "abi_${android_app_abi}" | 1730 split_name = "abi_${android_app_abi}" |
1717 deps = _android_manifest_deps | 1731 deps = _android_manifest_deps |
1718 } | 1732 } |
1719 | 1733 |
1720 _apk_rule = "${_template_name}__split_apk_abi_${android_app_abi}" | 1734 _apk_rule = "${_template_name}__split_apk_abi_${android_app_abi}" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2214 } | 2228 } |
2215 | 2229 |
2216 android_library(target_name) { | 2230 android_library(target_name) { |
2217 java_files = [] | 2231 java_files = [] |
2218 srcjar_deps = [ ":${_template_name}__protoc_java" ] | 2232 srcjar_deps = [ ":${_template_name}__protoc_java" ] |
2219 deps = [ | 2233 deps = [ |
2220 "//third_party/android_protobuf:protobuf_nano_javalib", | 2234 "//third_party/android_protobuf:protobuf_nano_javalib", |
2221 ] | 2235 ] |
2222 } | 2236 } |
2223 } | 2237 } |
OLD | NEW |