diff --git a/android/module.go b/android/module.go index 9afc8a7c3..5e134b6e9 100644 --- a/android/module.go +++ b/android/module.go @@ -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 { diff --git a/android/mutator.go b/android/mutator.go index 66a1bad13..b485940ef 100644 --- a/android/mutator.go +++ b/android/mutator.go @@ -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 {