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 de6bd86d240b98b7ea7ff6a0454a13edc639a163)
diff --git a/android/expand.go b/android/expand.go
index dafb2b6..1013181 100644
--- a/android/expand.go
+++ b/android/expand.go
@@ -59,9 +59,7 @@
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 {