Merge changes I957f3df8,I68986dcc am: cf6bf37d04 am: 40fc93fb3c am: 5fc64d1ac8 am: 97c84c01f3 am: a2ca15f88e

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1829372

Change-Id: I0e045aa01c2e5ba8e23ef27d3f05786722d94fc9
This commit is contained in:
Martin Stjernholm
2021-09-24 10:40:09 +00:00
committed by Automerger Merge Worker
17 changed files with 233 additions and 137 deletions

View File

@@ -4649,9 +4649,10 @@ func TestPrebuiltExportDexImplementationJars(t *testing.T) {
transform := android.NullFixturePreparer
checkDexJarBuildPath := func(t *testing.T, ctx *android.TestContext, name string) {
t.Helper()
// Make sure the import has been given the correct path to the dex jar.
p := ctx.ModuleForTests(name, "android_common_myapex").Module().(java.UsesLibraryDependency)
dexJarBuildPath := p.DexJarBuildPath()
dexJarBuildPath := p.DexJarBuildPath().PathOrNil()
stem := android.RemoveOptionalPrebuiltPrefix(name)
android.AssertStringEquals(t, "DexJarBuildPath should be apex-related path.",
".intermediates/myapex.deapexer/android_common/deapexer/javalib/"+stem+".jar",
@@ -4659,6 +4660,7 @@ func TestPrebuiltExportDexImplementationJars(t *testing.T) {
}
checkDexJarInstallPath := func(t *testing.T, ctx *android.TestContext, name string) {
t.Helper()
// Make sure the import has been given the correct path to the dex jar.
p := ctx.ModuleForTests(name, "android_common_myapex").Module().(java.UsesLibraryDependency)
dexJarBuildPath := p.DexJarInstallPath()
@@ -4669,6 +4671,7 @@ func TestPrebuiltExportDexImplementationJars(t *testing.T) {
}
ensureNoSourceVariant := func(t *testing.T, ctx *android.TestContext, name string) {
t.Helper()
// Make sure that an apex variant is not created for the source module.
android.AssertArrayString(t, "Check if there is no source variant",
[]string{"android_common"},
@@ -4706,8 +4709,11 @@ func TestPrebuiltExportDexImplementationJars(t *testing.T) {
// Make sure that dexpreopt can access dex implementation files from the prebuilt.
ctx := testDexpreoptWithApexes(t, bp, "", transform)
deapexerName := deapexerModuleName("myapex")
android.AssertStringEquals(t, "APEX module name from deapexer name", "myapex", apexModuleName(deapexerName))
// Make sure that the deapexer has the correct input APEX.
deapexer := ctx.ModuleForTests("myapex.deapexer", "android_common")
deapexer := ctx.ModuleForTests(deapexerName, "android_common")
rule := deapexer.Rule("deapexer")
if expected, actual := []string{"myapex-arm64.apex"}, android.NormalizePathsForTesting(rule.Implicits); !reflect.DeepEqual(expected, actual) {
t.Errorf("expected: %q, found: %q", expected, actual)