Merge "Replace android.WriteFile rule with android.WriteFileRule"
This commit is contained in:
@@ -296,8 +296,8 @@ func checkSnapshotExclude(t *testing.T, ctx *android.TestContext, singleton andr
|
||||
|
||||
func checkWriteFileOutput(t *testing.T, params android.TestingBuildParams, expected []string) {
|
||||
t.Helper()
|
||||
assertString(t, params.Rule.String(), android.WriteFile.String())
|
||||
actual := strings.FieldsFunc(strings.ReplaceAll(params.Args["content"], "\\n", "\n"), func(r rune) bool { return r == '\n' })
|
||||
content := android.ContentFromFileRuleForTests(t, params)
|
||||
actual := strings.FieldsFunc(content, func(r rune) bool { return r == '\n' })
|
||||
assertArrayString(t, actual, expected)
|
||||
}
|
||||
|
||||
|
@@ -278,14 +278,7 @@ func (fuzz *fuzzBinary) install(ctx ModuleContext, file android.Path) {
|
||||
|
||||
if fuzz.Properties.Fuzz_config != nil {
|
||||
configPath := android.PathForModuleOut(ctx, "config").Join(ctx, "config.json")
|
||||
ctx.Build(pctx, android.BuildParams{
|
||||
Rule: android.WriteFile,
|
||||
Description: "fuzzer infrastructure configuration",
|
||||
Output: configPath,
|
||||
Args: map[string]string{
|
||||
"content": fuzz.Properties.Fuzz_config.String(),
|
||||
},
|
||||
})
|
||||
android.WriteFileRule(ctx, configPath, fuzz.Properties.Fuzz_config.String())
|
||||
fuzz.config = configPath
|
||||
}
|
||||
|
||||
|
@@ -93,13 +93,6 @@ func combineNotices(ctx android.SingletonContext, paths android.Paths, out strin
|
||||
|
||||
func writeStringToFile(ctx android.SingletonContext, content, out string) android.OutputPath {
|
||||
outPath := android.PathForOutput(ctx, out)
|
||||
ctx.Build(pctx, android.BuildParams{
|
||||
Rule: android.WriteFile,
|
||||
Output: outPath,
|
||||
Description: "WriteFile " + out,
|
||||
Args: map[string]string{
|
||||
"content": content,
|
||||
},
|
||||
})
|
||||
android.WriteFileRule(ctx, outPath, content)
|
||||
return outPath
|
||||
}
|
||||
|
18
cc/vndk.go
18
cc/vndk.go
@@ -487,14 +487,7 @@ func (txt *vndkLibrariesTxt) GenerateAndroidBuildActions(ctx android.ModuleConte
|
||||
}
|
||||
|
||||
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 @@ func (c *vndkSnapshotSingleton) buildVndkLibrariesTxtFiles(ctx android.Singleton
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user