Refactor SdkMemberType.AddDependencies()

Replaces the BottomUpMutatorContext parameter with a new
SdkDependencyContext type that extends BottomUpMutatorContext. This is
to allow the sdk to pass additional information to the implementations
of that method to allow the behavior to be more finely tuned.

Bug: 195754365
Test: m nothing
Change-Id: I69c6d2c523934eb67d7a7e6c55c241e9b8a81773
This commit is contained in:
Paul Duffin
2021-07-14 10:29:36 +01:00
parent 45de13f93d
commit 296701e35b
10 changed files with 46 additions and 26 deletions

View File

@@ -475,7 +475,7 @@ type SdkMemberType interface {
// properties. The dependencies must be added with the supplied tag.
//
// The BottomUpMutatorContext provided is for the SDK module.
AddDependencies(mctx BottomUpMutatorContext, dependencyTag blueprint.DependencyTag, names []string)
AddDependencies(ctx SdkDependencyContext, dependencyTag blueprint.DependencyTag, names []string)
// Return true if the supplied module is an instance of this member type.
//
@@ -529,6 +529,12 @@ type SdkMemberType interface {
CreateVariantPropertiesStruct() SdkMemberProperties
}
// SdkDependencyContext provides access to information needed by the SdkMemberType.AddDependencies()
// implementations.
type SdkDependencyContext interface {
BottomUpMutatorContext
}
// Base type for SdkMemberType implementations.
type SdkMemberTypeBase struct {
PropertyName string