Handle arch/os-specific product variables

Bug: 183595873
Test: go test bp2build tests
Change-Id: I36e93ae1eb2943555dd304d5bdf62d995e77b437
This commit is contained in:
Liz Kammer
2021-05-10 11:39:53 -04:00
parent 6fd7b3fee9
commit e3e4a5f2d8
4 changed files with 107 additions and 10 deletions

View File

@@ -563,6 +563,12 @@ func (attrs *StringListAttribute) SetValueForOS(os string, value []string) {
*v = value
}
func (attrs *StringListAttribute) SortedProductVariables() []ProductVariableValues {
vals := attrs.ProductValues[:]
sort.Slice(vals, func(i, j int) bool { return vals[i].ProductVariable < vals[j].ProductVariable })
return vals
}
// Append appends all values, including os and arch specific ones, from another
// StringListAttribute to this StringListAttribute
func (attrs *StringListAttribute) Append(other StringListAttribute) {