Merge "Use product variables from the overridden apex" am: ae3e4cc2fd

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

Change-Id: I30240a9e42aa4a1ce671af59b2ea05b86c76bee5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Cole Faust
2023-03-09 00:46:44 +00:00
committed by Automerger Merge Worker
7 changed files with 96 additions and 15 deletions

View File

@@ -1334,7 +1334,7 @@ func (attrs *CommonAttributes) fillCommonBp2BuildModuleAttrs(ctx *topDownMutator
// Check product variables for `enabled: true` flag override.
// Returns a list of the constraint_value targets who enable this override.
func productVariableConfigEnableLabels(ctx *topDownMutatorContext) []bazel.Label {
productVariableProps := ProductVariableProperties(ctx)
productVariableProps := ProductVariableProperties(ctx, ctx.Module())
productConfigEnablingTargets := []bazel.Label{}
const propName = "Enabled"
if productConfigProps, exists := productVariableProps[propName]; exists {

View File

@@ -663,9 +663,8 @@ func (p *ProductConfigProperty) SelectKey() string {
type ProductConfigProperties map[string]map[ProductConfigProperty]interface{}
// ProductVariableProperties returns a ProductConfigProperties containing only the properties which
// have been set for the module in the given context.
func ProductVariableProperties(ctx BazelConversionPathContext) ProductConfigProperties {
module := ctx.Module()
// have been set for the given module.
func ProductVariableProperties(ctx ArchVariantContext, module Module) ProductConfigProperties {
moduleBase := module.base()
productConfigProperties := ProductConfigProperties{}