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

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

Issue 1674353004: [Android] Fix generated scripts for junit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/sanitizers/sanitizers.gni") 6 import("//build/config/sanitizers/sanitizers.gni")
7 import("//build/config/zip.gni") 7 import("//build/config/zip.gni")
8 import("//third_party/ijar/ijar.gni") 8 import("//third_party/ijar/ijar.gni")
9 9
10 assert(is_android) 10 assert(is_android)
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 forward_variables_from(invoker, [ "testonly" ]) 191 forward_variables_from(invoker, [ "testonly" ])
192 192
193 _main_class = invoker.main_class 193 _main_class = invoker.main_class
194 _build_config = invoker.build_config 194 _build_config = invoker.build_config
195 _jar_path = invoker.jar_path 195 _jar_path = invoker.jar_path
196 _script_name = invoker.script_name 196 _script_name = invoker.script_name
197 197
198 action(target_name) { 198 action(target_name) {
199 script = "//build/android/gyp/create_java_binary_script.py" 199 script = "//build/android/gyp/create_java_binary_script.py"
200 depfile = "$target_gen_dir/$_script_name.d" 200 depfile = "$target_gen_dir/$_script_name.d"
201 java_script = "$root_build_dir/bin/$_script_name" 201 java_script = "$root_build_dir/bin/helper/$_script_name"
202 inputs = [ 202 inputs = [
203 _build_config, 203 _build_config,
204 ] 204 ]
205 outputs = [ 205 outputs = [
206 depfile, 206 depfile,
207 java_script, 207 java_script,
208 ] 208 ]
209 forward_variables_from(invoker, [ "deps" ]) 209 forward_variables_from(invoker, [ "deps" ])
210 _rebased_build_config = rebase_path(_build_config, root_build_dir) 210 _rebased_build_config = rebase_path(_build_config, root_build_dir)
211 args = [ 211 args = [
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 _binary_script_target_name = "${_template_name}__java_binary_script" 1287 _binary_script_target_name = "${_template_name}__java_binary_script"
1288 java_binary_script(_binary_script_target_name) { 1288 java_binary_script(_binary_script_target_name) {
1289 forward_variables_from(invoker, 1289 forward_variables_from(invoker,
1290 [ 1290 [
1291 "bootclasspath", 1291 "bootclasspath",
1292 "main_class", 1292 "main_class",
1293 "wrapper_script_args", 1293 "wrapper_script_args",
1294 ]) 1294 ])
1295 build_config = _build_config 1295 build_config = _build_config
1296 jar_path = _jar_path 1296 jar_path = _jar_path
1297 script_name = _template_name 1297 if (defined(invoker.wrapper_script_name)) {
jbudorick 2016/02/09 00:06:47 Why are these overrides suddenly necessary?
mikecase (-- gone --) 2016/02/09 00:54:34 Unfortunately, because of.. https://code.google.co
1298 script_name = invoker.wrapper_script_name
1299 } else {
1300 script_name = _template_name
1301 }
1298 deps = [ 1302 deps = [
1299 ":$_build_config_target_name", 1303 ":$_build_config_target_name",
1300 ] 1304 ]
1301 } 1305 }
1302 } 1306 }
1303 1307
1304 group(target_name) { 1308 group(target_name) {
1305 forward_variables_from(invoker, [ "data_deps" ]) 1309 forward_variables_from(invoker, [ "data_deps" ])
1306 deps = [ 1310 deps = [
1307 ":$_ijar_target_name", 1311 ":$_ijar_target_name",
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 set_sources_assignment_filter([]) 1529 set_sources_assignment_filter([])
1526 forward_variables_from(invoker, [ "testonly" ]) 1530 forward_variables_from(invoker, [ "testonly" ])
1527 1531
1528 assert( 1532 assert(
1529 defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) || 1533 defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) ||
1530 defined(invoker.srcjars) || defined(invoker.srcjar_deps)) 1534 defined(invoker.srcjars) || defined(invoker.srcjar_deps))
1531 _base_path = "$target_gen_dir/$target_name" 1535 _base_path = "$target_gen_dir/$target_name"
1532 1536
1533 # Jar files can be needed at runtime (by Robolectric tests or java binaries), 1537 # Jar files can be needed at runtime (by Robolectric tests or java binaries),
1534 # so do not put them under gen/. 1538 # so do not put them under gen/.
1539 if (defined(invoker.jar_name)) {
1540 _jar_name = invoker.jar_name
1541 } else {
1542 _jar_name = target_name
1543 }
mikecase (-- gone --) 2016/02/09 00:54:34 This is necessary unfortunately because the test_r
1535 target_dir_name = get_label_info(":$target_name", "dir") 1544 target_dir_name = get_label_info(":$target_name", "dir")
1536 _jar_path = "$root_out_dir/lib.java$target_dir_name/$target_name.jar" 1545 _jar_path = "$root_out_dir/lib.java$target_dir_name/$_jar_name.jar"
1537 if (defined(invoker.jar_path)) { 1546 if (defined(invoker.jar_path)) {
1538 _jar_path = invoker.jar_path 1547 _jar_path = invoker.jar_path
1539 } 1548 }
1540 _template_name = target_name 1549 _template_name = target_name
1541 1550
1542 _final_deps = [] 1551 _final_deps = []
1543 _final_datadeps = [] 1552 _final_datadeps = []
1544 if (defined(invoker.datadeps)) { 1553 if (defined(invoker.datadeps)) {
1545 _final_datadeps = invoker.datadeps 1554 _final_datadeps = invoker.datadeps
1546 } 1555 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 _final_datadeps += [ ":${_template_name}__java_binary_script" ] 1689 _final_datadeps += [ ":${_template_name}__java_binary_script" ]
1681 java_binary_script("${_template_name}__java_binary_script") { 1690 java_binary_script("${_template_name}__java_binary_script") {
1682 forward_variables_from(invoker, 1691 forward_variables_from(invoker,
1683 [ 1692 [
1684 "bootclasspath", 1693 "bootclasspath",
1685 "main_class", 1694 "main_class",
1686 "wrapper_script_args", 1695 "wrapper_script_args",
1687 ]) 1696 ])
1688 build_config = _build_config 1697 build_config = _build_config
1689 jar_path = _jar_path 1698 jar_path = _jar_path
1690 script_name = _template_name 1699 if (defined(invoker.wrapper_script_name)) {
1700 script_name = invoker.wrapper_script_name
1701 } else {
1702 script_name = _template_name
1703 }
1691 deps = build_config_deps 1704 deps = build_config_deps
1692 } 1705 }
1693 } 1706 }
1694 1707
1695 if (_supports_android) { 1708 if (_supports_android) {
1696 if (defined(invoker.chromium_code) && invoker.chromium_code) { 1709 if (defined(invoker.chromium_code) && invoker.chromium_code) {
1697 _final_datadeps += [ ":${_template_name}__lint" ] 1710 _final_datadeps += [ ":${_template_name}__lint" ]
1698 android_lint("${_template_name}__lint") { 1711 android_lint("${_template_name}__lint") {
1699 android_manifest = _android_manifest 1712 android_manifest = _android_manifest
1700 jar_path = _jar_path 1713 jar_path = _jar_path
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 "@FileArg($_rebased_build_config:deps_info:tested_apk_path)", 2075 "@FileArg($_rebased_build_config:deps_info:tested_apk_path)",
2063 ] 2076 ]
2064 if (emma_coverage) { 2077 if (emma_coverage) {
2065 # Set a default coverage output directory (can be overridden by user 2078 # Set a default coverage output directory (can be overridden by user
2066 # passing the same flag). 2079 # passing the same flag).
2067 test_runner_args += [ 2080 test_runner_args += [
2068 "--coverage-dir", 2081 "--coverage-dir",
2069 rebase_path("$root_out_dir/coverage", root_build_dir), 2082 rebase_path("$root_out_dir/coverage", root_build_dir),
2070 ] 2083 ]
2071 } 2084 }
2085 } else if (_test_type == "junit") {
2086 assert(defined(invoker.test_suite))
2087 test_runner_args += [
2088 "--test-suite",
2089 invoker.test_suite,
2090 ]
2072 } else { 2091 } else {
2073 assert(false, "Invalid test type: $_test_type.") 2092 assert(false, "Invalid test type: $_test_type.")
2074 } 2093 }
2075 2094
2076 if (defined(invoker.additional_apks)) { 2095 if (defined(invoker.additional_apks)) {
2077 foreach(additional_apk, invoker.additional_apks) { 2096 foreach(additional_apk, invoker.additional_apks) {
2078 deps += [ "${additional_apk}__build_config" ] 2097 deps += [ "${additional_apk}__build_config" ]
2079 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" + 2098 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" +
2080 get_label_info(additional_apk, "name") + ".build_config" 2099 get_label_info(additional_apk, "name") + ".build_config"
2081 _rebased_build_config = rebase_path(_build_config, root_build_dir) 2100 _rebased_build_config = rebase_path(_build_config, root_build_dir)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 ] 2132 ]
2114 args = [ 2133 args = [
2115 "--depfile", 2134 "--depfile",
2116 rebase_path(depfile, root_build_dir), 2135 rebase_path(depfile, root_build_dir),
2117 "--script-output-path", 2136 "--script-output-path",
2118 rebase_path(generated_script, root_build_dir), 2137 rebase_path(generated_script, root_build_dir),
2119 ] 2138 ]
2120 args += test_runner_args 2139 args += test_runner_args
2121 } 2140 }
2122 } 2141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698