Handle soong config vars for string attrs

Previously if there was a value set outside of product variables and one
inside a conditions default soong config var, we would ignore the
conditions default. Now, we maintain the conditions default and use
the root value in cases where there is not a value for a product
variable.

Test: go test soong tests
Change-Id: Ic991e3aebe5bb6039353f4e3d25625e7c5190f96
This commit is contained in:
Liz Kammer
2022-12-21 14:51:37 -05:00
committed by Sasha Smundak
parent f3963f8b9c
commit 9d2d41065c
4 changed files with 88 additions and 11 deletions

View File

@@ -453,6 +453,14 @@ func (m *customModule) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
}
}
}
productVariableProps := android.ProductVariableProperties(ctx)
if props, ok := productVariableProps["String_literal_prop"]; ok {
for c, p := range props {
if val, ok := p.(*string); ok {
strAttr.SetSelectValue(c.ConfigurationAxis(), c.SelectKey(), val)
}
}
}
paths.ResolveExcludes()