Merge "Export release flag types to make/soong" into main
This commit is contained in:
@@ -74,3 +74,22 @@ func MarshalValue(value *rc_proto.Value) string {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
// Returns a string representation of the type of the value for make
|
||||
func ValueType(value *rc_proto.Value) string {
|
||||
if value == nil || value.Val == nil {
|
||||
return "unspecified"
|
||||
}
|
||||
switch value.Val.(type) {
|
||||
case *rc_proto.Value_UnspecifiedValue:
|
||||
return "unspecified"
|
||||
case *rc_proto.Value_StringValue:
|
||||
return "string"
|
||||
case *rc_proto.Value_BoolValue:
|
||||
return "bool"
|
||||
case *rc_proto.Value_Obsolete:
|
||||
return "obsolete"
|
||||
default:
|
||||
panic("Unhandled type")
|
||||
}
|
||||
}
|
||||
|
@@ -348,6 +348,7 @@ func (configs *ReleaseConfigs) WriteMakefile(outFile, targetRelease string) erro
|
||||
}
|
||||
value := MarshalValue(flag.Value)
|
||||
makeVars[name] = value
|
||||
addVar(name, "TYPE", ValueType(flag.Value))
|
||||
addVar(name, "PARTITIONS", strings.Join(decl.Containers, " "))
|
||||
addVar(name, "DEFAULT", MarshalValue(decl.Value))
|
||||
addVar(name, "VALUE", value)
|
||||
@@ -356,7 +357,7 @@ func (configs *ReleaseConfigs) WriteMakefile(outFile, targetRelease string) erro
|
||||
addVar(name, "NAMESPACE", *decl.Namespace)
|
||||
}
|
||||
pNames := []string{}
|
||||
for k, _ := range partitions {
|
||||
for k := range partitions {
|
||||
pNames = append(pNames, k)
|
||||
}
|
||||
slices.SortFunc(pNames, func(a, b string) int {
|
||||
|
Reference in New Issue
Block a user