diff options
author | Colin Cross <ccross@android.com> | 2017-12-08 19:12:36 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-12-11 23:54:35 +0000 |
commit | c331599a8878bfe40f6030ce5cfc10603f739a8d (patch) | |
tree | bc2f8a5c5a7e10dcfae3922c9ee4b7f5dbf1e9a8 /genrule | |
parent | ac87c992bee5c4034fdd5ced05e3328f081a7132 (diff) | |
download | build_soong-c331599a8878bfe40f6030ce5cfc10603f739a8d.tar.gz build_soong-c331599a8878bfe40f6030ce5cfc10603f739a8d.tar.bz2 build_soong-c331599a8878bfe40f6030ce5cfc10603f739a8d.zip |
Allow java binary wrapper files to reference filegroups
Also allow commands with no tools for the case when standard
shell utilities are used to munge an input file.
Test: m checkbuild
Change-Id: Ie061e90cafe1a0a0db004a89e9a17fb48709cb03
Diffstat (limited to 'genrule')
-rw-r--r-- | genrule/genrule.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/genrule/genrule.go b/genrule/genrule.go index 98394100..8c1969f2 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go @@ -142,12 +142,6 @@ func (g *Module) DepsMutator(ctx android.BottomUpMutatorContext) { } func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) { - toolFiles := ctx.ExpandSources(g.properties.Tool_files, nil) - if len(g.properties.Tools) == 0 && len(toolFiles) == 0 { - ctx.ModuleErrorf("at least one `tools` or `tool_files` is required") - return - } - if len(g.properties.Export_include_dirs) > 0 { for _, dir := range g.properties.Export_include_dirs { g.exportedIncludeDirs = append(g.exportedIncludeDirs, @@ -210,6 +204,7 @@ func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) { return } + toolFiles := ctx.ExpandSources(g.properties.Tool_files, nil) for _, tool := range toolFiles { g.deps = append(g.deps, tool) if _, exists := tools[tool.Rel()]; !exists { @@ -227,6 +222,10 @@ func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) { rawCommand, err := android.Expand(task.cmd, func(name string) (string, error) { switch name { case "location": + if len(g.properties.Tools) == 0 && len(toolFiles) == 0 { + return "", fmt.Errorf("at least one `tools` or `tool_files` is required if $(location) is used") + } + if len(g.properties.Tools) > 0 { return tools[g.properties.Tools[0]].String(), nil } else { |