| 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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 } | 887 } |
| 888 | 888 |
| 889 template("java_prebuilt_impl") { | 889 template("java_prebuilt_impl") { |
| 890 set_sources_assignment_filter([]) | 890 set_sources_assignment_filter([]) |
| 891 forward_variables_from(invoker, [ "testonly" ]) | 891 forward_variables_from(invoker, [ "testonly" ]) |
| 892 _supports_android = | 892 _supports_android = |
| 893 defined(invoker.supports_android) && invoker.supports_android | 893 defined(invoker.supports_android) && invoker.supports_android |
| 894 | 894 |
| 895 assert(defined(invoker.jar_path)) | 895 assert(defined(invoker.jar_path)) |
| 896 _base_path = "${target_gen_dir}/$target_name" | 896 _base_path = "${target_gen_dir}/$target_name" |
| 897 _jar_path = _base_path + ".jar" | 897 |
| 898 # Jar files can be needed at runtime (by Robolectric tests or java binaries), |
| 899 # so do not put them under gen/. |
| 900 target_dir_name = get_label_info(":$target_name", "dir") |
| 901 _jar_path = "$root_out_dir/lib.java$target_dir_name/$target_name.jar" |
| 898 _build_config = _base_path + ".build_config" | 902 _build_config = _base_path + ".build_config" |
| 899 | 903 |
| 900 if (_supports_android) { | 904 if (_supports_android) { |
| 901 _dex_path = _base_path + ".dex.jar" | 905 _dex_path = _base_path + ".dex.jar" |
| 902 } | 906 } |
| 903 _deps = [] | 907 _deps = [] |
| 904 if (defined(invoker.deps)) { | 908 if (defined(invoker.deps)) { |
| 905 _deps = invoker.deps | 909 _deps = invoker.deps |
| 906 } | 910 } |
| 907 _jar_deps = [] | 911 _jar_deps = [] |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 } | 1152 } |
| 1149 | 1153 |
| 1150 template("java_library_impl") { | 1154 template("java_library_impl") { |
| 1151 set_sources_assignment_filter([]) | 1155 set_sources_assignment_filter([]) |
| 1152 forward_variables_from(invoker, [ "testonly" ]) | 1156 forward_variables_from(invoker, [ "testonly" ]) |
| 1153 | 1157 |
| 1154 assert( | 1158 assert( |
| 1155 defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) || | 1159 defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir) || |
| 1156 defined(invoker.srcjars) || defined(invoker.srcjar_deps)) | 1160 defined(invoker.srcjars) || defined(invoker.srcjar_deps)) |
| 1157 _base_path = "$target_gen_dir/$target_name" | 1161 _base_path = "$target_gen_dir/$target_name" |
| 1158 _jar_path = _base_path + ".jar" | 1162 |
| 1163 # Jar files can be needed at runtime (by Robolectric tests or java binaries), |
| 1164 # so do not put them under gen/. |
| 1165 target_dir_name = get_label_info(":$target_name", "dir") |
| 1166 _jar_path = "$root_out_dir/lib.java$target_dir_name/$target_name.jar" |
| 1159 if (defined(invoker.jar_path)) { | 1167 if (defined(invoker.jar_path)) { |
| 1160 _jar_path = invoker.jar_path | 1168 _jar_path = invoker.jar_path |
| 1161 } | 1169 } |
| 1162 _template_name = target_name | 1170 _template_name = target_name |
| 1163 | 1171 |
| 1164 _final_deps = [] | 1172 _final_deps = [] |
| 1165 _final_datadeps = [] | 1173 _final_datadeps = [] |
| 1166 if (defined(invoker.datadeps)) { | 1174 if (defined(invoker.datadeps)) { |
| 1167 _final_datadeps = invoker.datadeps | 1175 _final_datadeps = invoker.datadeps |
| 1168 } | 1176 } |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 ] | 1629 ] |
| 1622 args = [ | 1630 args = [ |
| 1623 "--depfile", | 1631 "--depfile", |
| 1624 rebase_path(depfile, root_build_dir), | 1632 rebase_path(depfile, root_build_dir), |
| 1625 "--script-output-path", | 1633 "--script-output-path", |
| 1626 rebase_path(generated_script, root_build_dir), | 1634 rebase_path(generated_script, root_build_dir), |
| 1627 ] | 1635 ] |
| 1628 args += test_runner_args | 1636 args += test_runner_args |
| 1629 } | 1637 } |
| 1630 } | 1638 } |
| OLD | NEW |