Merge "Replace android.WriteFile rule with android.WriteFileRule" am: 1af783fae7
am: e37a8e2d51
am: 104085c573
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1498169 Change-Id: Iddd550168d954a2c53d8f043b9a3f0db7348d5f8
This commit is contained in:
@@ -5447,7 +5447,7 @@ func TestAppBundle(t *testing.T) {
|
||||
}
|
||||
`, withManifestPackageNameOverrides([]string{"AppFoo:com.android.foo"}))
|
||||
|
||||
bundleConfigRule := ctx.ModuleForTests("myapex", "android_common_myapex_image").Description("Bundle Config")
|
||||
bundleConfigRule := ctx.ModuleForTests("myapex", "android_common_myapex_image").Output("bundle_config.json")
|
||||
content := bundleConfigRule.Args["content"]
|
||||
|
||||
ensureContains(t, content, `"compression":{"uncompressed_glob":["apex_payload.img","apex_manifest.*"]}`)
|
||||
@@ -5473,7 +5473,7 @@ func TestAppSetBundle(t *testing.T) {
|
||||
set: "AppSet.apks",
|
||||
}`)
|
||||
mod := ctx.ModuleForTests("myapex", "android_common_myapex_image")
|
||||
bundleConfigRule := mod.Description("Bundle Config")
|
||||
bundleConfigRule := mod.Output("bundle_config.json")
|
||||
content := bundleConfigRule.Args["content"]
|
||||
ensureContains(t, content, `"compression":{"uncompressed_glob":["apex_payload.img","apex_manifest.*"]}`)
|
||||
s := mod.Rule("apexRule").Args["copy_commands"]
|
||||
|
@@ -373,14 +373,7 @@ func (a *apexBundle) buildBundleConfig(ctx android.ModuleContext) android.Output
|
||||
panic(fmt.Errorf("error while marshalling to %q: %#v", output, err))
|
||||
}
|
||||
|
||||
ctx.Build(pctx, android.BuildParams{
|
||||
Rule: android.WriteFile,
|
||||
Output: output,
|
||||
Description: "Bundle Config " + output.String(),
|
||||
Args: map[string]string{
|
||||
"content": string(j),
|
||||
},
|
||||
})
|
||||
android.WriteFileRule(ctx, output, string(j))
|
||||
|
||||
return output.OutputPath
|
||||
}
|
||||
|
14
apex/key.go
14
apex/key.go
@@ -116,7 +116,7 @@ func (s *apexKeysText) GenerateBuildActions(ctx android.SingletonContext) {
|
||||
partition string
|
||||
}
|
||||
toString := func(e apexKeyEntry) string {
|
||||
format := "name=%q public_key=%q private_key=%q container_certificate=%q container_private_key=%q partition=%q\\n"
|
||||
format := "name=%q public_key=%q private_key=%q container_certificate=%q container_private_key=%q partition=%q\n"
|
||||
if e.presigned {
|
||||
return fmt.Sprintf(format, e.name, "PRESIGNED", "PRESIGNED", "PRESIGNED", "PRESIGNED", e.partition)
|
||||
} else {
|
||||
@@ -173,17 +173,9 @@ func (s *apexKeysText) GenerateBuildActions(ctx android.SingletonContext) {
|
||||
|
||||
var filecontent strings.Builder
|
||||
for _, name := range moduleNames {
|
||||
fmt.Fprintf(&filecontent, "%s", toString(apexKeyMap[name]))
|
||||
filecontent.WriteString(toString(apexKeyMap[name]))
|
||||
}
|
||||
|
||||
ctx.Build(pctx, android.BuildParams{
|
||||
Rule: android.WriteFile,
|
||||
Description: "apexkeys.txt",
|
||||
Output: s.output,
|
||||
Args: map[string]string{
|
||||
"content": filecontent.String(),
|
||||
},
|
||||
})
|
||||
android.WriteFileRule(ctx, s.output, filecontent.String())
|
||||
}
|
||||
|
||||
func apexKeysTextFactory() android.Singleton {
|
||||
|
Reference in New Issue
Block a user