Merge changes I4a5ea40c,I40ab16e3 am: 2f26595072 am: cc1961d51d

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

Change-Id: I4f1af9e641322edc52dd60206168e43c28d44d3e
This commit is contained in:
Liz Kammer
2021-06-07 17:18:03 +00:00
committed by Automerger Merge Worker
7 changed files with 388 additions and 81 deletions

View File

@@ -459,12 +459,13 @@ type ProductConfigContext interface {
// with the appropriate ProductConfigVariable.
type ProductConfigProperty struct {
ProductConfigVariable string
FullConfig string
Property interface{}
}
// ProductConfigProperties is a map of property name to a slice of ProductConfigProperty such that
// all it all product variable-specific versions of a property are easily accessed together
type ProductConfigProperties map[string][]ProductConfigProperty
type ProductConfigProperties map[string]map[string]ProductConfigProperty
// ProductVariableProperties returns a ProductConfigProperties containing only the properties which
// have been set for the module in the given context.
@@ -513,11 +514,15 @@ func productVariableValues(variableProps interface{}, suffix string, productConf
// e.g. Asflags, Cflags, Enabled, etc.
propertyName := variableValue.Type().Field(j).Name
(*productConfigProperties)[propertyName] = append((*productConfigProperties)[propertyName],
ProductConfigProperty{
ProductConfigVariable: productVariableName + suffix,
Property: property.Interface(),
})
if (*productConfigProperties)[propertyName] == nil {
(*productConfigProperties)[propertyName] = make(map[string]ProductConfigProperty)
}
config := productVariableName + suffix
(*productConfigProperties)[propertyName][config] = ProductConfigProperty{
ProductConfigVariable: productVariableName,
FullConfig: config,
Property: property.Interface(),
}
}
}
}