Support genrules with multiple tools

To allow genrules with more than one tool, rename the tool property to
tools and make it an array, replace $tool with $(location <label>),
and use $() for other variables for consistency.

Also remove the host bin directory from the genrule path, and the
$srcDir variable, using either of them would have caused dependency
issues.

Bug: 31948427
Test: compare build.ninja
Change-Id: Icf6d3bce2bea00fec1363fd65c0bdf96d09281bf
(cherry picked from commit de6bd86d24)
This commit is contained in:
Colin Cross
2016-11-04 15:32:58 -07:00
parent 6bde0948d2
commit 6f080dff81
2 changed files with 75 additions and 57 deletions

View File

@@ -59,9 +59,7 @@ func getMapping(s string, mapping func(string) (string, error)) (string, int, er
case '$':
return s[0:1], 1, nil
default:
i := strings.IndexFunc(s, func(c rune) bool {
return !(unicode.IsLetter(c) || unicode.IsNumber(c) || c == '_' || c == '.' || c == '-')
})
i := strings.IndexFunc(s, unicode.IsSpace)
if i == 0 {
return "", 0, fmt.Errorf("unexpected character '%c' after '$'", s[0])
} else if i == -1 {