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

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

Issue 2632283002: Use more generic approach to pack java resources into final APK. (Closed)
Patch Set: GypList->GnList Created 3 years, 11 months 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
« no previous file with comments | « build/android/gyp/write_build_config.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 assert(is_deps_dex || true) 171 assert(is_deps_dex || true)
172 assert(is_group || true) 172 assert(is_group || true)
173 173
174 if (is_java || is_apk) { 174 if (is_java || is_apk) {
175 args += [ 175 args += [
176 "--jar-path", 176 "--jar-path",
177 rebase_path(invoker.jar_path, root_build_dir), 177 rebase_path(invoker.jar_path, root_build_dir),
178 ] 178 ]
179 } 179 }
180 180
181 if (is_java && defined(invoker.java_resources_jar)) {
182 args += [
183 "--java-resources-jar-path",
184 rebase_path(invoker.java_resources_jar, root_build_dir),
185 ]
186 }
181 if (is_apk || is_deps_dex || (is_java && supports_android)) { 187 if (is_apk || is_deps_dex || (is_java && supports_android)) {
182 args += [ 188 args += [
183 "--dex-path", 189 "--dex-path",
184 rebase_path(invoker.dex_path, root_build_dir), 190 rebase_path(invoker.dex_path, root_build_dir),
185 ] 191 ]
186 } 192 }
187 if (supports_android) { 193 if (supports_android) {
188 args += [ "--supports-android" ] 194 args += [ "--supports-android" ]
189 } 195 }
190 if (requires_android) { 196 if (requires_android) {
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 "--output-apk=$_rebased_packaged_apk_path", 1338 "--output-apk=$_rebased_packaged_apk_path",
1333 ] 1339 ]
1334 if (defined(invoker.assets_build_config)) { 1340 if (defined(invoker.assets_build_config)) {
1335 inputs += [ invoker.assets_build_config ] 1341 inputs += [ invoker.assets_build_config ]
1336 _rebased_build_config = 1342 _rebased_build_config =
1337 rebase_path(invoker.assets_build_config, root_build_dir) 1343 rebase_path(invoker.assets_build_config, root_build_dir)
1338 args += [ 1344 args += [
1339 "--assets=@FileArg($_rebased_build_config:assets)", 1345 "--assets=@FileArg($_rebased_build_config:assets)",
1340 "--uncompressed-assets=@FileArg($_rebased_build_config:uncompressed_as sets)", 1346 "--uncompressed-assets=@FileArg($_rebased_build_config:uncompressed_as sets)",
1341 ] 1347 ]
1348
1349 # TODO(mlopatkin) We are relying on the fact that assets_build_config is
1350 # an APK build_config.
1351 args += [ "--java-resources=@FileArg($_rebased_build_config:java_resourc es_jars)" ]
1342 } 1352 }
1343 if (defined(invoker.write_asset_list) && invoker.write_asset_list) { 1353 if (defined(invoker.write_asset_list) && invoker.write_asset_list) {
1344 args += [ "--write-asset-list" ] 1354 args += [ "--write-asset-list" ]
1345 } 1355 }
1346 if (defined(invoker.dex_path)) { 1356 if (defined(invoker.dex_path)) {
1347 _rebased_dex_path = rebase_path(invoker.dex_path, root_build_dir) 1357 _rebased_dex_path = rebase_path(invoker.dex_path, root_build_dir)
1348 args += [ "--dex-file=$_rebased_dex_path" ] 1358 args += [ "--dex-file=$_rebased_dex_path" ]
1349 } 1359 }
1350 if (invoker.native_libs != [] || defined(invoker.native_libs_filearg) || 1360 if (invoker.native_libs != [] || defined(invoker.native_libs_filearg) ||
1351 _native_lib_placeholders != []) { 1361 _native_lib_placeholders != []) {
(...skipping 21 matching lines...) Expand all
1373 invoker.secondary_native_libs != []) { 1383 invoker.secondary_native_libs != []) {
1374 assert(defined(android_app_secondary_abi)) 1384 assert(defined(android_app_secondary_abi))
1375 inputs += invoker.secondary_native_libs 1385 inputs += invoker.secondary_native_libs
1376 _secondary_native_libs = rebase_path(invoker.secondary_native_libs) 1386 _secondary_native_libs = rebase_path(invoker.secondary_native_libs)
1377 args += [ 1387 args += [
1378 "--secondary-native-libs=$_secondary_native_libs", 1388 "--secondary-native-libs=$_secondary_native_libs",
1379 "--secondary-android-abi=$android_app_secondary_abi", 1389 "--secondary-android-abi=$android_app_secondary_abi",
1380 ] 1390 ]
1381 } 1391 }
1382 1392
1383 if (defined(invoker.emma_instrument) && invoker.emma_instrument) {
1384 _emma_device_jar = "$android_sdk_root/tools/lib/emma_device.jar"
1385 _rebased_emma_device_jar = rebase_path(_emma_device_jar, root_build_dir)
1386 args += [ "--emma-device-jar=$_rebased_emma_device_jar" ]
1387 }
1388
1389 if (defined(invoker.uncompress_shared_libraries) && 1393 if (defined(invoker.uncompress_shared_libraries) &&
1390 invoker.uncompress_shared_libraries) { 1394 invoker.uncompress_shared_libraries) {
1391 args += [ "--uncompress-shared-libraries" ] 1395 args += [ "--uncompress-shared-libraries" ]
1392 } 1396 }
1393 } 1397 }
1394 } 1398 }
1395 1399
1396 # Signs & zipaligns an apk. 1400 # Signs & zipaligns an apk.
1397 # 1401 #
1398 # Variables 1402 # Variables
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 _incremental_deps + [ ":$_generate_incremental_manifest_target_name" ] 1694 _incremental_deps + [ ":$_generate_incremental_manifest_target_name" ]
1691 android_manifest = _incremental_android_manifest 1695 android_manifest = _incremental_android_manifest
1692 resource_packaged_apk_path = _incremental_resource_packaged_apk_path 1696 resource_packaged_apk_path = _incremental_resource_packaged_apk_path
1693 } 1697 }
1694 1698
1695 package_target = "${target_name}__package" 1699 package_target = "${target_name}__package"
1696 package_apk(package_target) { 1700 package_apk(package_target) {
1697 forward_variables_from(invoker, 1701 forward_variables_from(invoker,
1698 [ 1702 [
1699 "assets_build_config", 1703 "assets_build_config",
1700 "emma_instrument",
1701 "native_lib_placeholders", 1704 "native_lib_placeholders",
1702 "native_libs_filearg", 1705 "native_libs_filearg",
1703 "secondary_abi_native_libs_filearg", 1706 "secondary_abi_native_libs_filearg",
1704 "secondary_native_libs", 1707 "secondary_native_libs",
1705 "uncompress_shared_libraries", 1708 "uncompress_shared_libraries",
1706 "write_asset_list", 1709 "write_asset_list",
1707 ]) 1710 ])
1708 deps = _deps + [ ":${_package_resources_target_name}" ] 1711 deps = _deps + [ ":${_package_resources_target_name}" ]
1709 native_libs = _native_libs + _native_libs_even_when_incremental 1712 native_libs = _native_libs + _native_libs_even_when_incremental
1710 1713
1711 if (defined(_dex_path)) { 1714 if (defined(_dex_path)) {
1712 dex_path = _dex_path 1715 dex_path = _dex_path
1713 } 1716 }
1714 1717
1715 output_apk_path = _packaged_apk_path 1718 output_apk_path = _packaged_apk_path
1716 resource_packaged_apk_path = _resource_packaged_apk_path 1719 resource_packaged_apk_path = _resource_packaged_apk_path
1717 } 1720 }
1718 1721
1719 _incremental_package_target = "${target_name}_incremental__package" 1722 _incremental_package_target = "${target_name}_incremental__package"
1720 package_apk(_incremental_package_target) { 1723 package_apk(_incremental_package_target) {
1721 forward_variables_from(invoker, 1724 forward_variables_from(invoker,
1722 [ 1725 [
1723 "assets_build_config", 1726 "assets_build_config",
1724 "emma_instrument",
1725 "secondary_native_libs", 1727 "secondary_native_libs",
1726 "uncompress_shared_libraries", 1728 "uncompress_shared_libraries",
1727 ]) 1729 ])
1728 _dex_target = "//build/android/incremental_install:bootstrap_java__dex" 1730 _dex_target = "//build/android/incremental_install:bootstrap_java__dex"
1729 deps = _incremental_deps + [ 1731 deps = _incremental_deps + [
1730 ":${_incremental_package_resources_target_name}", 1732 ":${_incremental_package_resources_target_name}",
1731 _dex_target, 1733 _dex_target,
1732 ] 1734 ]
1733 1735
1734 if (defined(_dex_path)) { 1736 if (defined(_dex_path)) {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 defined(invoker.requires_android) && invoker.requires_android 1882 defined(invoker.requires_android) && invoker.requires_android
1881 1883
1882 if (defined(invoker.deps)) { 1884 if (defined(invoker.deps)) {
1883 possible_config_deps = _deps 1885 possible_config_deps = _deps
1884 } 1886 }
1885 build_config = _build_config 1887 build_config = _build_config
1886 jar_path = _jar_path 1888 jar_path = _jar_path
1887 if (_supports_android) { 1889 if (_supports_android) {
1888 dex_path = _dex_path 1890 dex_path = _dex_path
1889 } 1891 }
1892 if (defined(invoker.include_java_resources) &&
1893 invoker.include_java_resources) {
1894 # Use original jar_path because _jar_path points to a library without
1895 # resources.
1896 java_resources_jar = invoker.jar_path
1897 }
1890 } 1898 }
1891 1899
1892 process_java_prebuilt(_process_jar_target_name) { 1900 process_java_prebuilt(_process_jar_target_name) {
1893 forward_variables_from(invoker, 1901 forward_variables_from(invoker,
1894 [ 1902 [
1895 "jar_excluded_patterns", 1903 "jar_excluded_patterns",
1896 "proguard_preprocess", 1904 "proguard_preprocess",
1897 "proguard_preprocess_config", 1905 "proguard_preprocess_config",
1898 "strip_resource_classes", 1906 "strip_resource_classes",
1899 ]) 1907 ])
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
2841 rebase_path(root_build_dir, root_build_dir), 2849 rebase_path(root_build_dir, root_build_dir),
2842 "--packed-libraries-dir", 2850 "--packed-libraries-dir",
2843 rebase_path(_packed_libraries_dir, root_build_dir), 2851 rebase_path(_packed_libraries_dir, root_build_dir),
2844 "--libraries=${invoker.libraries_filearg}", 2852 "--libraries=${invoker.libraries_filearg}",
2845 "--filelistjson", 2853 "--filelistjson",
2846 rebase_path(invoker.file_list_json, root_build_dir), 2854 rebase_path(invoker.file_list_json, root_build_dir),
2847 ] 2855 ]
2848 } 2856 }
2849 } 2857 }
2850 } 2858 }
OLDNEW
« no previous file with comments | « build/android/gyp/write_build_config.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698