Check for product variant in addition to core variant.
It's possible that a module will have a product variant but not a core variant. In that case, we still need to apply the vendor suffix to the androidmk module name. Bug: 188720375 Bug: 187963715 Test: Build vendor image using vendor snapshot. Change-Id: I190fdd707ca23357d1c324c1b1f3318457625f03 Merged-In: I190fdd707ca23357d1c324c1b1f3318457625f03 (cherry picked from commit 4016d7b53e70bdf53dfdc93c8a7969f70fe2eb05)
This commit is contained in:
parent
a46656213e
commit
8f37844151
|
@ -454,13 +454,30 @@ func (p *baseSnapshotDecorator) snapshotAndroidMkSuffix() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *baseSnapshotDecorator) setSnapshotAndroidMkSuffix(ctx android.ModuleContext) {
|
func (p *baseSnapshotDecorator) setSnapshotAndroidMkSuffix(ctx android.ModuleContext) {
|
||||||
if ctx.OtherModuleDependencyVariantExists([]blueprint.Variation{
|
coreVariations := append(ctx.Target().Variations(), blueprint.Variation{
|
||||||
{Mutator: "image", Variation: android.CoreVariation},
|
Mutator: "image",
|
||||||
}, ctx.Module().(*Module).BaseModuleName()) {
|
Variation: android.CoreVariation})
|
||||||
|
|
||||||
|
if ctx.OtherModuleFarDependencyVariantExists(coreVariations, ctx.Module().(*Module).BaseModuleName()) {
|
||||||
p.baseProperties.Androidmk_suffix = p.image.moduleNameSuffix()
|
p.baseProperties.Androidmk_suffix = p.image.moduleNameSuffix()
|
||||||
} else {
|
return
|
||||||
p.baseProperties.Androidmk_suffix = ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there is no matching core variation, there could still be a
|
||||||
|
// product variation, for example if a module is product specific and
|
||||||
|
// vendor available. In that case, we also want to add the androidmk
|
||||||
|
// suffix.
|
||||||
|
|
||||||
|
productVariations := append(ctx.Target().Variations(), blueprint.Variation{
|
||||||
|
Mutator: "image",
|
||||||
|
Variation: ProductVariationPrefix + ctx.DeviceConfig().PlatformVndkVersion()})
|
||||||
|
|
||||||
|
if ctx.OtherModuleFarDependencyVariantExists(productVariations, ctx.Module().(*Module).BaseModuleName()) {
|
||||||
|
p.baseProperties.Androidmk_suffix = p.image.moduleNameSuffix()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
p.baseProperties.Androidmk_suffix = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call this with a module suffix after creating a snapshot module, such as
|
// Call this with a module suffix after creating a snapshot module, such as
|
||||||
|
|
Loading…
Reference in New Issue