BEP JSON file: omit unnecessary white space
To keep the build-event JSON file more compact, do not generate
unnecessary white space. This also simplifies navigation through the
file as now we have precisely one JSON object per line.
@@ -57,7 +57,11 @@ public final class JsonFormatFileTransport extends FileTransport {
};
String protoJsonRepresentation;
try {
- protoJsonRepresentation = JsonFormat.printer().print(event.asStreamProto(converters)) + "\n";
+ protoJsonRepresentation =
+ JsonFormat.printer()
+ .omittingInsignificantWhitespace()
+ .print(event.asStreamProto(converters))
+ + "\n";
} catch (InvalidProtocolBufferException e) {
// We don't expect any unknown Any fields in our protocol buffer. Nevertheless, handle
// the exception gracefully and, at least, return valid JSON with an id field.
