Do not add _platform suffix to non-apex variation
This commit renames `_platform` suffix to `` (empty string) so that non-apex variations are not renamed to `_core_shared_platform` or `_vendor_shared_platform`. This commit makes sure that `_core_shared` and `_vendor_shared` is always under `$OUT_DIR/soong` regardless the usages from apex modules. Furthermore, this avoids the confusing stale lsdump files (e.g. both `_core_shared` and `_core_shared_platform exist) while creating reference ABI dumps for VNDK ABI checks. Bug: 121986692 Test: lunch aosp_arm64-userdebug; make # no more _platform variants. Change-Id: Ic02a60ac45f982580349661c22331d114617fd92
This commit is contained in:
@@ -122,15 +122,13 @@ func (m *ApexModuleBase) IsInstallableToApex() bool {
|
|||||||
|
|
||||||
func (m *ApexModuleBase) CreateApexVariations(mctx BottomUpMutatorContext) []blueprint.Module {
|
func (m *ApexModuleBase) CreateApexVariations(mctx BottomUpMutatorContext) []blueprint.Module {
|
||||||
if len(m.apexVariations) > 0 {
|
if len(m.apexVariations) > 0 {
|
||||||
// The original module is mutated into "platform" variation.
|
variations := []string{""} // Original variation for platform
|
||||||
variations := []string{"platform"}
|
variations = append(variations, m.apexVariations...)
|
||||||
for _, a := range m.apexVariations {
|
|
||||||
variations = append(variations, a)
|
|
||||||
}
|
|
||||||
modules := mctx.CreateVariations(variations...)
|
modules := mctx.CreateVariations(variations...)
|
||||||
for i, m := range modules {
|
for i, m := range modules {
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
continue // platform
|
continue
|
||||||
}
|
}
|
||||||
m.(ApexModule).setApexName(variations[i])
|
m.(ApexModule).setApexName(variations[i])
|
||||||
}
|
}
|
||||||
|
@@ -227,6 +227,10 @@ func TestBasicApex(t *testing.T) {
|
|||||||
// Ensure that both direct and indirect deps are copied into apex
|
// Ensure that both direct and indirect deps are copied into apex
|
||||||
ensureContains(t, copyCmds, "image.apex/lib64/mylib.so")
|
ensureContains(t, copyCmds, "image.apex/lib64/mylib.so")
|
||||||
ensureContains(t, copyCmds, "image.apex/lib64/mylib2.so")
|
ensureContains(t, copyCmds, "image.apex/lib64/mylib2.so")
|
||||||
|
|
||||||
|
// Ensure that the platform variant ends with _core_shared
|
||||||
|
ensureListContains(t, ctx.ModuleVariantsForTests("mylib"), "android_arm64_armv8-a_core_shared")
|
||||||
|
ensureListContains(t, ctx.ModuleVariantsForTests("mylib2"), "android_arm64_armv8-a_core_shared")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBasicZipApex(t *testing.T) {
|
func TestBasicZipApex(t *testing.T) {
|
||||||
@@ -664,5 +668,5 @@ func TestStaticLinking(t *testing.T) {
|
|||||||
ldFlags := ctx.ModuleForTests("not_in_apex", "android_arm64_armv8-a_core").Rule("ld").Args["libFlags"]
|
ldFlags := ctx.ModuleForTests("not_in_apex", "android_arm64_armv8-a_core").Rule("ld").Args["libFlags"]
|
||||||
|
|
||||||
// Ensure that not_in_apex is linking with the static variant of mylib
|
// Ensure that not_in_apex is linking with the static variant of mylib
|
||||||
ensureContains(t, ldFlags, "mylib/android_arm64_armv8-a_core_static_platform/mylib.a")
|
ensureContains(t, ldFlags, "mylib/android_arm64_armv8-a_core_static/mylib.a")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user