summaryrefslogtreecommitdiff
path: root/android/sdk.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2020-03-09 20:23:15 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-03-09 20:23:15 +0000
commita81668628e7ccda49291c4b4779b02f4772affe2 (patch)
tree9234818cbe4c704435f4b490d8bc22a843e31ef9 /android/sdk.go
parenta8e37b98bba2a8bf61d01b20994ced119a0387be (diff)
parenta04c107bfaf9262daafecc9174bd9e85b79264bd (diff)
Merge "Add support for multiple os types"
Diffstat (limited to 'android/sdk.go')
-rw-r--r--android/sdk.go21
1 files changed, 20 insertions, 1 deletions
diff --git a/android/sdk.go b/android/sdk.go
index f28c39215..969e21adb 100644
--- a/android/sdk.go
+++ b/android/sdk.go
@@ -448,10 +448,29 @@ func RegisterSdkMemberType(memberType SdkMemberType) {
// Base structure for all implementations of SdkMemberProperties.
//
-// Contains common properties that apply across many different member types.
+// Contains common properties that apply across many different member types. These
+// are not affected by the optimization to extract common values.
type SdkMemberPropertiesBase struct {
// The setting to use for the compile_multilib property.
Compile_multilib string
+
+ // The number of unique os types supported by the member variants.
+ Os_count int
+
+ // The os type for which these properties refer.
+ Os OsType
+}
+
+// The os prefix to use for any file paths in the sdk.
+//
+// Is an empty string if the member only provides variants for a single os type, otherwise
+// is the OsType.Name.
+func (b *SdkMemberPropertiesBase) OsPrefix() string {
+ if b.Os_count == 1 {
+ return ""
+ } else {
+ return b.Os.Name
+ }
}
func (b *SdkMemberPropertiesBase) Base() *SdkMemberPropertiesBase {