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 | 6 |
7 assert(is_android) | 7 assert(is_android) |
8 | 8 |
9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) | 9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) |
10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) | 10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 rebase_path(jar_path, root_build_dir), | 113 rebase_path(jar_path, root_build_dir), |
114 ] | 114 ] |
115 | 115 |
116 if (findbugs_verbose) { | 116 if (findbugs_verbose) { |
117 args += [ "-vv" ] | 117 args += [ "-vv" ] |
118 } | 118 } |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 # Generates a script in the output bin.java directory to run a java binary. | 122 # Generates a script in the output bin.java directory to run a java binary. |
| 123 # |
| 124 # Variables |
| 125 # main_class: The class containing the progam entry point. |
| 126 # jar_path: The path to the jar to run. |
| 127 # script_name: Name of the script to generate. |
| 128 # build_config: Path to .build_config for the jar (contains classpath). |
| 129 # wrapper_script_args: List of extra arguments to pass to the executable. |
| 130 # |
123 template("java_binary_script") { | 131 template("java_binary_script") { |
124 set_sources_assignment_filter([]) | 132 set_sources_assignment_filter([]) |
125 forward_variables_from(invoker, [ "testonly" ]) | 133 forward_variables_from(invoker, [ "testonly" ]) |
126 | 134 |
127 _main_class = invoker.main_class | 135 _main_class = invoker.main_class |
128 _build_config = invoker.build_config | 136 _build_config = invoker.build_config |
129 _jar_path = invoker.jar_path | 137 _jar_path = invoker.jar_path |
130 _script_name = invoker.script_name | 138 _script_name = invoker.script_name |
131 | 139 |
132 action(target_name) { | 140 action(target_name) { |
(...skipping 13 matching lines...) Expand all Loading... |
146 "--depfile", | 154 "--depfile", |
147 rebase_path(depfile, root_build_dir), | 155 rebase_path(depfile, root_build_dir), |
148 "--output", | 156 "--output", |
149 rebase_path(java_script, root_build_dir), | 157 rebase_path(java_script, root_build_dir), |
150 "--classpath=@FileArg($_rebased_build_config:java:full_classpath)", | 158 "--classpath=@FileArg($_rebased_build_config:java:full_classpath)", |
151 "--jar-path", | 159 "--jar-path", |
152 rebase_path(_jar_path, root_build_dir), | 160 rebase_path(_jar_path, root_build_dir), |
153 "--main-class", | 161 "--main-class", |
154 _main_class, | 162 _main_class, |
155 ] | 163 ] |
| 164 if (defined(invoker.wrapper_script_args)) { |
| 165 args += [ "--" ] + invoker.wrapper_script_args |
| 166 } |
156 } | 167 } |
157 } | 168 } |
158 | 169 |
159 template("dex") { | 170 template("dex") { |
160 set_sources_assignment_filter([]) | 171 set_sources_assignment_filter([]) |
161 | 172 |
162 assert(defined(invoker.output)) | 173 assert(defined(invoker.output)) |
163 action(target_name) { | 174 action(target_name) { |
164 forward_variables_from(invoker, | 175 forward_variables_from(invoker, |
165 [ | 176 [ |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 chromium_code = _chromium_code | 1292 chromium_code = _chromium_code |
1282 android = _requires_android | 1293 android = _requires_android |
1283 | 1294 |
1284 supports_android = _supports_android | 1295 supports_android = _supports_android |
1285 deps = build_config_deps | 1296 deps = build_config_deps |
1286 } | 1297 } |
1287 | 1298 |
1288 if (defined(invoker.main_class)) { | 1299 if (defined(invoker.main_class)) { |
1289 _final_datadeps += [ ":${_template_name}__java_binary_script" ] | 1300 _final_datadeps += [ ":${_template_name}__java_binary_script" ] |
1290 java_binary_script("${_template_name}__java_binary_script") { | 1301 java_binary_script("${_template_name}__java_binary_script") { |
| 1302 forward_variables_from(invoker, |
| 1303 [ |
| 1304 "main_class", |
| 1305 "wrapper_script_args", |
| 1306 ]) |
1291 build_config = _build_config | 1307 build_config = _build_config |
1292 jar_path = _jar_path | 1308 jar_path = _jar_path |
1293 main_class = invoker.main_class | |
1294 script_name = _template_name | 1309 script_name = _template_name |
1295 deps = build_config_deps | 1310 deps = build_config_deps |
1296 } | 1311 } |
1297 } | 1312 } |
1298 | 1313 |
1299 if (_supports_android) { | 1314 if (_supports_android) { |
1300 if (defined(invoker.chromium_code) && invoker.chromium_code) { | 1315 if (defined(invoker.chromium_code) && invoker.chromium_code) { |
1301 _android_manifest = "//build/android/AndroidManifest.xml" | 1316 _android_manifest = "//build/android/AndroidManifest.xml" |
1302 if (defined(invoker.android_manifest)) { | 1317 if (defined(invoker.android_manifest)) { |
1303 _android_manifest = invoker.android_manifest | 1318 _android_manifest = invoker.android_manifest |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 ] | 1644 ] |
1630 args = [ | 1645 args = [ |
1631 "--depfile", | 1646 "--depfile", |
1632 rebase_path(depfile, root_build_dir), | 1647 rebase_path(depfile, root_build_dir), |
1633 "--script-output-path", | 1648 "--script-output-path", |
1634 rebase_path(generated_script, root_build_dir), | 1649 rebase_path(generated_script, root_build_dir), |
1635 ] | 1650 ] |
1636 args += test_runner_args | 1651 args += test_runner_args |
1637 } | 1652 } |
1638 } | 1653 } |
OLD | NEW |