diff options
Diffstat (limited to 'android/sdk.go')
-rw-r--r-- | android/sdk.go | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/android/sdk.go b/android/sdk.go index 1d63d7a94..2dc0bd7f3 100644 --- a/android/sdk.go +++ b/android/sdk.go @@ -23,24 +23,8 @@ import ( "github.com/google/blueprint/proptools" ) -// RequiredSdks provides access to the set of SDKs required by an APEX and its contents. -// -// Extracted from SdkAware to make it easier to define custom subsets of the -// SdkAware interface and improve code navigation within the IDE. -// -// In addition to its use in SdkAware this interface must also be implemented by -// APEX to specify the SDKs required by that module and its contents. e.g. APEX -// is expected to implement RequiredSdks() by reading its own properties like -// `uses_sdks`. -type RequiredSdks interface { - // RequiredSdks returns the set of SDKs required by an APEX and its contents. - RequiredSdks() SdkRefs -} - // sdkAwareWithoutModule is provided simply to improve code navigation with the IDE. type sdkAwareWithoutModule interface { - RequiredSdks - // SdkMemberComponentName will return the name to use for a component of this module based on the // base name of this module. // @@ -81,7 +65,6 @@ type sdkAwareWithoutModule interface { ContainingSdk() SdkRef MemberName() string - BuildWithSdks(sdks SdkRefs) } // SdkAware is the interface that must be supported by any module to become a member of SDK or to be @@ -150,9 +133,6 @@ type sdkProperties struct { // The SDK that this module is a member of. nil if it is not a member of any SDK ContainingSdk *SdkRef `blueprint:"mutated"` - // The list of SDK names and versions that are used to build this module - RequiredSdks SdkRefs `blueprint:"mutated"` - // Name of the module that this sdk member is representing Sdk_member_name *string } @@ -208,16 +188,6 @@ func (s *SdkBase) MemberName() string { return proptools.String(s.properties.Sdk_member_name) } -// BuildWithSdks is used to mark that this module has to be built with the given SDK(s). -func (s *SdkBase) BuildWithSdks(sdks SdkRefs) { - s.properties.RequiredSdks = sdks -} - -// RequiredSdks returns the SDK(s) that this module has to be built with -func (s *SdkBase) RequiredSdks() SdkRefs { - return s.properties.RequiredSdks -} - // InitSdkAwareModule initializes the SdkBase struct. This must be called by all modules including // SdkBase. func InitSdkAwareModule(m SdkAware) { @@ -700,6 +670,9 @@ type SdkMemberType interface { // host OS variant explicitly and disable all other host OS'es. IsHostOsDependent() bool + // SupportedLinkages returns the names of the linkage variants supported by this module. + SupportedLinkages() []string + // AddDependencies adds dependencies from the SDK module to all the module variants the member // type contributes to the SDK. `names` is the list of module names given in the member type // property (as returned by SdkPropertyName()) in the SDK module. The exact set of variants @@ -763,6 +736,9 @@ type SdkMemberType interface { // SupportedTraits returns the set of traits supported by this member type. SupportedTraits() SdkMemberTraitSet + + // Overrides returns whether type overrides other SdkMemberType + Overrides(SdkMemberType) bool } var _ sdkRegisterable = (SdkMemberType)(nil) @@ -786,6 +762,13 @@ type SdkDependencyContext interface { type SdkMemberTypeBase struct { PropertyName string + // Property names that this SdkMemberTypeBase can override, this is useful when a module type is a + // superset of another module type. + OverridesPropertyNames map[string]bool + + // The names of linkage variants supported by this module. + SupportedLinkageNames []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 @@ -826,6 +809,14 @@ func (b *SdkMemberTypeBase) SupportedTraits() SdkMemberTraitSet { return NewSdkMemberTraitSet(b.Traits) } +func (b *SdkMemberTypeBase) Overrides(other SdkMemberType) bool { + return b.OverridesPropertyNames[other.SdkPropertyName()] +} + +func (b *SdkMemberTypeBase) SupportedLinkages() []string { + return b.SupportedLinkageNames +} + // registeredModuleExportsMemberTypes is the set of registered SdkMemberTypes for module_exports // modules. var registeredModuleExportsMemberTypes = &sdkRegistry{} @@ -991,3 +982,10 @@ type ExportedComponentsInfo struct { } var ExportedComponentsInfoProvider = blueprint.NewProvider(ExportedComponentsInfo{}) + +// AdditionalSdkInfo contains additional properties to add to the generated SDK info file. +type AdditionalSdkInfo struct { + Properties map[string]interface{} +} + +var AdditionalSdkInfoProvider = blueprint.NewProvider(AdditionalSdkInfo{}) |