Android: Use direct deps for cronet and modules (reland)

Remove allowlist for bypassing turbine direct deps since the last items
in the allowlist (cronet and modules) have been removed.

Bundle feature modules require the base module in their classpath.
Previously they were able to get by since the base module was added to
their transitive classpath, but the base module should be in their
direct classpath as it is used directly in R.java via inheritance.

Fix in reland:
- Add missing dep on base module java

Tbr: agrieve@chromium.org for reland
Fixed: 1082904
Bug: 1082904
Change-Id: I4b2d6a173ad207efcc9730589b1322a02071a2c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2314938
Commit-Queue: Peter Wen <wnwen@chromium.org>
Auto-Submit: Peter Wen <wnwen@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791258}
GitOrigin-RevId: 85f7ce53467938a068a0a670db400eec1090a739
This commit is contained in:
Peter Wen 2020-07-23 16:59:29 +00:00 коммит произвёл Copybara-Service
Родитель bdbc779ea9
Коммит 2011c7b3dd
3 изменённых файлов: 15 добавлений и 26 удалений

Просмотреть файл

@ -1469,6 +1469,10 @@ def main(argv):
base_module_build_config['deps_info']['interface_jar_path'])
jetified_full_jar_classpath.add(
base_module_build_config['deps_info']['jetified_jar_path'])
# Turbine now compiles headers against only the direct classpath, so the
# base module's interface jar must be on the direct interface classpath.
javac_interface_classpath.add(
base_module_build_config['deps_info']['interface_jar_path'])
for dep in direct_group_deps:
if 'extra_classpath_jars' in dep:

Просмотреть файл

@ -3091,19 +3091,7 @@ if (enable_java_templates) {
]
}
# Temporarily allow a list of directories to bypass turbine direct deps.
# TODO(crbug.com/1082904): Remove every entry in this allowlist.
_allow_transitive_interfaces =
filter_exclude(
[ get_label_info(":$target_name", "label_no_toolchain") ],
[
"//components/cronet*",
# This is due to the "special group" bypass.
"*_bundle_module__java__header",
]) == []
if (invoker.use_turbine && !_allow_transitive_interfaces) {
if (invoker.use_turbine) {
# Prefer direct deps for turbine as much as possible.
args += [ "--classpath=@FileArg($_rebased_build_config:javac:interface_classpath)" ]
} else {
@ -3540,6 +3528,14 @@ if (enable_java_templates) {
_java_impl_deps += [ "${invoker.apk_under_test}__java__impl" ]
}
# These deps cannot be passed via invoker.deps since bundle_module targets
# have bundle_module.build_config without the __java suffix, so they are
# special and cannot be passed as regular deps to write_build_config.
if (defined(invoker.base_module_target)) {
_java_header_deps += [ "${invoker.base_module_target}__java__header" ]
_java_impl_deps += [ "${invoker.base_module_target}__java__impl" ]
}
_extra_java_deps = []
_jacoco_instrument =
use_jacoco_coverage && _chromium_code && _java_files != [] &&
@ -3647,6 +3643,8 @@ if (enable_java_templates) {
jetified_jar_path = _jetified_jar_path
}
# Specifically avoid passing in invoker.base_module_target as one of the
# possible_config_deps.
possible_config_deps = []
if (defined(_extra_java_deps)) {
possible_config_deps = _extra_java_deps

Просмотреть файл

@ -2736,15 +2736,6 @@ if (enable_java_templates) {
_java_target = "${_template_name}__java"
# Included special group to bypass looking for __java__build_config file
# for base module. Build config for base_module does not include the __java
# (eg. monochrome_public_bundle__base_bundle_module__build_config)
# and thus, this workaround skips looking for one.
if (defined(invoker.base_module_target)) {
group("${_template_name}__group") {
deps = [ "${invoker.base_module_target}__java" ]
}
}
java_library_impl(_java_target) {
forward_variables_from(invoker,
[
@ -2781,10 +2772,6 @@ if (enable_java_templates) {
type = "android_app_bundle_module"
res_size_info_path = _res_size_info_path
is_base_module = _is_base_module
if (!is_base_module && defined(invoker.base_module_target)) {
deps += [ ":${_template_name}__group" ]
}
} else {
type = "android_apk"
}