Commit 2197b5a0 authored by Peter Wen's avatar Peter Wen Committed by Commit Bot

Android: Remove _java_target_exceptions

Rename the one offending non-java target with a java target name pattern
by removing _java and _junit.

Bug: 1090812
Change-Id: I8a00951fd9564e9b2842af78e4f5485f9df5aa7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2229001
Auto-Submit: Peter Wen <wnwen@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774635}
parent 33861da9
...@@ -45,12 +45,8 @@ _java_target_patterns = _java_lib_patterns + [ ...@@ -45,12 +45,8 @@ _java_target_patterns = _java_lib_patterns + [
"*_bundle_module", "*_bundle_module",
] ]
# Targets that match _java_target_patterns but are not actually java targets.
_java_target_exceptions = [ "*:*_unpack_aar" ]
# These targets match _java_lib_patterns but do not use java_library_impl. # These targets match _java_lib_patterns but do not use java_library_impl.
_java_lib_exceptions = _java_lib_exceptions = _java_target_patterns - _java_lib_patterns
_java_target_patterns - _java_lib_patterns + _java_target_exceptions
_r8_path = "//third_party/r8/lib/r8.jar" _r8_path = "//third_party/r8/lib/r8.jar"
_desugar_jdk_libs_json = "//third_party/r8/desugar_jdk_libs.json" _desugar_jdk_libs_json = "//third_party/r8/desugar_jdk_libs.json"
...@@ -127,8 +123,7 @@ template("write_build_config") { ...@@ -127,8 +123,7 @@ template("write_build_config") {
if (_type != "android_apk" && _type != "java_binary" && _type != "dist_jar" && if (_type != "android_apk" && _type != "java_binary" && _type != "dist_jar" &&
_type != "java_annotation_processor" && _type != "dist_aar" && _type != "java_annotation_processor" && _type != "dist_aar" &&
_type != "android_app_bundle") { _type != "android_app_bundle") {
if (filter_exclude([ _target_label ], _java_target_patterns) != [] && if (filter_exclude([ _target_label ], _java_target_patterns) != []) {
filter_exclude([ _target_label ], _java_target_exceptions) != []) {
assert(false, "Invalid java target name: $_target_label") assert(false, "Invalid java target name: $_target_label")
} }
} }
...@@ -159,8 +154,7 @@ template("write_build_config") { ...@@ -159,8 +154,7 @@ template("write_build_config") {
if (defined(invoker.possible_config_deps)) { if (defined(invoker.possible_config_deps)) {
foreach(_possible_dep, invoker.possible_config_deps) { foreach(_possible_dep, invoker.possible_config_deps) {
_dep_label = get_label_info(_possible_dep, "label_no_toolchain") _dep_label = get_label_info(_possible_dep, "label_no_toolchain")
if (filter_exclude([ _dep_label ], _java_target_patterns) == [] && if (filter_exclude([ _dep_label ], _java_target_patterns) == []) {
filter_exclude([ _dep_label ], _java_target_exceptions) != []) {
# Put the bug number in the target name so that false-positives # Put the bug number in the target name so that false-positives
# have a hint in the error message about non-existent dependencies. # have a hint in the error message about non-existent dependencies.
deps += [ "$_dep_label$build_config_target_suffix" ] deps += [ "$_dep_label$build_config_target_suffix" ]
......
...@@ -4147,7 +4147,13 @@ if (enable_java_templates) { ...@@ -4147,7 +4147,13 @@ if (enable_java_templates) {
_info_path = invoker.info_path _info_path = invoker.info_path
} }
_output_path = "${target_out_dir}/${target_name}" _output_path = "${target_out_dir}/${target_name}"
_unpack_target_name = "${target_name}__unpack_aar" _target_name_without_java_or_junit =
string_replace(string_replace(target_name, "_java", ""), "_junit", "")
# This unpack target is a python action, not a valid java target. Since the
# java targets below depend on it, its name must not match the java patterns
# in internal_rules.gni.
_unpack_target_name = "${_target_name_without_java_or_junit}__unpack_aar"
_ignore_aidl = defined(invoker.ignore_aidl) && invoker.ignore_aidl _ignore_aidl = defined(invoker.ignore_aidl) && invoker.ignore_aidl
_ignore_assets = defined(invoker.ignore_assets) && invoker.ignore_assets _ignore_assets = defined(invoker.ignore_assets) && invoker.ignore_assets
_ignore_manifest = _ignore_manifest =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment