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 # Do not add any imports to non-//build directories here. | 5 # Do not add any imports to non-//build directories here. |
6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. | 6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. |
7 import("//build_overrides/build.gni") | 7 import("//build_overrides/build.gni") |
8 import("//build/config/android/config.gni") | 8 import("//build/config/android/config.gni") |
9 import("//build/config/dcheck_always_on.gni") | 9 import("//build/config/dcheck_always_on.gni") |
10 import("//build/config/sanitizers/sanitizers.gni") | 10 import("//build/config/sanitizers/sanitizers.gni") |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1174 _jar_excluded_patterns = invoker.jar_excluded_patterns | 1174 _jar_excluded_patterns = invoker.jar_excluded_patterns |
1175 } | 1175 } |
1176 _strip_resource_classes = defined(invoker.strip_resource_classes) && | 1176 _strip_resource_classes = defined(invoker.strip_resource_classes) && |
1177 invoker.strip_resource_classes | 1177 invoker.strip_resource_classes |
1178 _filter_jar = _jar_excluded_patterns != [] || _strip_resource_classes | 1178 _filter_jar = _jar_excluded_patterns != [] || _strip_resource_classes |
1179 | 1179 |
1180 _enable_assert = | 1180 _enable_assert = |
1181 defined(invoker.supports_android) && invoker.supports_android && | 1181 defined(invoker.supports_android) && invoker.supports_android && |
1182 (is_java_debug || dcheck_always_on) | 1182 (is_java_debug || dcheck_always_on) |
1183 | 1183 |
1184 #TODO(zpeng): Remove Retrolambda when Desugar is enabled. | |
agrieve
2017/07/20 00:26:52
Can we do this now rather than checking in an if (
F
2017/07/20 17:30:56
Done.
| |
1184 _retrolambda = | 1185 _retrolambda = |
1185 defined(invoker.supports_android) && invoker.supports_android && | 1186 defined(invoker.supports_android) && invoker.supports_android && |
1186 ((defined(invoker.process_java8) && invoker.process_java8) || use_java8) | 1187 ((defined(invoker.process_java8) && invoker.process_java8) || use_java8) |
1187 | 1188 |
1189 _desugar = false && | |
1190 defined(invoker.supports_android) && invoker.supports_android && | |
1191 ((defined(invoker.process_java8) && invoker.process_java8) || use_java8) | |
1192 | |
1188 _deps = [] | 1193 _deps = [] |
1189 _previous_output_jar = _input_jar_path | 1194 _previous_output_jar = _input_jar_path |
1190 | 1195 |
1191 if (_filter_jar) { | 1196 if (_filter_jar) { |
1192 _filter_target = "${target_name}__filter" | 1197 _filter_target = "${target_name}__filter" |
1193 _filter_input_jar = _previous_output_jar | 1198 _filter_input_jar = _previous_output_jar |
1194 _filter_output_jar = "$target_out_dir/$target_name-filtered.jar" | 1199 _filter_output_jar = "$target_out_dir/$target_name-filtered.jar" |
1195 | 1200 |
1196 action(_filter_target) { | 1201 action(_filter_target) { |
1197 script = "//build/android/gyp/jar.py" | 1202 script = "//build/android/gyp/jar.py" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1291 "--android-sdk-jar", | 1296 "--android-sdk-jar", |
1292 rebase_path(android_sdk_jar, root_build_dir), | 1297 rebase_path(android_sdk_jar, root_build_dir), |
1293 ] | 1298 ] |
1294 } | 1299 } |
1295 | 1300 |
1296 _deps = [] | 1301 _deps = [] |
1297 _deps = [ ":$_retrolambda_target" ] | 1302 _deps = [ ":$_retrolambda_target" ] |
1298 _previous_output_jar = _retrolambda_output_jar | 1303 _previous_output_jar = _retrolambda_output_jar |
1299 } | 1304 } |
1300 | 1305 |
1306 if (_desugar) { | |
1307 _desugar_target = "${target_name}__desugar" | |
1308 _desugar_input_jar = _previous_output_jar | |
1309 _desugar_output_jar = "$target_out_dir/$target_name-desugar.jar" | |
1310 | |
1311 android_sdk_jar = "$android_sdk/android.jar" | |
1312 action(_desugar_target) { | |
1313 script = "//build/android/gyp/desugar.py" | |
1314 deps = _deps | |
1315 if (defined(invoker.deps)) { | |
1316 deps += invoker.deps | |
1317 } | |
1318 if (defined(invoker.public_deps)) { | |
1319 public_deps = invoker.public_deps | |
1320 } | |
1321 inputs = [ | |
1322 _build_config, | |
1323 _desugar_input_jar, | |
1324 ] | |
1325 outputs = [ | |
1326 _desugar_output_jar, | |
1327 ] | |
1328 if (defined(invoker.alternative_android_sdk_ijar)) { | |
1329 deps += [ invoker.alternative_android_sdk_ijar_dep ] | |
1330 _android_sdk_ijar = invoker.alternative_android_sdk_ijar | |
1331 } else { | |
1332 deps += [ "//build/android:android_ijar" ] | |
1333 _android_sdk_ijar = "$root_out_dir/lib.java/android.interface.jar" | |
1334 } | |
1335 inputs += [ _android_sdk_ijar ] | |
1336 args = [ | |
1337 "--input-jar", | |
1338 rebase_path(_desugar_input_jar, root_build_dir), | |
1339 "--output-jar", | |
1340 rebase_path(_desugar_output_jar, root_build_dir), | |
1341 "--classpath=@FileArg($_rebased_build_config:javac:classpath)", | |
1342 "--android-sdk-jar", | |
1343 rebase_path(android_sdk_jar, root_build_dir), | |
1344 "--bootclasspath", | |
1345 rebase_path(_android_sdk_ijar, root_build_dir), | |
1346 ] | |
1347 } | |
1348 | |
1349 _deps = [] | |
1350 _deps = [ ":$_desugar_target" ] | |
1351 _previous_output_jar = _desugar_output_jar | |
1352 } | |
1353 | |
1301 _output_jar_target = "${target_name}__copy" | 1354 _output_jar_target = "${target_name}__copy" |
1302 copy(_output_jar_target) { | 1355 copy(_output_jar_target) { |
1303 deps = _deps | 1356 deps = _deps |
1304 if (defined(invoker.deps)) { | 1357 if (defined(invoker.deps)) { |
1305 deps += invoker.deps | 1358 deps += invoker.deps |
1306 } | 1359 } |
1307 if (defined(invoker.public_deps)) { | 1360 if (defined(invoker.public_deps)) { |
1308 public_deps = invoker.public_deps | 1361 public_deps = invoker.public_deps |
1309 } | 1362 } |
1310 sources = [ | 1363 sources = [ |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2041 # Use original jar_path because _jar_path points to a library without | 2094 # Use original jar_path because _jar_path points to a library without |
2042 # resources. | 2095 # resources. |
2043 java_resources_jar = invoker.jar_path | 2096 java_resources_jar = invoker.jar_path |
2044 } | 2097 } |
2045 } | 2098 } |
2046 | 2099 |
2047 process_java_prebuilt(_process_jar_target_name) { | 2100 process_java_prebuilt(_process_jar_target_name) { |
2048 forward_variables_from(invoker, | 2101 forward_variables_from(invoker, |
2049 [ | 2102 [ |
2050 "jar_excluded_patterns", | 2103 "jar_excluded_patterns", |
2104 "process_java8", | |
2051 "strip_resource_classes", | 2105 "strip_resource_classes", |
2052 "process_java8", | |
2053 ]) | 2106 ]) |
2054 | 2107 |
2055 visibility = [ | 2108 visibility = [ |
2056 ":$_ijar_target_name", | 2109 ":$_ijar_target_name", |
2057 ":$_template_name", | 2110 ":$_template_name", |
2058 ] | 2111 ] |
2059 if (_supports_android) { | 2112 if (_supports_android) { |
2060 visibility += [ ":$_dex_target_name" ] | 2113 visibility += [ ":$_dex_target_name" ] |
2061 } | 2114 } |
2062 | 2115 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2334 inputs += [ file_tuple[0] ] | 2387 inputs += [ file_tuple[0] ] |
2335 args += | 2388 args += |
2336 [ "--additional-jar-file=" + file_tuple[0] + ":" + file_tuple[1] ] | 2389 [ "--additional-jar-file=" + file_tuple[0] + ":" + file_tuple[1] ] |
2337 } | 2390 } |
2338 if (invoker.java_files != []) { | 2391 if (invoker.java_files != []) { |
2339 args += [ "@" + rebase_path(invoker.java_sources_file, root_build_dir) ] | 2392 args += [ "@" + rebase_path(invoker.java_sources_file, root_build_dir) ] |
2340 } | 2393 } |
2341 } | 2394 } |
2342 | 2395 |
2343 process_java_prebuilt(_process_prebuilt_target_name) { | 2396 process_java_prebuilt(_process_prebuilt_target_name) { |
2344 forward_variables_from(invoker, [ "jar_excluded_patterns" ]) | 2397 forward_variables_from(invoker, |
2398 [ | |
2399 "alternative_android_sdk_ijar", | |
2400 "alternative_android_sdk_ijar_dep", | |
2401 "jar_excluded_patterns", | |
2402 ]) | |
2345 supports_android = _supports_android | 2403 supports_android = _supports_android |
2346 build_config = _build_config | 2404 build_config = _build_config |
2347 input_jar_path = _javac_jar_path | 2405 input_jar_path = _javac_jar_path |
2348 output_jar_path = _process_prebuilt_jar_path | 2406 output_jar_path = _process_prebuilt_jar_path |
2349 | 2407 |
2350 deps = [ | 2408 deps = [ |
2351 ":$_javac_target_name", | 2409 ":$_javac_target_name", |
2352 ] | 2410 ] |
2353 if (defined(invoker.deps)) { | 2411 if (defined(invoker.deps)) { |
2354 deps += invoker.deps | 2412 deps += invoker.deps |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2976 rebase_path(root_build_dir, root_build_dir), | 3034 rebase_path(root_build_dir, root_build_dir), |
2977 "--packed-libraries-dir", | 3035 "--packed-libraries-dir", |
2978 rebase_path(_packed_libraries_dir, root_build_dir), | 3036 rebase_path(_packed_libraries_dir, root_build_dir), |
2979 "--libraries=${invoker.libraries_filearg}", | 3037 "--libraries=${invoker.libraries_filearg}", |
2980 "--filelistjson", | 3038 "--filelistjson", |
2981 rebase_path(invoker.file_list_json, root_build_dir), | 3039 rebase_path(invoker.file_list_json, root_build_dir), |
2982 ] | 3040 ] |
2983 } | 3041 } |
2984 } | 3042 } |
2985 } | 3043 } |
OLD | NEW |