From e42c5d96f90f64ba9b2d85b2e8e099c1f8ea3f8e Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Thu, 3 Oct 2024 22:39:52 +0000 Subject: Add JNI libs support to device variants of java_binary This adds jni_libs support back to device variants, which was removed in https://r.android.com/3230584. These will be installed by the two packaging systems in different ways 1. Kati: By being listed in `LOCAL_REQUIRED_MODULES` of the autogenerated Android.mk 2. Soong: Via the`jniInstallTag`, whose `InstallDepNeeded` value is true This CL also makes it an error for a native library to be listed in `required` of a `java_binary(_host)`. Test: m nothing --no-skip-soong-tests Test: Verified that there are no diff in system_intermediates/file_list.txt (device variants) Test: m installclean && m ; verified that the jni library is installed in out/host/linux-x86/lib64 (host variants) Bug: 370110572 Change-Id: I6aebc648191ab39f2da15a5f2807d46abab22cb0 --- java/java_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'java/java_test.go') diff --git a/java/java_test.go b/java/java_test.go index db154ce98..24dabdb10 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -3102,7 +3102,7 @@ func assertTestOnlyAndTopLevel(t *testing.T, ctx *android.TestResult, expectedTe } } -// Test that a dependency edge is created to the "first" variant of a native library listed in `required` of java_binary +// Test that a dependency edge is created to the matching variant of a native library listed in `jni_libs` of java_binary func TestNativeRequiredDepOfJavaBinary(t *testing.T) { findDepsOfModule := func(ctx *android.TestContext, module android.Module, depName string) []blueprint.Module { var ret []blueprint.Module @@ -3118,7 +3118,7 @@ func TestNativeRequiredDepOfJavaBinary(t *testing.T) { java_binary { name: "myjavabin", main_class: "com.android.MyJava", - required: ["mynativelib"], + jni_libs: ["mynativelib"], } cc_library_shared { name: "mynativelib", -- cgit v1.2.3-59-g8ed1b