summaryrefslogtreecommitdiff
path: root/android/sdk.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2022-09-22 16:21:54 +0100
committer Paul Duffin <paulduffin@google.com> 2022-09-26 18:28:56 +0100
commitbfdca968288c930a8d717ceb76349c19bef42fd1 (patch)
treede6b7ecd2dad4ee5657e4b5f53bdf1b9bd234c08 /android/sdk.go
parent02e25c85eb32c337b3f8a2033c6c092b8fea91d3 (diff)
Add sdk:"keep" tag support
Fields tagged with `sdk:"keep"` will keep the value even if it would normally be cleared because it was common across a number of structs. This will allow a module type to specify the same value across all structs populated directly from variants and have it be copied into all common property structs without clearing it from the variant specific structs. Bug: 248258460 Test: m nothing Change-Id: I147d946b11fd8766a7d875d9206e8f5034f585d6
Diffstat (limited to 'android/sdk.go')
-rw-r--r--android/sdk.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/android/sdk.go b/android/sdk.go
index 42f95b76c..bd2f5d13f 100644
--- a/android/sdk.go
+++ b/android/sdk.go
@@ -738,6 +738,11 @@ type SdkMemberType interface {
// A field annotated with a tag of `sdk:"ignore"` will be treated as if it
// was not capitalized, i.e. ignored and not optimized for common values.
//
+ // A field annotated with a tag of `sdk:"keep"` will not be cleared even if the value is common
+ // across multiple structs. Common values will still be copied into the common property struct.
+ // So, if the same value is placed in all structs populated from variants that value would be
+ // copied into all common property structs and so be available in every instance.
+ //
// A field annotated with a tag of `android:"arch_variant"` will be allowed to have
// values that differ by arch, fields not tagged as such must have common values across
// all variants.