Supply LOCAL_SOONG_DEX_JAR for java_import with compile_dex.
Without LOCAL_SOONG_DEX_JAR, ninja fails with a missing dependency error. Test: m nothing Test: new TestImportSoongDexJar Bug: 173705556 Change-Id: I54a4c6ea93877667a3fb97f8b2621c42e431f577
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user