Merge "Contents validation of override_apex's bootclasspath fragments" into main am: 39d61f53ff am: 8bd23c11bd

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241777

Change-Id: I5c0904ecd2136cde891f6f3144c679f07d711e86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Spandan Das
2024-08-27 20:47:57 +00:00
committed by Automerger Merge Worker
2 changed files with 132 additions and 6 deletions

View File

@@ -210,15 +210,19 @@ func disableSourceApexVariant(ctx android.BaseModuleContext) bool {
}
})
// Find the apex variant for this module
_, apexVariantsWithoutTestApexes, _ := android.ListSetDifference(apexInfo.InApexVariants, apexInfo.TestApexes)
var apexVariantsWithoutTestApexes []string
if apexInfo.BaseApexName != "" {
// This is a transitive dependency of an override_apex
apexVariantsWithoutTestApexes = []string{apexInfo.BaseApexName}
} else {
_, apexVariantsWithoutTestApexes, _ = android.ListSetDifference(apexInfo.InApexVariants, apexInfo.TestApexes)
}
disableSource := false
// find the selected apexes
for _, apexVariant := range apexVariantsWithoutTestApexes {
for _, selected := range psi.GetSelectedModulesForApiDomain(apexVariant) {
// If the apex_contribution for this api domain contains a prebuilt apex, disable the source variant
if strings.HasPrefix(selected, "prebuilt_com.google.android") {
disableSource = true
}
if len(psi.GetSelectedModulesForApiDomain(apexVariant)) > 0 {
// If the apex_contribution for this api domain is non-empty, disable the source variant
disableSource = true
}
}
return disableSource