Commit graph

4 commits

Author SHA1 Message Date
Colin Cross
2647ced06e Fix android.Expand and ninja escaping
RuleBuilder does its own ninja escaping, so values that will be
passed to RuleBuilder must not be pre-escaped.  Add a new
android.ExpandNinjaEscaped method that explicitly handles ninja
escaping.  Some of the expansion functions return ninja values
(like "${in}") that need to stay unescaped, so add a bool return
value to the expansion function in android.ExpandNinjaEscaped.

Test: expand_test.go
Change-Id: Ib03d4db38b5e3e5bffbd87acf14f55e276a53d04
2019-07-11 14:52:17 -07:00
Colin Cross
2ee10a0659 genrule: expand $$ to $$
An escaped $ sign in an expanded string needs to be re-escaped so it
can pass through to ninja.

Test: m -j libLLVMObject
Change-Id: I2f7890417fd6f534e6e21cace3d86ae9ef708ce5
2016-11-22 15:41:08 -08:00
Colin Cross
6f080dff81 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)
2016-11-07 10:53:49 -08:00
Colin Cross
6bde0948d2 Add android.Expand
Add android.Expand to expand $() variables in properties.

Test: expand_test
Bug: 31948427
Change-Id: Id30856a1d21d02e8997fcf2358e4a5feeede05be
2016-11-04 15:59:23 -07:00