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:
Logan Chien 2018-12-26 15:32:21 +08:00
parent e7968b192c
commit 3aeedc9592
2 changed files with 9 additions and 7 deletions

View File

@ -122,15 +122,13 @@ func (m *ApexModuleBase) IsInstallableToApex() bool {
func (m *ApexModuleBase) CreateApexVariations(mctx BottomUpMutatorContext) []blueprint.Module {
if len(m.apexVariations) > 0 {
// The original module is mutated into "platform" variation.
variations := []string{"platform"}
for _, a := range m.apexVariations {
variations = append(variations, a)
}
variations := []string{""} // Original variation for platform
variations = append(variations, m.apexVariations...)
modules := mctx.CreateVariations(variations...)
for i, m := range modules {
if i == 0 {
continue // platform
continue
}
m.(ApexModule).setApexName(variations[i])
}

View File

@ -227,6 +227,10 @@ func TestBasicApex(t *testing.T) {
// 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/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) {
@ -664,5 +668,5 @@ func TestStaticLinking(t *testing.T) {
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
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")
}