Read ApexMkInfo for modules to be installed.

This piggybacks onto the ApexInfo cquery handler, so we're issuing a
single bazel query call that reads two providers in the starlark expr.

Also rename requiredDeps to makeModulesToInstall to differentiate it from
APEX's required/provided libs in the apex manifest.

Test: unit test
Test: mkdiff
Fixes: 263123189
Change-Id: Ib7e43f1586f29864eee8627dba3631bfaff27afa
This commit is contained in:
Jingwen Chen
2023-01-25 17:49:46 +00:00
parent 6cf5e0d9cb
commit 29743c8423
8 changed files with 56 additions and 25 deletions

View File

@@ -5713,7 +5713,7 @@ func TestInstallExtraFlattenedApexes(t *testing.T) {
}),
)
ab := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle)
ensureListContains(t, ab.requiredDeps, "myapex.flattened")
ensureListContains(t, ab.makeModulesToInstall, "myapex.flattened")
mk := android.AndroidMkDataForTest(t, ctx, ab)
var builder strings.Builder
mk.Custom(&builder, ab.Name(), "TARGET_", "", mk)
@@ -9290,7 +9290,7 @@ func TestAndroidMk_RequiredDeps(t *testing.T) {
`)
bundle := ctx.ModuleForTests("myapex", "android_common_myapex_image").Module().(*apexBundle)
bundle.requiredDeps = append(bundle.requiredDeps, "foo")
bundle.makeModulesToInstall = append(bundle.makeModulesToInstall, "foo")
data := android.AndroidMkDataForTest(t, ctx, bundle)
var builder strings.Builder
data.Custom(&builder, bundle.BaseModuleName(), "TARGET_", "", data)
@@ -9298,7 +9298,7 @@ func TestAndroidMk_RequiredDeps(t *testing.T) {
ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES := foo\n")
flattenedBundle := ctx.ModuleForTests("myapex", "android_common_myapex_flattened").Module().(*apexBundle)
flattenedBundle.requiredDeps = append(flattenedBundle.requiredDeps, "foo")
flattenedBundle.makeModulesToInstall = append(flattenedBundle.makeModulesToInstall, "foo")
flattenedData := android.AndroidMkDataForTest(t, ctx, flattenedBundle)
var flattenedBuilder strings.Builder
flattenedData.Custom(&flattenedBuilder, flattenedBundle.BaseModuleName(), "TARGET_", "", flattenedData)
@@ -9542,7 +9542,7 @@ func TestSdkLibraryCanHaveHigherMinSdkVersion(t *testing.T) {
func ensureContainsRequiredDeps(t *testing.T, ctx *android.TestContext, moduleName, variant string, deps []string) {
a := ctx.ModuleForTests(moduleName, variant).Module().(*apexBundle)
for _, dep := range deps {
android.AssertStringListContains(t, "", a.requiredDeps, dep)
android.AssertStringListContains(t, "", a.makeModulesToInstall, dep)
}
}
@@ -9550,7 +9550,7 @@ func ensureContainsRequiredDeps(t *testing.T, ctx *android.TestContext, moduleNa
func ensureDoesNotContainRequiredDeps(t *testing.T, ctx *android.TestContext, moduleName, variant string, deps []string) {
a := ctx.ModuleForTests(moduleName, variant).Module().(*apexBundle)
for _, dep := range deps {
android.AssertStringListDoesNotContain(t, "", a.requiredDeps, dep)
android.AssertStringListDoesNotContain(t, "", a.makeModulesToInstall, dep)
}
}