Merge "Drop "prebuilt_" prefixes from names registered in ApexInfo.InApexXxx." am: 664b2cf89a

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

Change-Id: I70f730acbbb9123146c2753a3cd06325d19030dd
This commit is contained in:
Martin Stjernholm 2021-05-27 09:48:22 +00:00 committed by Automerger Merge Worker
commit 5eb4b21deb
3 changed files with 5 additions and 17 deletions

View file

@ -117,19 +117,6 @@ func (i ApexInfo) InApexVariant(apexVariant string) bool {
return false
}
// InApexByBaseName tells whether this apex variant of the module is part of the given apexVariant
// or not, where the APEX is specified by its canonical base name, i.e. typically beginning with
// "com.android.". In particular this function doesn't differentiate between source and prebuilt
// APEXes, where the latter may have "prebuilt_" prefixes.
func (i ApexInfo) InApexVariantByBaseName(apexVariant string) bool {
for _, a := range i.InApexVariants {
if RemoveOptionalPrebuiltPrefix(a) == apexVariant {
return true
}
}
return false
}
func (i ApexInfo) InApexModule(apexModuleName string) bool {
for _, a := range i.InApexModules {
if a == apexModuleName {

View file

@ -228,10 +228,11 @@ func (p *prebuiltCommon) apexInfoMutator(mctx android.TopDownMutatorContext) {
})
// Create an ApexInfo for the prebuilt_apex.
apexVariationName := android.RemoveOptionalPrebuiltPrefix(mctx.ModuleName())
apexInfo := android.ApexInfo{
ApexVariationName: android.RemoveOptionalPrebuiltPrefix(mctx.ModuleName()),
InApexVariants: []string{mctx.ModuleName()},
InApexModules: []string{mctx.ModuleName()},
ApexVariationName: apexVariationName,
InApexVariants: []string{apexVariationName},
InApexModules: []string{apexVariationName},
ApexContents: []*android.ApexContents{apexContents},
ForPrebuiltApex: true,
}

View file

@ -171,7 +171,7 @@ func isModuleInConfiguredList(ctx android.BaseModuleContext, module android.Modu
// A platform variant is required but this is for an apex so ignore it.
return false
}
} else if !apexInfo.InApexVariantByBaseName(requiredApex) {
} else if !apexInfo.InApexVariant(requiredApex) {
// An apex variant for a specific apex is required but this is the wrong apex.
return false
}