Use Source_apex_name for LOCAL_MODULE in Soong gen Android.mk
For versioned mainline prebuilts, the version is getting written to
`LOCAL_MODULE` property in the generated Android.mk file, even when they
set Source_apex_name. This CL uses Source_apex_name as the LOCAL_MODULE
so that the versioned prebuilt does not get elided from product
packaging.
Test: m nothing --no-skip-soong-tests
Bug: 405153030
Change-Id: I15a6c6d8a3906cced87771ddde05563209c26bc2
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 36a6974..327e018 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -11468,6 +11468,16 @@
// 1. The contents of the selected apex_contributions are visible to make
// 2. The rest of the apexes in the mainline module family (source or other prebuilt) is hidden from make
checkHideFromMake(t, ctx, tc.expectedVisibleModuleName, tc.expectedHiddenModuleNames)
+
+ // Check that source_apex_name is written as LOCAL_MODULE for make packaging
+ if tc.expectedVisibleModuleName == "prebuilt_com.google.android.foo.v2" {
+ apex := ctx.ModuleForTests(t, "prebuilt_com.google.android.foo.v2", "android_common_prebuilt_com.android.foo").Module()
+ entries := android.AndroidMkEntriesForTest(t, ctx, apex)[0]
+
+ expected := "com.google.android.foo"
+ actual := entries.EntryMap["LOCAL_MODULE"][0]
+ android.AssertStringEquals(t, "LOCAL_MODULE", expected, actual)
+ }
}
}