Commit 85f7ce53 authored by Peter Wen's avatar Peter Wen Committed by Commit Bot

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: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791258}
parent ff43691b
......@@ -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"
}
......
......@@ -346,6 +346,7 @@ android_library("cronet_impl_fake_base_java") {
":cronet_api_java",
":cronet_impl_common_base_java",
":cronet_impl_java_util_java",
"//third_party/android_deps:androidx_annotation_annotation_java",
]
}
......@@ -375,7 +376,10 @@ android_library("cronet_urlconnection_impl_java") {
"java/src/org/chromium/net/urlconnection/CronetURLStreamHandlerFactory.java",
"java/src/org/chromium/net/urlconnection/MessageLoop.java",
]
deps = [ ":cronet_api_java" ]
deps = [
":cronet_api_java",
"//third_party/android_deps:androidx_annotation_annotation_java",
]
}
# cronet_impl_native_base_java.jar - native implementation of the Cronet engine.
......@@ -481,8 +485,8 @@ action("cronet_combine_proguard_flags") {
"//base/android/proguard/chromium_code.flags",
# Massage the proguard to avoid incompatibilities when building internally.
"//components/cronet/android/cronet_workaround.patch",
"//components/cronet/android/cronet_impl_native_proguard.cfg",
"//components/cronet/android/cronet_workaround.patch",
]
outputs = [ "$target_gen_dir/cronet_impl_native_proguard.cfg" ]
args = [ "--output-file" ] + rebase_path(outputs, root_build_dir) +
......@@ -935,6 +939,7 @@ if (!is_component_build) {
":cronet_impl_fake_base_java",
":cronet_impl_platform_base_java",
"//base:base_java_test_support",
"//third_party/android_deps:androidx_test_runner_java",
"//third_party/android_sdk:android_test_base_java",
"//third_party/android_support_test_runner:runner_java",
"//third_party/junit",
......@@ -1003,6 +1008,7 @@ if (!is_component_build) {
":cronet_api_java",
":cronet_impl_all_java",
":cronet_urlconnection_impl_java",
"//third_party/android_deps:androidx_test_runner_java",
"//third_party/android_sdk:android_test_base_java",
"//third_party/android_support_test_runner:runner_java",
"//third_party/hamcrest:hamcrest_core_java",
......@@ -1038,6 +1044,7 @@ if (!is_component_build) {
"//base:base_java_test_support",
"//net/android:net_java",
"//net/android:net_java_test_support",
"//third_party/android_deps:androidx_test_runner_java",
"//third_party/android_sdk:android_test_base_java",
"//third_party/android_sdk:android_test_mock_java",
"//third_party/android_support_test_runner:runner_java",
......@@ -1089,6 +1096,7 @@ if (!is_component_build) {
":cronet_impl_platform_base_java",
":cronet_smoketests_platform_only_apk_resources",
"//base:base_java_test_support",
"//third_party/android_deps:androidx_test_runner_java",
"//third_party/android_sdk:android_test_base_java",
"//third_party/android_sdk:android_test_mock_java",
"//third_party/android_support_test_runner:runner_java",
......@@ -1123,6 +1131,7 @@ if (!is_component_build) {
":cronet_test_apk_resources",
"//base:base_java",
"//base:base_java_test_support",
"//third_party/android_deps:androidx_test_runner_java",
"//third_party/android_sdk:android_test_base_java",
"//third_party/android_sdk:android_test_mock_java",
"//third_party/android_support_test_runner:runner_java",
......
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