From 08f15ab46655d7b8a285df531d1dfd3cafb2eb73 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 4 Oct 2018 23:29:14 -0700 Subject: genrule: add $(location) for inputs and outputs There was no way to select a single source file from a genrule that has multiple source files. Make Soong's genrule closer to Bazel by supporting $(location) for input and outputs. Change the label used for tools referenced through filegroups to the name of the module instead of the name of the file, which means it matches the string used in the tools property. Also support :module format in the tools property in preparation for deprecating the tool_files property and putting both files and modules in the tools property. Bug: 117354232 Test: genrule_test.go Change-Id: Id31a4ac4ff7064076a576c1d8ffeb7c19fc6b9a4 Merged-In: Id31a4ac4ff7064076a576c1d8ffeb7c19fc6b9a4 (cherry picked from commit 098d22b5f6d965872b524ce798ce728580ce405c) --- genrule/genrule.go | 101 +++++++++++++++++++++++++++------------- genrule/genrule_test.go | 119 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 187 insertions(+), 33 deletions(-) (limited to 'genrule') diff --git a/genrule/genrule.go b/genrule/genrule.go index f19e2aa0..2824e490 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go @@ -52,10 +52,9 @@ type HostToolProvider interface { type hostToolDependencyTag struct { blueprint.BaseDependencyTag + label string } -var hostToolDepTag hostToolDependencyTag - type generatorProperties struct { // The command to run on one or more input files. Cmd supports substitution of a few variables // (the actual substitution is implemented in GenerateAndroidBuildActions below) @@ -63,7 +62,7 @@ type generatorProperties struct { // Available variables for substitution: // // $(location): the path to the first entry in tools or tool_files - // $(location