summaryrefslogtreecommitdiff
path: root/java/androidmk_test.go
diff options
context:
space:
mode:
author Bill Peckham <bpeckham@google.com> 2021-01-20 17:43:48 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-01-20 17:43:48 +0000
commit1c8e5e817ef5aa852a88ea58c85f616eccee7d27 (patch)
tree439f2a1d2480ba074699f2a90240cf013ead695d /java/androidmk_test.go
parent965561ce434817fa1c6f819919f6bae0eec18320 (diff)
parentfb04df4d57e52b38e6ebfec9cfcc2bb76968b2ce (diff)
Merge changes from topic "prebuilt-hiddenapi"
* changes: Supply LOCAL_SOONG_DEX_JAR for java_import with compile_dex. Enable an apex to include a java_import. Enable prebuilt hiddenapi CSV files.
Diffstat (limited to 'java/androidmk_test.go')
-rw-r--r--java/androidmk_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/java/androidmk_test.go b/java/androidmk_test.go
index 233e9d5c5..e2647cf0f 100644
--- a/java/androidmk_test.go
+++ b/java/androidmk_test.go
@@ -166,3 +166,25 @@ func TestJavaSdkLibrary_RequireXmlPermissionFile(t *testing.T) {
}
}
}
+
+func TestImportSoongDexJar(t *testing.T) {
+ ctx, config := testJava(t, `
+ java_import {
+ name: "my-java-import",
+ jars: ["a.jar"],
+ prefer: true,
+ compile_dex: true,
+ }
+ `)
+
+ mod := ctx.ModuleForTests("my-java-import", "android_common").Module()
+ entries := android.AndroidMkEntriesForTest(t, config, "", mod)[0]
+ expectedSoongDexJar := buildDir + "/.intermediates/my-java-import/android_common/dex/my-java-import.jar"
+ actualSoongDexJar := entries.EntryMap["LOCAL_SOONG_DEX_JAR"]
+
+ if len(actualSoongDexJar) != 1 {
+ t.Errorf("LOCAL_SOONG_DEX_JAR incorrect len %d", len(actualSoongDexJar))
+ } else if actualSoongDexJar[0] != expectedSoongDexJar {
+ t.Errorf("LOCAL_SOONG_DEX_JAR mismatch, actual: %s, expected: %s", actualSoongDexJar[0], expectedSoongDexJar)
+ }
+}