Add RELEASE_ACONFIG_EXTRA_RELEASE_CONFIGS

This build flag causes us to create aconfig flag artifacts for the
given extra release configs.

Bug: 298444886
Test: manual
Change-Id: I10148f6e7318b0477438ed1d8baafbf4dc594c90
This commit is contained in:
LaMont Jones
2024-06-11 11:28:54 -07:00
parent ecdb25e674
commit 21d04d99c8
8 changed files with 390 additions and 103 deletions

View File

@@ -198,6 +198,33 @@ func (c Config) ReleaseAconfigValueSets() []string {
return c.config.productVariables.ReleaseAconfigValueSets
}
func (c Config) ReleaseAconfigExtraReleaseConfigs() []string {
result := []string{}
if val, ok := c.config.productVariables.BuildFlags["RELEASE_ACONFIG_EXTRA_RELEASE_CONFIGS"]; ok {
if len(val) > 0 {
// Remove any duplicates from the list.
found := make(map[string]bool)
for _, k := range strings.Split(val, " ") {
if !found[k] {
found[k] = true
result = append(result, k)
}
}
}
}
return result
}
func (c Config) ReleaseAconfigExtraReleaseConfigsValueSets() map[string][]string {
result := make(map[string][]string)
for _, rcName := range c.ReleaseAconfigExtraReleaseConfigs() {
if value, ok := c.config.productVariables.BuildFlags["RELEASE_ACONFIG_VALUE_SETS_"+rcName]; ok {
result[rcName] = strings.Split(value, " ")
}
}
return result
}
// The flag default permission value passed to aconfig
// derived from RELEASE_ACONFIG_FLAG_DEFAULT_PERMISSION
func (c Config) ReleaseAconfigFlagDefaultPermission() string {