diff options
author | Colin Cross <ccross@android.com> | 2020-10-09 19:00:54 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2020-10-09 19:27:34 -0700 |
commit | 89226d9ef94040215ff9d97212d997a656f5d508 (patch) | |
tree | 45485d3cf844e392b552c9e1f249671557eda296 /java/java_test.go | |
parent | c179ea68129972f6c5789c5fc8344d06caebcc8b (diff) |
Add jni_libs to host java binaries
Add a property to support dependencies on JNI libraries for host
java binaries.
Fixes: 170389375
Test: TestBinary
Change-Id: Ieeca3c3997615f0b17ae1f058b94e6c9ba929cab
Diffstat (limited to 'java/java_test.go')
-rw-r--r-- | java/java_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go index a727812b5..2fd4121aa 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -456,6 +456,14 @@ func TestBinary(t *testing.T) { name: "bar", srcs: ["b.java"], static_libs: ["foo"], + jni_libs: ["libjni"], + } + + cc_library_shared { + name: "libjni", + host_supported: true, + device_supported: false, + stl: "none", } `) @@ -466,10 +474,18 @@ func TestBinary(t *testing.T) { barWrapper := ctx.ModuleForTests("bar", buildOS+"_x86_64") barWrapperDeps := barWrapper.Output("bar").Implicits.Strings() + libjni := ctx.ModuleForTests("libjni", buildOS+"_x86_64_shared") + libjniSO := libjni.Rule("Cp").Output.String() + // Test that the install binary wrapper depends on the installed jar file if g, w := barWrapperDeps, barJar; !android.InList(w, g) { t.Errorf("expected binary wrapper implicits to contain %q, got %q", w, g) } + + // Test that the install binary wrapper depends on the installed JNI libraries + if g, w := barWrapperDeps, libjniSO; !android.InList(w, g) { + t.Errorf("expected binary wrapper implicits to contain %q, got %q", w, g) + } } func TestHostBinaryNoJavaDebugInfoOverride(t *testing.T) { |