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("//tools/grit/grit_rule.gni") | 8 import("//tools/grit/grit_rule.gni") |
9 import("//tools/relocation_packer/config.gni") | 9 import("//tools/relocation_packer/config.gni") |
10 | 10 |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 # android_manifest: AndroidManifest.xml for this target. Defaults to | 523 # android_manifest: AndroidManifest.xml for this target. Defaults to |
524 # //build/android/AndroidManifest.xml. | 524 # //build/android/AndroidManifest.xml. |
525 # custom_package: java package for generated .java files. | 525 # custom_package: java package for generated .java files. |
526 # v14_verify_only: If true, don't generate v14/v17 resources and just verify | 526 # v14_verify_only: If true, don't generate v14/v17 resources and just verify |
527 # that the resources are v14-compliant (see | 527 # that the resources are v14-compliant (see |
528 # build/android/gyp/generate_v14_compatible_resources.py). Defaults to | 528 # build/android/gyp/generate_v14_compatible_resources.py). Defaults to |
529 # false. | 529 # false. |
530 # shared_resources: If true make a resource package that can be loaded by a | 530 # shared_resources: If true make a resource package that can be loaded by a |
531 # different application at runtime to access the package's resources. | 531 # different application at runtime to access the package's resources. |
532 # | 532 # |
| 533 |
533 # Example | 534 # Example |
534 # android_resources("foo_resources") { | 535 # android_resources("foo_resources") { |
535 # deps = [":foo_strings_grd"] | 536 # deps = [":foo_strings_grd"] |
536 # resource_dirs = ["res"] | 537 # resource_dirs = ["res"] |
537 # custom_package = "org.chromium.foo" | 538 # custom_package = "org.chromium.foo" |
538 # } | 539 # } |
539 template("android_resources") { | 540 template("android_resources") { |
540 set_sources_assignment_filter([]) | 541 set_sources_assignment_filter([]) |
541 if (defined(invoker.testonly)) { | 542 if (defined(invoker.testonly)) { |
542 testonly = invoker.testonly | 543 testonly = invoker.testonly |
543 } | 544 } |
544 | 545 |
545 assert(defined(invoker.resource_dirs)) | 546 assert(defined(invoker.resource_dirs)) |
546 assert(defined(invoker.android_manifest) || defined(invoker.custom_package)) | 547 assert(defined(invoker.android_manifest) || defined(invoker.custom_package)) |
547 | 548 |
548 base_path = "$target_gen_dir/$target_name" | 549 base_path = "$target_gen_dir/$target_name" |
549 zip_path = base_path + ".resources.zip" | 550 zip_path = base_path + ".resources.zip" |
550 srcjar_path = base_path + ".srcjar" | 551 srcjar_path = base_path + ".srcjar" |
| 552 r_text_path = base_path + "_R.txt" |
551 build_config = base_path + ".build_config" | 553 build_config = base_path + ".build_config" |
552 | 554 |
553 write_build_config("${target_name}__build_config") { | 555 write_build_config("${target_name}__build_config") { |
554 type = "android_resources" | 556 type = "android_resources" |
555 resources_zip = zip_path | 557 resources_zip = zip_path |
556 srcjar = srcjar_path | 558 srcjar = srcjar_path |
| 559 r_text = r_text_path |
557 if (defined(invoker.deps)) { | 560 if (defined(invoker.deps)) { |
558 deps = invoker.deps | 561 deps = invoker.deps |
559 } | 562 } |
560 if (defined(invoker.android_manifest)) { | 563 if (defined(invoker.android_manifest)) { |
561 android_manifest = invoker.android_manifest | 564 android_manifest = invoker.android_manifest |
562 } | 565 } |
563 if (defined(invoker.custom_package)) { | 566 if (defined(invoker.custom_package)) { |
564 custom_package = invoker.custom_package | 567 custom_package = invoker.custom_package |
565 } | 568 } |
566 } | 569 } |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars | 1159 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars |
1157 # will be added to java_files and be included in this apk. | 1160 # will be added to java_files and be included in this apk. |
1158 # apk_name: Name for final apk. | 1161 # apk_name: Name for final apk. |
1159 # final_apk_path: Path to final built apk. Default is | 1162 # final_apk_path: Path to final built apk. Default is |
1160 # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name. | 1163 # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name. |
1161 # native_libs: List paths of native libraries to include in this apk. If these | 1164 # native_libs: List paths of native libraries to include in this apk. If these |
1162 # libraries depend on other shared_library targets, those dependencies will | 1165 # libraries depend on other shared_library targets, those dependencies will |
1163 # also be included in the apk. | 1166 # also be included in the apk. |
1164 # apk_under_test: For an instrumentation test apk, this is the target of the | 1167 # apk_under_test: For an instrumentation test apk, this is the target of the |
1165 # tested apk. | 1168 # tested apk. |
| 1169 # include_all_resources - If true include all resource IDs in all generated |
| 1170 # R.java files. |
1166 # testonly: Marks this target as "test-only". | 1171 # testonly: Marks this target as "test-only". |
1167 # | 1172 # |
1168 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in | 1173 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in |
1169 # this directory will be included in the library. This is only supported to | 1174 # this directory will be included in the library. This is only supported to |
1170 # ease the gyp->gn conversion and will be removed in the future. | 1175 # ease the gyp->gn conversion and will be removed in the future. |
1171 # | 1176 # |
1172 # Example | 1177 # Example |
1173 # android_apk("foo_apk") { | 1178 # android_apk("foo_apk") { |
1174 # android_manifest = "AndroidManifest.xml" | 1179 # android_manifest = "AndroidManifest.xml" |
1175 # java_files = [ | 1180 # java_files = [ |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 } | 1304 } |
1300 | 1305 |
1301 native_libs = _native_libs | 1306 native_libs = _native_libs |
1302 } | 1307 } |
1303 | 1308 |
1304 final_deps = [] | 1309 final_deps = [] |
1305 | 1310 |
1306 final_deps += [ ":${_template_name}__process_resources" ] | 1311 final_deps += [ ":${_template_name}__process_resources" ] |
1307 process_resources("${_template_name}__process_resources") { | 1312 process_resources("${_template_name}__process_resources") { |
1308 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" | 1313 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
| 1314 r_text_path = "${target_gen_dir}/${target_name}_R.txt" |
1309 android_manifest = _android_manifest | 1315 android_manifest = _android_manifest |
1310 resource_dirs = [ "//build/android/ant/empty/res" ] | 1316 resource_dirs = [ "//build/android/ant/empty/res" ] |
1311 zip_path = resources_zip_path | 1317 zip_path = resources_zip_path |
1312 generate_constant_ids = true | 1318 generate_constant_ids = true |
1313 build_config = _build_config | 1319 build_config = _build_config |
| 1320 |
| 1321 if (defined(invoker.include_all_resources)) { |
| 1322 include_all_resources = invoker.include_all_resources |
| 1323 } |
1314 } | 1324 } |
1315 _srcjar_deps += [ ":${_template_name}__process_resources" ] | 1325 _srcjar_deps += [ ":${_template_name}__process_resources" ] |
1316 | 1326 |
1317 if (_native_libs != []) { | 1327 if (_native_libs != []) { |
1318 _enable_chromium_linker_tests = false | 1328 _enable_chromium_linker_tests = false |
1319 if (defined(invoker.enable_chromium_linker_tests)) { | 1329 if (defined(invoker.enable_chromium_linker_tests)) { |
1320 _enable_chromium_linker_tests = invoker.enable_chromium_linker_tests | 1330 _enable_chromium_linker_tests = invoker.enable_chromium_linker_tests |
1321 } | 1331 } |
1322 | 1332 |
1323 java_cpp_template("${_template_name}__native_libraries_java") { | 1333 java_cpp_template("${_template_name}__native_libraries_java") { |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 template("uiautomator_test") { | 1813 template("uiautomator_test") { |
1804 set_sources_assignment_filter([]) | 1814 set_sources_assignment_filter([]) |
1805 if (defined(invoker.testonly)) { | 1815 if (defined(invoker.testonly)) { |
1806 testonly = invoker.testonly | 1816 testonly = invoker.testonly |
1807 } | 1817 } |
1808 assert(target_name != "") | 1818 assert(target_name != "") |
1809 assert(invoker.deps != [] || true) | 1819 assert(invoker.deps != [] || true) |
1810 group(target_name) { | 1820 group(target_name) { |
1811 } | 1821 } |
1812 } | 1822 } |
OLD | NEW |