Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbb49035 authored by Paul Duffin's avatar Paul Duffin Committed by Gerrit Code Review
Browse files

Merge "Make all SdkMemberTypes support transitive member deps"

parents e746f30a 2d3da31d
Loading
Loading
Loading
Loading
+4 −18
Original line number Diff line number Diff line
@@ -302,9 +302,7 @@ type SdkMember interface {
}

// SdkMemberTypeDependencyTag is the interface that a tag must implement in order to allow the
// dependent module to be automatically added to the sdk. In order for this to work the
// SdkMemberType of the depending module must return true from
// SdkMemberType.HasTransitiveSdkMembers.
// dependent module to be automatically added to the sdk.
type SdkMemberTypeDependencyTag interface {
	blueprint.DependencyTag

@@ -385,13 +383,6 @@ type SdkMemberType interface {
	// True if the member type supports the sdk/sdk_snapshot, false otherwise.
	UsableWithSdkAndSdkSnapshot() bool

	// Return true if modules of this type can have dependencies which should be
	// treated as if they are sdk members.
	//
	// Any dependency that is to be treated as a member of the sdk needs to implement
	// SdkAware and be added with an SdkMemberTypeDependencyTag tag.
	HasTransitiveSdkMembers() bool

	// Return true if prebuilt host artifacts may be specific to the host OS. Only
	// applicable to modules where HostSupported() is true. If this is true,
	// snapshots will list each host OS variant explicitly and disable all other
@@ -459,7 +450,6 @@ type SdkMemberType interface {
type SdkMemberTypeBase struct {
	PropertyName    string
	SupportsSdk     bool
	TransitiveSdkMembers bool
	HostOsDependent bool
}

@@ -471,10 +461,6 @@ func (b *SdkMemberTypeBase) UsableWithSdkAndSdkSnapshot() bool {
	return b.SupportsSdk
}

func (b *SdkMemberTypeBase) HasTransitiveSdkMembers() bool {
	return b.TransitiveSdkMembers
}

func (b *SdkMemberTypeBase) IsHostOsDependent() bool {
	return b.HostOsDependent
}
+2 −3
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ func init() {
		SdkMemberTypeBase: android.SdkMemberTypeBase{
			PropertyName: "bootclasspath_fragments",
			SupportsSdk:  true,
			TransitiveSdkMembers: true,
		},
	})
}
+2 −3
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ func init() {
		android.SdkMemberTypeBase{
			PropertyName: "java_system_modules",
			SupportsSdk:  true,
			TransitiveSdkMembers: true,
		},
	})
}
+3 −3
Original line number Diff line number Diff line
@@ -133,9 +133,9 @@ func (s *sdk) collectMembers(ctx android.ModuleContext) {
			export := memberTag.ExportMember()
			s.memberVariantDeps = append(s.memberVariantDeps, sdkMemberVariantDep{s, memberType, child.(android.SdkAware), export})

			// If the member type supports transitive sdk members then recurse down into
			// its dependencies, otherwise exit traversal.
			return memberType.HasTransitiveSdkMembers()
			// Recurse down into the member's dependencies as it may have dependencies that need to be
			// automatically added to the sdk.
			return true
		}

		return false