Make sdkMemberDependencyTag usable outside sdk package

Moves the struct to android/sdk.go and abstracts it behind a factory
method and interface. That allows it to be used outside the sdk
package.

This change is in preparation for adding support for module types that
have transitive sdk members.

Bug: 142940300
Test: m nothing
Change-Id: I71e5e0adf839b28a3a0952f82637637887f02688
This commit is contained in:
Paul Duffin
2019-11-19 19:44:10 +00:00
parent 5b511a200e
commit f8539922d4
3 changed files with 23 additions and 11 deletions

View File

@@ -113,8 +113,8 @@ func (s *sdk) collectMembers(ctx android.ModuleContext) []*sdkMember {
ctx.VisitDirectDeps(func(m android.Module) {
tag := ctx.OtherModuleDependencyTag(m)
if memberTag, ok := tag.(*sdkMemberDependencyTag); ok {
memberType := memberTag.memberType
if memberTag, ok := tag.(android.SdkMemberTypeDependencyTag); ok {
memberType := memberTag.SdkMemberType()
// Make sure that the resolved module is allowed in the member list property.
if !memberType.IsInstance(m) {