diff options
author | Colin Cross | 2017-11-16 02:11:20 -0600 |
---|---|---|
committer | Colin Cross | 2017-11-17 13:22:08 -0600 |
commit | 35143d0466461f5d83dfc7aeda53b36a274f8cc8 (patch) | |
tree | 0edf1549368f4ce7f512f652da6e84158f89f816 /genrule | |
parent | b1bd1aabca24a97cf319dfd5268a89e969f1dd98 (diff) | |
download | platform-build-soong-35143d0466461f5d83dfc7aeda53b36a274f8cc8.tar.gz platform-build-soong-35143d0466461f5d83dfc7aeda53b36a274f8cc8.tar.xz platform-build-soong-35143d0466461f5d83dfc7aeda53b36a274f8cc8.zip |
Fix genrules depending on Go tools
genrules lost the ability to depend on Go tools after
I05e945f38915d49cd3c0ab72a86576949bc7eff2 which converted
VisitDirectDeps from blueprint Modules to android Modules.
Add VisitDirectDepsBlueprint to visit all modules including
blueprint Modules, and use it in genrule. Also add a check
for disabled modules that was being handled by
VisitDirectDeps.
Test: m checkbuild
Change-Id: I65724283166c63596d071e598c08fed87ef32896
Diffstat (limited to 'genrule')
-rw-r--r-- | genrule/genrule.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/genrule/genrule.go b/genrule/genrule.go index c5b7e1d3..c142c53e 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go | |||
@@ -158,7 +158,7 @@ func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) { | |||
158 | tools := map[string]android.Path{} | 158 | tools := map[string]android.Path{} |
159 | 159 | ||
160 | if len(g.properties.Tools) > 0 { | 160 | if len(g.properties.Tools) > 0 { |
161 | ctx.VisitDirectDeps(func(module android.Module) { | 161 | ctx.VisitDirectDepsBlueprint(func(module blueprint.Module) { |
162 | switch ctx.OtherModuleDependencyTag(module) { | 162 | switch ctx.OtherModuleDependencyTag(module) { |
163 | case android.SourceDepTag: | 163 | case android.SourceDepTag: |
164 | // Nothing to do | 164 | // Nothing to do |
@@ -167,6 +167,14 @@ func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) { | |||
167 | var path android.OptionalPath | 167 | var path android.OptionalPath |
168 | 168 | ||
169 | if t, ok := module.(HostToolProvider); ok { | 169 | if t, ok := module.(HostToolProvider); ok { |
170 | if !t.(android.Module).Enabled() { | ||
171 | if ctx.AConfig().AllowMissingDependencies() { | ||
172 | ctx.AddMissingDependencies([]string{tool}) | ||
173 | } else { | ||
174 | ctx.ModuleErrorf("depends on disabled module %q", tool) | ||
175 | } | ||
176 | break | ||
177 | } | ||
170 | path = t.HostToolPath() | 178 | path = t.HostToolPath() |
171 | } else if t, ok := module.(bootstrap.GoBinaryTool); ok { | 179 | } else if t, ok := module.(bootstrap.GoBinaryTool); ok { |
172 | if s, err := filepath.Rel(android.PathForOutput(ctx).String(), t.InstallPath()); err == nil { | 180 | if s, err := filepath.Rel(android.PathForOutput(ctx).String(), t.InstallPath()); err == nil { |