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/genrule/genrule.go b/genrule/genrule.go
index a5a4c71..fb0dafc 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -27,6 +27,8 @@
func init() {
soong.RegisterModuleType("gensrcs", GenSrcsFactory)
soong.RegisterModuleType("genrule", GenRuleFactory)
+
+ common.RegisterBottomUpMutator("genrule_deps", genruleDepsMutator)
}
var (
@@ -83,12 +85,13 @@
return g.outputFiles
}
-func (g *generator) AndroidDynamicDependencies(ctx common.AndroidDynamicDependerModuleContext) []string {
- if g.properties.Tool != "" {
- ctx.AddFarVariationDependencies([]blueprint.Variation{{"hostordevice", common.Host.String()}},
- g.properties.Tool)
+func genruleDepsMutator(ctx common.AndroidBottomUpMutatorContext) {
+ if g, ok := ctx.Module().(*generator); ok {
+ if g.properties.Tool != "" {
+ ctx.AddFarVariationDependencies([]blueprint.Variation{{"hostordevice", common.Host.String()}},
+ g.properties.Tool)
+ }
}
- return nil
}
func (g *generator) GenerateAndroidBuildActions(ctx common.AndroidModuleContext) {