From b9a83f1de48de2520b00611c7cf0c373d8f714b9 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Thu, 20 Mar 2025 23:35:47 +0000 Subject: 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 --- apex/apex_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apex/apex_test.go') diff --git a/apex/apex_test.go b/apex/apex_test.go index 36a697487..327e018f4 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -11468,6 +11468,16 @@ func TestInstallationRulesForMultipleApexPrebuilts(t *testing.T) { // 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) + } } } -- cgit v1.2.3-59-g8ed1b