Make android.ModuleContext not include blueprint.ModuleContext

android.ModuleContext should replace the blueprint.ModuleContext
methods with ones that take android.Module parameters instead of
blueprint.Module parameters.  As a first step, don't include
blueprint.ModuleContext in android.ModuleContext and manually
specify the methods from blueprint.ModuleContext that we need.
Future patches will replace these methods with ones that take
android.* types.  Also do the same for TopDownMutatorContext.

Test: m checkbuild
Change-Id: If11c298eed98bc65712b4942d0283cafa058726c
This commit is contained in:
Colin Cross
2017-10-23 17:10:29 -07:00
parent 0d3f8c0db6
commit 3f68a1362b
2 changed files with 49 additions and 2 deletions

View File

@@ -72,8 +72,8 @@ type BaseContext interface {
}
type ModuleContext interface {
blueprint.ModuleContext
androidBaseContext
blueprint.BaseModuleContext
// Similar to Build, but takes Paths instead of []string,
// and performs more verification.
@@ -94,6 +94,34 @@ type ModuleContext interface {
InstallInSanitizerDir() bool
RequiredModuleNames() []string
// android.ModuleContext methods
// These are duplicated instead of embedded so that can eventually be wrapped to take an
// android.Module instead of a blueprint.Module
OtherModuleName(m blueprint.Module) string
OtherModuleErrorf(m blueprint.Module, fmt string, args ...interface{})
OtherModuleDependencyTag(m blueprint.Module) blueprint.DependencyTag
GetDirectDepWithTag(name string, tag blueprint.DependencyTag) blueprint.Module
GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag)
ModuleSubDir() string
VisitDirectDeps(visit func(blueprint.Module))
VisitDirectDepsIf(pred func(blueprint.Module) bool, visit func(blueprint.Module))
VisitDepsDepthFirst(visit func(blueprint.Module))
VisitDepsDepthFirstIf(pred func(blueprint.Module) bool, visit func(blueprint.Module))
WalkDeps(visit func(blueprint.Module, blueprint.Module) bool)
Variable(pctx blueprint.PackageContext, name, value string)
Rule(pctx blueprint.PackageContext, name string, params blueprint.RuleParams, argNames ...string) blueprint.Rule
Build(pctx blueprint.PackageContext, params blueprint.BuildParams)
PrimaryModule() blueprint.Module
FinalModule() blueprint.Module
VisitAllModuleVariants(visit func(blueprint.Module))
GetMissingDependencies() []string
}
type Module interface {

View File

@@ -107,8 +107,27 @@ func PostDepsMutators(f RegisterMutatorFunc) {
type AndroidTopDownMutator func(TopDownMutatorContext)
type TopDownMutatorContext interface {
blueprint.TopDownMutatorContext
blueprint.BaseModuleContext
androidBaseContext
OtherModuleExists(name string) bool
Rename(name string)
Module() blueprint.Module
OtherModuleName(m blueprint.Module) string
OtherModuleErrorf(m blueprint.Module, fmt string, args ...interface{})
OtherModuleDependencyTag(m blueprint.Module) blueprint.DependencyTag
CreateModule(blueprint.ModuleFactory, ...interface{})
GetDirectDepWithTag(name string, tag blueprint.DependencyTag) blueprint.Module
GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag)
VisitDirectDeps(visit func(blueprint.Module))
VisitDirectDepsIf(pred func(blueprint.Module) bool, visit func(blueprint.Module))
VisitDepsDepthFirst(visit func(blueprint.Module))
VisitDepsDepthFirstIf(pred func(blueprint.Module) bool, visit func(blueprint.Module))
WalkDeps(visit func(blueprint.Module, blueprint.Module) bool)
}
type androidTopDownMutatorContext struct {