Add tests for genrule command expansion
Add tests for expanding variables in a genrule cmd property.
Test: genrule_test.go
Change-Id: I8288b8616d518bb5f24a892c4e59f68d95055d0a
diff --git a/genrule/genrule.go b/genrule/genrule.go
index e3823c5..f19e2aa 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -102,8 +102,9 @@
taskGenerator taskFunc
- deps android.Paths
- rule blueprint.Rule
+ deps android.Paths
+ rule blueprint.Rule
+ rawCommand string
exportedIncludeDirs android.Paths
@@ -287,6 +288,7 @@
genDir := android.PathForModuleGen(ctx)
// Escape the command for the shell
rawCommand = "'" + strings.Replace(rawCommand, "'", `'\''`, -1) + "'"
+ g.rawCommand = rawCommand
sandboxCommand := fmt.Sprintf("$sboxCmd --sandbox-path %s --output-root %s -c %s %s $allouts",
sandboxPath, genDir, rawCommand, depfilePlaceholder)