Merge "Keep replace_instead_of_append in arch prop structs" into main am: 703248196c

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

Change-Id: I9d2a9af1e5a8607b07529b9445dd5b21a0041b05
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Cole Faust
2024-04-24 22:11:41 +00:00
committed by Automerger Merge Worker

View File

@@ -975,12 +975,18 @@ func filterArchStruct(field reflect.StructField, prefix string) (bool, reflect.S
panic(fmt.Errorf("unexpected tag format %q", field.Tag))
}
// these tags don't need to be present in the runtime generated struct type.
values = RemoveListFromList(values, []string{"arch_variant", "variant_prepend", "path", "replace_instead_of_append"})
// However replace_instead_of_append does, because it's read by the blueprint
// property extending util functions, which can operate on these generated arch
// property structs.
values = RemoveListFromList(values, []string{"arch_variant", "variant_prepend", "path"})
if len(values) > 0 {
if values[0] != "replace_instead_of_append" || len(values) > 1 {
panic(fmt.Errorf("unknown tags %q in field %q", values, prefix+field.Name))
}
field.Tag = `android:"replace_instead_of_append"`
} else {
field.Tag = ``
}
return true, field
}
return false, field