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("//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 Loading... |
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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 script_name = _template_name |
| 1298 if (defined(invoker.wrapper_script_name)) { |
| 1299 script_name = invoker.wrapper_script_name |
| 1300 } |
1298 deps = [ | 1301 deps = [ |
1299 ":$_build_config_target_name", | 1302 ":$_build_config_target_name", |
1300 ] | 1303 ] |
1301 } | 1304 } |
1302 } | 1305 } |
1303 | 1306 |
1304 group(target_name) { | 1307 group(target_name) { |
1305 forward_variables_from(invoker, [ "data_deps" ]) | 1308 forward_variables_from(invoker, [ "data_deps" ]) |
1306 deps = [ | 1309 deps = [ |
1307 ":$_ijar_target_name", | 1310 ":$_ijar_target_name", |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1525 set_sources_assignment_filter([]) | 1528 set_sources_assignment_filter([]) |
1526 forward_variables_from(invoker, [ "testonly" ]) | 1529 forward_variables_from(invoker, [ "testonly" ]) |
1527 | 1530 |
1528 assert( | 1531 assert( |
1529 defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) || | 1532 defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) || |
1530 defined(invoker.srcjars) || defined(invoker.srcjar_deps)) | 1533 defined(invoker.srcjars) || defined(invoker.srcjar_deps)) |
1531 _base_path = "$target_gen_dir/$target_name" | 1534 _base_path = "$target_gen_dir/$target_name" |
1532 | 1535 |
1533 # Jar files can be needed at runtime (by Robolectric tests or java binaries), | 1536 # Jar files can be needed at runtime (by Robolectric tests or java binaries), |
1534 # so do not put them under gen/. | 1537 # so do not put them under gen/. |
| 1538 _jar_name = target_name |
| 1539 if (defined(invoker.jar_name)) { |
| 1540 _jar_name = invoker.jar_name |
| 1541 } |
1535 target_dir_name = get_label_info(":$target_name", "dir") | 1542 target_dir_name = get_label_info(":$target_name", "dir") |
1536 _jar_path = "$root_out_dir/lib.java$target_dir_name/$target_name.jar" | 1543 _jar_path = "$root_out_dir/lib.java$target_dir_name/$_jar_name.jar" |
1537 if (defined(invoker.jar_path)) { | 1544 if (defined(invoker.jar_path)) { |
1538 _jar_path = invoker.jar_path | 1545 _jar_path = invoker.jar_path |
1539 } | 1546 } |
1540 _template_name = target_name | 1547 _template_name = target_name |
1541 | 1548 |
1542 _final_deps = [] | 1549 _final_deps = [] |
1543 _final_datadeps = [] | 1550 _final_datadeps = [] |
1544 if (defined(invoker.datadeps)) { | 1551 if (defined(invoker.datadeps)) { |
1545 _final_datadeps = invoker.datadeps | 1552 _final_datadeps = invoker.datadeps |
1546 } | 1553 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 java_binary_script("${_template_name}__java_binary_script") { | 1688 java_binary_script("${_template_name}__java_binary_script") { |
1682 forward_variables_from(invoker, | 1689 forward_variables_from(invoker, |
1683 [ | 1690 [ |
1684 "bootclasspath", | 1691 "bootclasspath", |
1685 "main_class", | 1692 "main_class", |
1686 "wrapper_script_args", | 1693 "wrapper_script_args", |
1687 ]) | 1694 ]) |
1688 build_config = _build_config | 1695 build_config = _build_config |
1689 jar_path = _jar_path | 1696 jar_path = _jar_path |
1690 script_name = _template_name | 1697 script_name = _template_name |
| 1698 if (defined(invoker.wrapper_script_name)) { |
| 1699 script_name = invoker.wrapper_script_name |
| 1700 } |
1691 deps = build_config_deps | 1701 deps = build_config_deps |
1692 } | 1702 } |
1693 } | 1703 } |
1694 | 1704 |
1695 if (_supports_android) { | 1705 if (_supports_android) { |
1696 if (defined(invoker.chromium_code) && invoker.chromium_code) { | 1706 if (defined(invoker.chromium_code) && invoker.chromium_code) { |
1697 _final_datadeps += [ ":${_template_name}__lint" ] | 1707 _final_datadeps += [ ":${_template_name}__lint" ] |
1698 android_lint("${_template_name}__lint") { | 1708 android_lint("${_template_name}__lint") { |
1699 android_manifest = _android_manifest | 1709 android_manifest = _android_manifest |
1700 jar_path = _jar_path | 1710 jar_path = _jar_path |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2062 "@FileArg($_rebased_build_config:deps_info:tested_apk_path)", | 2072 "@FileArg($_rebased_build_config:deps_info:tested_apk_path)", |
2063 ] | 2073 ] |
2064 if (emma_coverage) { | 2074 if (emma_coverage) { |
2065 # Set a default coverage output directory (can be overridden by user | 2075 # Set a default coverage output directory (can be overridden by user |
2066 # passing the same flag). | 2076 # passing the same flag). |
2067 test_runner_args += [ | 2077 test_runner_args += [ |
2068 "--coverage-dir", | 2078 "--coverage-dir", |
2069 rebase_path("$root_out_dir/coverage", root_build_dir), | 2079 rebase_path("$root_out_dir/coverage", root_build_dir), |
2070 ] | 2080 ] |
2071 } | 2081 } |
| 2082 } else if (_test_type == "junit") { |
| 2083 assert(defined(invoker.test_suite)) |
| 2084 test_runner_args += [ |
| 2085 "--test-suite", |
| 2086 invoker.test_suite, |
| 2087 ] |
2072 } else { | 2088 } else { |
2073 assert(false, "Invalid test type: $_test_type.") | 2089 assert(false, "Invalid test type: $_test_type.") |
2074 } | 2090 } |
2075 | 2091 |
2076 if (defined(invoker.additional_apks)) { | 2092 if (defined(invoker.additional_apks)) { |
2077 foreach(additional_apk, invoker.additional_apks) { | 2093 foreach(additional_apk, invoker.additional_apks) { |
2078 deps += [ "${additional_apk}__build_config" ] | 2094 deps += [ "${additional_apk}__build_config" ] |
2079 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" + | 2095 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" + |
2080 get_label_info(additional_apk, "name") + ".build_config" | 2096 get_label_info(additional_apk, "name") + ".build_config" |
2081 _rebased_build_config = rebase_path(_build_config, root_build_dir) | 2097 _rebased_build_config = rebase_path(_build_config, root_build_dir) |
(...skipping 26 matching lines...) Expand all Loading... |
2108 ] | 2124 ] |
2109 args = [ | 2125 args = [ |
2110 "--depfile", | 2126 "--depfile", |
2111 rebase_path(depfile, root_build_dir), | 2127 rebase_path(depfile, root_build_dir), |
2112 "--script-output-path", | 2128 "--script-output-path", |
2113 rebase_path(generated_script, root_build_dir), | 2129 rebase_path(generated_script, root_build_dir), |
2114 ] | 2130 ] |
2115 args += test_runner_args | 2131 args += test_runner_args |
2116 } | 2132 } |
2117 } | 2133 } |
OLD | NEW |