diff options
author | 2017-05-12 14:02:13 -0700 | |
---|---|---|
committer | 2017-05-16 15:10:29 -0700 | |
commit | 270051119a21ae5f73aa69b16ce2fb53cae534d3 (patch) | |
tree | 471266c33cb0d65ea3ba0559612144691b1baf66 /android/defs.go | |
parent | 6df46f5d9384ac7a1eb5baf1dea462d366edcd49 (diff) |
Fix the issue "\n" didn't get interpreted properly.
Added params to WriteFile rule that allow users to turn on the
specific 'echo' options, such as "enable the interpretation of backslash
escapes".
Bug: b/38261000
Test: tested with real data files.
Change-Id: I5145056b5c2522a3a72b9436055ec95d2fbd94c0
Diffstat (limited to 'android/defs.go')
-rw-r--r-- | android/defs.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/android/defs.go b/android/defs.go index 6f4631625..a7ba219a3 100644 --- a/android/defs.go +++ b/android/defs.go @@ -80,9 +80,12 @@ var ( Description: "concatenate licenses $out", }) + // ubuntu 14.04 offcially use dash for /bin/sh, and its builtin echo command + // doesn't support -e option. Therefore we force to use /bin/bash when writing out + // content to file. WriteFile = pctx.AndroidStaticRule("WriteFile", blueprint.RuleParams{ - Command: "echo '$content' > $out", + Command: "/bin/bash -c 'echo -e $$0 > $out' '$content'", Description: "writing file $out", }, "content") |