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 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 if (defined(invoker.srcjar_deps)) { | 1219 if (defined(invoker.srcjar_deps)) { |
1220 _srcjar_deps = invoker.srcjar_deps | 1220 _srcjar_deps = invoker.srcjar_deps |
1221 } | 1221 } |
1222 | 1222 |
1223 _srcjars = [] | 1223 _srcjars = [] |
1224 if (defined(invoker.srcjars)) { | 1224 if (defined(invoker.srcjars)) { |
1225 _srcjars = invoker.srcjars | 1225 _srcjars = invoker.srcjars |
1226 } | 1226 } |
1227 | 1227 |
1228 _java_files = [] | 1228 _java_files = [] |
1229 if (defined(invoker.java_files)) { | 1229 if (defined(invoker.DEPRECATED_java_in_dir)) { |
1230 _java_files = invoker.java_files | |
1231 } else if (defined(invoker.DEPRECATED_java_in_dir)) { | |
1232 _src_dir = invoker.DEPRECATED_java_in_dir + "/src" | 1230 _src_dir = invoker.DEPRECATED_java_in_dir + "/src" |
1233 _src_dir_exists = exec_script("//build/dir_exists.py", | 1231 _src_dir_exists = exec_script("//build/dir_exists.py", |
1234 [ rebase_path(_src_dir, root_build_dir) ], | 1232 [ rebase_path(_src_dir, root_build_dir) ], |
1235 "string") | 1233 "string") |
1236 assert(_src_dir_exists == "False", | 1234 assert(_src_dir_exists == "False", |
1237 "In GN, java_in_dir should be the fully specified java directory " + | 1235 "In GN, java_in_dir should be the fully specified java directory " + |
1238 "(i.e. including the trailing \"/src\")") | 1236 "(i.e. including the trailing \"/src\")") |
1239 | 1237 |
1240 _java_files_build_rel = exec_script( | 1238 _java_files_build_rel = |
1241 "//build/android/gyp/find.py", | 1239 exec_script("//build/android/gyp/find.py", |
1242 [ | 1240 [ |
1243 "--pattern", | 1241 "--pattern", |
1244 "*.java", | 1242 "*.java", |
1245 rebase_path(invoker.DEPRECATED_java_in_dir, root_build_dir), | 1243 rebase_path(invoker.DEPRECATED_java_in_dir, |
1246 ], | 1244 root_build_dir), |
1247 "list lines") | 1245 ], |
| 1246 "list lines") |
1248 _java_files = rebase_path(_java_files_build_rel, ".", root_build_dir) | 1247 _java_files = rebase_path(_java_files_build_rel, ".", root_build_dir) |
1249 } | 1248 } |
| 1249 if (defined(invoker.java_files)) { |
| 1250 _java_files += invoker.java_files |
| 1251 } |
1250 assert(_java_files != [] || _srcjar_deps != [] || _srcjars != []) | 1252 assert(_java_files != [] || _srcjar_deps != [] || _srcjars != []) |
1251 | 1253 |
1252 _compile_java_target = "${_template_name}__compile_java" | 1254 _compile_java_target = "${_template_name}__compile_java" |
1253 _final_deps += [ ":$_compile_java_target" ] | 1255 _final_deps += [ ":$_compile_java_target" ] |
1254 compile_java(_compile_java_target) { | 1256 compile_java(_compile_java_target) { |
1255 forward_variables_from(invoker, | 1257 forward_variables_from(invoker, |
1256 [ | 1258 [ |
1257 "dist_jar_path", | 1259 "dist_jar_path", |
1258 "enable_errorprone", | 1260 "enable_errorprone", |
1259 "jar_excluded_patterns", | 1261 "jar_excluded_patterns", |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1617 ] | 1619 ] |
1618 args = [ | 1620 args = [ |
1619 "--depfile", | 1621 "--depfile", |
1620 rebase_path(depfile, root_build_dir), | 1622 rebase_path(depfile, root_build_dir), |
1621 "--script-output-path", | 1623 "--script-output-path", |
1622 rebase_path(generated_script, root_build_dir), | 1624 rebase_path(generated_script, root_build_dir), |
1623 ] | 1625 ] |
1624 args += test_runner_args | 1626 args += test_runner_args |
1625 } | 1627 } |
1626 } | 1628 } |
OLD | NEW |