summaryrefslogtreecommitdiff
path: root/android/sdk.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-05-11 00:31:38 +0100
committer Paul Duffin <paulduffin@google.com> 2021-05-11 01:00:06 +0100
commit1308205638c6c345b0ac6d993211b4b87f8d43cb (patch)
tree077e17d6baddf41c4a093ba64e87c39539b6fe7f /android/sdk.go
parent0d4ed0ac56b475cf0b820ecdc8431fdef2367adb (diff)
Allow an sdk member type not to provide a bp property
Bug: 181569894 Test: m nothing Change-Id: I7e98f14cb377683457fba32fd05d6c614f78ffeb
Diffstat (limited to 'android/sdk.go')
-rw-r--r--android/sdk.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/android/sdk.go b/android/sdk.go
index 2e057d9b7..048a36cd0 100644
--- a/android/sdk.go
+++ b/android/sdk.go
@@ -380,6 +380,10 @@ type SdkMemberType interface {
// The name of the member type property on an sdk module.
SdkPropertyName() string
+ // RequiresBpProperty returns true if this member type requires its property to be usable within
+ // an Android.bp file.
+ RequiresBpProperty() bool
+
// True if the member type supports the sdk/sdk_snapshot, false otherwise.
UsableWithSdkAndSdkSnapshot() bool
@@ -452,7 +456,12 @@ type SdkMemberType interface {
// Base type for SdkMemberType implementations.
type SdkMemberTypeBase struct {
- PropertyName string
+ PropertyName string
+
+ // When set to true BpPropertyNotRequired indicates that the member type does not require the
+ // property to be specifiable in an Android.bp file.
+ BpPropertyNotRequired bool
+
SupportsSdk bool
HostOsDependent bool
@@ -466,6 +475,10 @@ func (b *SdkMemberTypeBase) SdkPropertyName() string {
return b.PropertyName
}
+func (b *SdkMemberTypeBase) RequiresBpProperty() bool {
+ return !b.BpPropertyNotRequired
+}
+
func (b *SdkMemberTypeBase) UsableWithSdkAndSdkSnapshot() bool {
return b.SupportsSdk
}