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

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

Issue 1473273002: GN(Android): Add libosmesa.so to ContentShell.apk (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « build/config/android/internal_rules.gni ('k') | build/toolchain/android/BUILD.gn » ('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 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
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 # * load_library_from_apk and enable_relocation_packing do not apply
1199 # * not side-loaded for _incremental targets.
pkotwicz 2015/11/25 01:18:34 Can you please: - Explain why someone would want t
agrieve 2015/11/25 21:26:57 Added to the end: # Use this instead of native
1194 # native_libs: List paths of native libraries to include in this apk. If these 1200 # 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 1201 # libraries depend on other shared_library targets, those dependencies will
1196 # also be included in the apk. 1202 # also be included in the apk. When building with is_component_build,
1203 # The extension is automatically changed to ".cr.so".
1197 # native_lib_placeholders: List of placeholder filenames to add to the apk 1204 # native_lib_placeholders: List of placeholder filenames to add to the apk
1198 # (optional). 1205 # (optional).
1199 # apk_under_test: For an instrumentation test apk, this is the target of the 1206 # apk_under_test: For an instrumentation test apk, this is the target of the
1200 # tested apk. 1207 # tested apk.
1201 # include_all_resources - If true include all resource IDs in all generated 1208 # include_all_resources - If true include all resource IDs in all generated
1202 # R.java files. 1209 # R.java files.
1203 # testonly: Marks this target as "test-only". 1210 # testonly: Marks this target as "test-only".
1204 # 1211 #
1205 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in 1212 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in
1206 # this directory will be included in the library. This is only supported to 1213 # this directory will be included in the library. This is only supported to
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 [ _final_apk_path ], 1266 [ _final_apk_path ],
1260 "$root_build_dir/test.lib.java/{{source_name_part}}.jar") 1267 "$root_build_dir/test.lib.java/{{source_name_part}}.jar")
1261 _dist_jar_path = _dist_jar_path_list[0] 1268 _dist_jar_path = _dist_jar_path_list[0]
1262 _final_apk_path_no_ext_list = 1269 _final_apk_path_no_ext_list =
1263 process_file_template([ _final_apk_path ], 1270 process_file_template([ _final_apk_path ],
1264 "{{source_dir}}/{{source_name_part}}") 1271 "{{source_dir}}/{{source_name_part}}")
1265 _final_apk_path_no_ext = _final_apk_path_no_ext_list[0] 1272 _final_apk_path_no_ext = _final_apk_path_no_ext_list[0]
1266 assert(_final_apk_path_no_ext != "") # Mark as used. 1273 assert(_final_apk_path_no_ext != "") # Mark as used.
1267 1274
1268 _native_libs = [] 1275 _native_libs = []
1276 _loadable_modules = []
1277 if (defined(invoker.loadable_modules)) {
1278 _loadable_modules = invoker.loadable_modules
1279 }
1269 1280
1270 _version_code = "1" 1281 _version_code = "1"
1271 if (defined(invoker.version_code)) { 1282 if (defined(invoker.version_code)) {
1272 _version_code = invoker.version_code 1283 _version_code = invoker.version_code
1273 } 1284 }
1274 1285
1275 _version_name = "Developer Build" 1286 _version_name = "Developer Build"
1276 if (defined(invoker.version_name)) { 1287 if (defined(invoker.version_name)) {
1277 _version_name = invoker.version_name 1288 _version_name = invoker.version_name
1278 } 1289 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 1379
1369 _proguard_enabled = 1380 _proguard_enabled =
1370 defined(invoker.proguard_enabled) && invoker.proguard_enabled 1381 defined(invoker.proguard_enabled) && invoker.proguard_enabled
1371 if (_proguard_enabled) { 1382 if (_proguard_enabled) {
1372 _proguard_jar_path = "$base_path.proguard.jar" 1383 _proguard_jar_path = "$base_path.proguard.jar"
1373 } 1384 }
1374 1385
1375 _emma_never_instrument = defined(invoker.testonly) && invoker.testonly 1386 _emma_never_instrument = defined(invoker.testonly) && invoker.testonly
1376 1387
1377 build_config_target = "${_template_name}__build_config" 1388 build_config_target = "${_template_name}__build_config"
1378 write_build_config(build_config_target) { 1389 write_build_config(build_config_target) {
pkotwicz 2015/11/25 01:18:34 In GYP, osmesa is written to NativeLibraries.java
agrieve 2015/11/25 21:26:57 Acknowledged.
1379 forward_variables_from(invoker, [ "apk_under_test" ]) 1390 forward_variables_from(invoker, [ "apk_under_test" ])
1380 type = "android_apk" 1391 type = "android_apk"
1381 jar_path = _jar_path 1392 jar_path = _jar_path
1382 dex_path = final_dex_path 1393 dex_path = final_dex_path
1383 apk_path = _final_apk_path 1394 apk_path = _final_apk_path
1384 resources_zip = resources_zip_path 1395 resources_zip = resources_zip_path
1385 build_config = _build_config 1396 build_config = _build_config
1386 android_manifest = _android_manifest 1397 android_manifest = _android_manifest
1387 1398
1388 deps = _chromium_linker_dep + _android_manifest_deps 1399 deps = _chromium_linker_dep + _android_manifest_deps
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 ] 1613 ]
1603 1614
1604 inputs = _native_libs 1615 inputs = _native_libs
1605 deps = _chromium_linker_dep 1616 deps = _chromium_linker_dep
1606 1617
1607 inputs += [ _build_config ] 1618 inputs += [ _build_config ]
1608 deps += [ ":$build_config_target" ] 1619 deps += [ ":$build_config_target" ]
1609 1620
1610 rebased_gdbserver = rebase_path(android_gdbserver, root_build_dir) 1621 rebased_gdbserver = rebase_path(android_gdbserver, root_build_dir)
1611 skip_packing_list = [ 1622 skip_packing_list = [
1612 rebased_gdbserver, 1623 rebased_gdbserver,
pkotwicz 2015/11/25 01:18:34 Can we add the loadable_modules into the APK the s
agrieve 2015/11/25 21:26:57 Right now incremental install pushes all libs that
pkotwicz 2015/11/25 22:41:25 For the sake of curiosity, why do we want to exclu
agrieve 2015/11/26 03:11:08 okay, learned about gdbserver and it looks like I
1613 "libchromium_android_linker.so", 1624 "libchromium_android_linker.so",
1614 ] 1625 ]
1615 1626
1616 enable_packing_arg = 0 1627 enable_packing_arg = 0
1617 if (_enable_relocation_packing) { 1628 if (_enable_relocation_packing) {
1618 enable_packing_arg = 1 1629 enable_packing_arg = 1
1619 deps += [ relocation_packer_target ] 1630 deps += [ relocation_packer_target ]
1620 } 1631 }
1621 1632
1622 args = [ 1633 args = [
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1685 ":$process_resources_target", 1696 ":$process_resources_target",
1686 ] 1697 ]
1687 1698
1688 # This target generates the input file _all_resources_zip_path. 1699 # This target generates the input file _all_resources_zip_path.
1689 deps += _android_manifest_deps + [ 1700 deps += _android_manifest_deps + [
1690 ":$build_config_target", 1701 ":$build_config_target",
1691 ":$process_resources_target", 1702 ":$process_resources_target",
1692 ":$final_dex_target_name", 1703 ":$final_dex_target_name",
1693 ] 1704 ]
1694 1705
1695 if (_native_libs != [] && !_create_abi_split) { 1706 if ((_native_libs != [] || _loadable_modules != []) && !_create_abi_split) {
1696 native_libs_dir = _native_libs_dir 1707 native_libs_dir = _native_libs_dir
1708 native_libs = _loadable_modules
pkotwicz 2015/11/25 01:18:34 You are right. Having both |native_libs| and |nati
agrieve 2015/11/25 21:26:57 Acknowledged.
1697 1709
1698 # Placeholders necessary for some older devices. 1710 # Placeholders necessary for some older devices.
1699 # http://crbug.com/395038 1711 # http://crbug.com/395038
1700 forward_variables_from(invoker, [ "native_lib_placeholders" ]) 1712 forward_variables_from(invoker, [ "native_lib_placeholders" ])
1701 1713
1702 deps += [ ":$_prepare_native_target_name" ] 1714 deps += [ ":$_prepare_native_target_name" ]
1703 } 1715 }
1704 } 1716 }
1705 1717
1706 if (_native_libs != [] && _create_abi_split) { 1718 if ((_native_libs != [] || _loadable_modules != []) && _create_abi_split) {
1707 _manifest_rule = "${_template_name}__split_manifest_abi_${android_app_abi}" 1719 _manifest_rule = "${_template_name}__split_manifest_abi_${android_app_abi}"
1708 generate_split_manifest(_manifest_rule) { 1720 generate_split_manifest(_manifest_rule) {
1709 main_manifest = _android_manifest 1721 main_manifest = _android_manifest
1710 out_manifest = 1722 out_manifest =
1711 "$gen_dir/split-manifests/${android_app_abi}/AndroidManifest.xml" 1723 "$gen_dir/split-manifests/${android_app_abi}/AndroidManifest.xml"
1712 split_name = "abi_${android_app_abi}" 1724 split_name = "abi_${android_app_abi}"
1713 deps = _android_manifest_deps 1725 deps = _android_manifest_deps
1714 } 1726 }
1715 1727
1716 _apk_rule = "${_template_name}__split_apk_abi_${android_app_abi}" 1728 _apk_rule = "${_template_name}__split_apk_abi_${android_app_abi}"
1717 _final_deps += [ ":$_apk_rule" ] 1729 _final_deps += [ ":$_apk_rule" ]
1718 1730
1719 create_apk(_apk_rule) { 1731 create_apk(_apk_rule) {
1720 apk_path = "${_final_apk_path_no_ext}-abi-${android_app_abi}.apk" 1732 apk_path = "${_final_apk_path_no_ext}-abi-${android_app_abi}.apk"
1721 base_path = "$gen_dir/$_apk_rule" 1733 base_path = "$gen_dir/$_apk_rule"
1722 1734
1723 manifest_outputs = get_target_outputs(":${_manifest_rule}") 1735 manifest_outputs = get_target_outputs(":${_manifest_rule}")
1724 android_manifest = manifest_outputs[1] 1736 android_manifest = manifest_outputs[1]
1725 load_library_from_apk = _load_library_from_apk 1737 load_library_from_apk = _load_library_from_apk
1726 1738
1727 version_code = _version_code 1739 version_code = _version_code
1728 version_name = _version_name 1740 version_name = _version_name
1729 1741
1730 keystore_name = _keystore_name 1742 keystore_name = _keystore_name
1731 keystore_path = _keystore_path 1743 keystore_path = _keystore_path
1732 keystore_password = _keystore_password 1744 keystore_password = _keystore_password
1733 1745
1734 native_libs_dir = _native_libs_dir 1746 native_libs_dir = _native_libs_dir
1747 native_libs = _loadable_modules
1735 1748
1736 # Placeholders necessary for some older devices. 1749 # Placeholders necessary for some older devices.
1737 # http://crbug.com/395038 1750 # http://crbug.com/395038
1738 forward_variables_from(invoker, [ "native_lib_placeholders" ]) 1751 forward_variables_from(invoker, [ "native_lib_placeholders" ])
1739 1752
1740 deps = [ 1753 deps = [
1741 ":${_manifest_rule}", 1754 ":${_manifest_rule}",
1742 ":${_prepare_native_target_name}", 1755 ":${_prepare_native_target_name}",
1743 ] 1756 ]
1744 incremental_deps = deps 1757 incremental_deps = deps
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
2200 } 2213 }
2201 2214
2202 android_library(target_name) { 2215 android_library(target_name) {
2203 java_files = [] 2216 java_files = []
2204 srcjar_deps = [ ":${_template_name}__protoc_java" ] 2217 srcjar_deps = [ ":${_template_name}__protoc_java" ]
2205 deps = [ 2218 deps = [
2206 "//third_party/android_protobuf:protobuf_nano_javalib", 2219 "//third_party/android_protobuf:protobuf_nano_javalib",
2207 ] 2220 ]
2208 } 2221 }
2209 } 2222 }
OLDNEW
« no previous file with comments | « build/config/android/internal_rules.gni ('k') | build/toolchain/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698