Commit 3d23ab6f authored by Eric Stevenson's avatar Eric Stevenson Committed by Commit Bot

Cronet: Fix handling of GEN_JNI packaging.

Previously, the "repackage_native" target was providing the GEN_JNI
class. When there were multiple deps containing this class, zip.py
would just choose the first one. This works right now because it grabs
//base_java's GEN_JNI and the only dep of cronet using proxy natives
is //base_java.

To allow more deps to use proxy natives, this CL adds a couple
sub-targets that are responsible for including the correct version of
GEN_JNI.

Bug: 929661, 1005836
Change-Id: Ifbcba3c012e7191be8ca410f4e8789ec791eac6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1811974
Commit-Queue: Paul Jensen <pauljensen@chromium.org>
Reviewed-by: default avatarPaul Jensen <pauljensen@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Auto-Submit: Eric Stevenson <estevenson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699711}
parent 3ea2e6a3
...@@ -732,15 +732,42 @@ repackage_jars("repackage_util") { ...@@ -732,15 +732,42 @@ repackage_jars("repackage_util") {
] ]
} }
# See crbug.com/1005836 for more info on why repackage_native requires 2 extra
# targets. These 3 targets exist to ensure the correct version of GEN_JNI
# (a generated class containing native method definitions) is included.
repackage_jars("repackage_native") { repackage_jars("repackage_native") {
output = "$_package_dir/cronet_impl_native_java.jar" output = "$_package_dir/cronet_impl_native_java.jar"
deps = cronet_impl_native_java_deps_to_package + [ deps = [
":cronet_impl_native_base_java",
":cronet_jni_registration_java", ":cronet_jni_registration_java",
":repackage_native_java",
] ]
jar_excluded_patterns = _jar_excluded_patterns jar_excluded_patterns = _jar_excluded_patterns
} }
_native_intermediate_jar_path = "$target_out_dir/repackage_native_impl.jar"
# Do not depend on this target directly. Use :repackage_native.
repackage_jars("repackage_native_impl") {
output = _native_intermediate_jar_path
deps = cronet_impl_native_java_deps_to_package +
[ ":cronet_impl_native_base_java" ]
jar_excluded_patterns = _jar_excluded_patterns
}
# Do not depend on this target directly. Use :repackage_native.
# This target exists to provide :repackage_native with a suitable target to
# depend on (since dist_aar only pulls in deps of type "java_library").
android_java_prebuilt("repackage_native_java") {
jar_path = _native_intermediate_jar_path
# Since only the unprocessed jar is used, no need to complete the bytecode
# processing steps.
enable_bytecode_rewriter = false
deps = [
":repackage_native_impl",
]
}
repackage_jars("repackage_common") { repackage_jars("repackage_common") {
output = "$_package_dir/cronet_impl_common_java.jar" output = "$_package_dir/cronet_impl_common_java.jar"
deps = cronet_impl_common_java_deps_to_package + [ deps = cronet_impl_common_java_deps_to_package + [
......
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