Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3aeedc95 authored by Logan Chien's avatar Logan Chien
Browse files

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
parent e7968b19
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -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])
		}
+5 −1
Original line number Diff line number Diff line
@@ -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")
}