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