diff options
author | Colin Cross <ccross@android.com> | 2015-10-29 15:25:03 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2015-11-03 15:46:08 -0800 |
commit | 6362e278481ea0cb14d31cd7fd3760116b6d7643 (patch) | |
tree | 16221aa2499c2e6ec896c3a87645b441a57c07e8 /genrule | |
parent | 06a931bdb6228bdbe425696b01e27522f4b00d71 (diff) | |
download | build_soong-6362e278481ea0cb14d31cd7fd3760116b6d7643.tar.gz build_soong-6362e278481ea0cb14d31cd7fd3760116b6d7643.tar.bz2 build_soong-6362e278481ea0cb14d31cd7fd3760116b6d7643.zip |
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
Diffstat (limited to 'genrule')
-rw-r--r-- | genrule/genrule.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/genrule/genrule.go b/genrule/genrule.go index a5a4c71f..fb0dafcf 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go @@ -27,6 +27,8 @@ import ( func init() { soong.RegisterModuleType("gensrcs", GenSrcsFactory) soong.RegisterModuleType("genrule", GenRuleFactory) + + common.RegisterBottomUpMutator("genrule_deps", genruleDepsMutator) } var ( @@ -83,12 +85,13 @@ func (g *generator) GeneratedSourceFiles() []string { 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) { |