Merge "Pretty print SBox manifest files to make them easier to read" into main am: 169cffe526

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2786461

Change-Id: Iae5841a6ada5836945933a71c480bd780526ed5a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Paul Duffin
2024-01-19 10:44:01 +00:00
committed by Automerger Merge Worker

View File

@@ -629,8 +629,9 @@ func (r *RuleBuilder) build(name string, desc string, ninjaEscapeCommandString b
name, r.sboxManifestPath.String(), r.outDir.String())
}
// Create a rule to write the manifest as textproto.
pbText, err := prototext.Marshal(&manifest)
// Create a rule to write the manifest as textproto. Pretty print it by indenting and
// splitting across multiple lines.
pbText, err := prototext.MarshalOptions{Indent: " "}.Marshal(&manifest)
if err != nil {
ReportPathErrorf(r.ctx, "sbox manifest failed to marshal: %q", err)
}