Remove EarlyMutators and DynamicDependencies
EarlyMutators are identical to BottomUpMutators, except they run before
DynamicDependencies. DynamicDependencies can be replaced with a
BottomUpMutator. Replace both EarlyMutators and DynamicDependencies
with BottomUpMutators, which allows setting the order between all
mutators through registration order.
Change-Id: Id1305d798d3d2da592061c89d7c10a71780b71a3
diff --git a/common/module.go b/common/module.go
index d31a9fc..1860ecb 100644
--- a/common/module.go
+++ b/common/module.go
@@ -72,15 +72,6 @@
HostOrDevice() HostOrDevice
}
-type AndroidDynamicDepender interface {
- AndroidDynamicDependencies(ctx AndroidDynamicDependerModuleContext) []string
-}
-
-type AndroidDynamicDependerModuleContext interface {
- blueprint.DynamicDependerModuleContext
- androidBaseContext
-}
-
type commonProperties struct {
Name string
Deps []string
@@ -313,33 +304,20 @@
}
}
-func (a *AndroidModuleBase) DynamicDependencies(ctx blueprint.DynamicDependerModuleContext) []string {
- actx := &androidDynamicDependerContext{
- DynamicDependerModuleContext: ctx,
- androidBaseContextImpl: androidBaseContextImpl{
- arch: a.commonProperties.CompileArch,
- hod: a.commonProperties.CompileHostOrDevice,
- config: ctx.Config().(Config),
- },
+func (a *AndroidModuleBase) androidBaseContextFactory(ctx blueprint.BaseModuleContext) androidBaseContextImpl {
+ return androidBaseContextImpl{
+ arch: a.commonProperties.CompileArch,
+ hod: a.commonProperties.CompileHostOrDevice,
+ config: ctx.Config().(Config),
}
-
- if dynamic, ok := a.module.(AndroidDynamicDepender); ok {
- return dynamic.AndroidDynamicDependencies(actx)
- }
-
- return nil
}
func (a *AndroidModuleBase) GenerateBuildActions(ctx blueprint.ModuleContext) {
androidCtx := &androidModuleContext{
- ModuleContext: ctx,
- androidBaseContextImpl: androidBaseContextImpl{
- arch: a.commonProperties.CompileArch,
- hod: a.commonProperties.CompileHostOrDevice,
- config: ctx.Config().(Config),
- },
- installDeps: a.computeInstallDeps(ctx),
- installFiles: a.installFiles,
+ ModuleContext: ctx,
+ androidBaseContextImpl: a.androidBaseContextFactory(ctx),
+ installDeps: a.computeInstallDeps(ctx),
+ installFiles: a.installFiles,
}
if a.commonProperties.Disabled {
@@ -443,11 +421,6 @@
a.checkbuildFiles = append(a.checkbuildFiles, srcPath)
}
-type androidDynamicDependerContext struct {
- blueprint.DynamicDependerModuleContext
- androidBaseContextImpl
-}
-
type fileInstaller interface {
filesToInstall() []string
}