Merge "Create APEX variant for prebuilt_apex/apex_set" am: 2960e9bdf2 am: 70fc36a6fc

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

Change-Id: I0cf928c7649040fe588ae8ff9d7db55f4f6c7610
This commit is contained in:
Paul Duffin
2021-06-17 07:04:27 +00:00
committed by Automerger Merge Worker
3 changed files with 34 additions and 11 deletions

View File

@@ -4239,7 +4239,7 @@ func TestPrebuilt(t *testing.T) {
}
`)
prebuilt := ctx.ModuleForTests("myapex", "android_common").Module().(*Prebuilt)
prebuilt := ctx.ModuleForTests("myapex", "android_common_myapex").Module().(*Prebuilt)
expectedInput := "myapex-arm64.apex"
if prebuilt.inputApex.String() != expectedInput {
@@ -4248,7 +4248,7 @@ func TestPrebuilt(t *testing.T) {
}
func TestPrebuiltMissingSrc(t *testing.T) {
testApexError(t, `module "myapex" variant "android_common".*: prebuilt_apex does not support "arm64_armv8-a"`, `
testApexError(t, `module "myapex" variant "android_common_myapex".*: prebuilt_apex does not support "arm64_armv8-a"`, `
prebuilt_apex {
name: "myapex",
}
@@ -4264,7 +4264,7 @@ func TestPrebuiltFilenameOverride(t *testing.T) {
}
`)
p := ctx.ModuleForTests("myapex", "android_common").Module().(*Prebuilt)
p := ctx.ModuleForTests("myapex", "android_common_myapex").Module().(*Prebuilt)
expected := "notmyapex.apex"
if p.installFilename != expected {
@@ -4283,7 +4283,7 @@ func TestPrebuiltOverrides(t *testing.T) {
}
`)
p := ctx.ModuleForTests("myapex.prebuilt", "android_common").Module().(*Prebuilt)
p := ctx.ModuleForTests("myapex.prebuilt", "android_common_myapex.prebuilt").Module().(*Prebuilt)
expected := []string{"myapex"}
actual := android.AndroidMkEntriesForTest(t, ctx, p)[0].EntryMap["LOCAL_OVERRIDES_MODULES"]
@@ -4353,7 +4353,7 @@ func TestPrebuiltExportDexImplementationJars(t *testing.T) {
}
// Make sure that the prebuilt_apex has the correct input APEX.
prebuiltApex := ctx.ModuleForTests("myapex", "android_common")
prebuiltApex := ctx.ModuleForTests("myapex", "android_common_myapex")
rule = prebuiltApex.Rule("android/soong/android.Cp")
if expected, actual := "myapex-arm64.apex", android.NormalizePathForTesting(rule.Input); !reflect.DeepEqual(expected, actual) {
t.Errorf("expected: %q, found: %q", expected, actual)
@@ -6372,8 +6372,8 @@ func TestAppSetBundlePrebuilt(t *testing.T) {
android.AssertArrayString(t, "extractor input", []string{"myapex.hwasan.apks"}, extractedApex.Inputs.Strings())
// Ditto for the apex.
m = ctx.ModuleForTests("myapex", "android_common")
copiedApex := m.Output("out/soong/.intermediates/myapex/android_common/foo_v2.apex")
m = ctx.ModuleForTests("myapex", "android_common_myapex")
copiedApex := m.Output("out/soong/.intermediates/myapex/android_common_myapex/foo_v2.apex")
android.AssertStringEquals(t, "myapex input", extractorOutput, copiedApex.Input.String())
}
@@ -7033,7 +7033,7 @@ func TestApexSet(t *testing.T) {
t.Errorf("Unexpected abis parameter - expected %q vs actual %q", expected, actual)
}
m = ctx.ModuleForTests("myapex", "android_common")
m = ctx.ModuleForTests("myapex", "android_common_myapex")
a := m.Module().(*ApexSet)
expectedOverrides := []string{"foo"}
actualOverrides := android.AndroidMkEntriesForTest(t, ctx, a)[0].EntryMap["LOCAL_OVERRIDES_MODULES"]