Replace android.WriteFile rule with android.WriteFileRule
The android.WriteFile rule takes careful escaping to produce the
right contents. Wrap it in an android.WriteFileRule that handles
the escaping.
Test: compare all android.WriteFile outputs
Change-Id: If71a5843af47a37ca61714e1a1ebb32d08536c31
diff --git a/cc/vndk.go b/cc/vndk.go
index 2cac03c..4a005f3 100644
--- a/cc/vndk.go
+++ b/cc/vndk.go
@@ -487,14 +487,7 @@
}
txt.outputFile = android.PathForModuleOut(ctx, filename).OutputPath
- ctx.Build(pctx, android.BuildParams{
- Rule: android.WriteFile,
- Output: txt.outputFile,
- Description: "Writing " + txt.outputFile.String(),
- Args: map[string]string{
- "content": strings.Join(list, "\\n"),
- },
- })
+ android.WriteFileRule(ctx, txt.outputFile, strings.Join(list, "\n"))
installPath := android.PathForModuleInstall(ctx, "etc")
ctx.InstallFile(installPath, filename, txt.outputFile)
@@ -825,14 +818,7 @@
merged = append(merged, addPrefix(filterOutLibClangRt(vndkcore), "VNDK-core: ")...)
merged = append(merged, addPrefix(vndkprivate, "VNDK-private: ")...)
c.vndkLibrariesFile = android.PathForOutput(ctx, "vndk", "vndk.libraries.txt")
- ctx.Build(pctx, android.BuildParams{
- Rule: android.WriteFile,
- Output: c.vndkLibrariesFile,
- Description: "Writing " + c.vndkLibrariesFile.String(),
- Args: map[string]string{
- "content": strings.Join(merged, "\\n"),
- },
- })
+ android.WriteFileRule(ctx, c.vndkLibrariesFile, strings.Join(merged, "\n"))
}
func (c *vndkSnapshotSingleton) MakeVars(ctx android.MakeVarsContext) {