Add newlines in the resource shinker log wrapper

This makes us consistent with the normal StringConsumer usage where
the consumer should not add new lines, but simply consume the strings
in order (e.g., write them out)

Bug: 287398085
Change-Id: Ia170514b4c8955e29d17318405984c21c9f0a410
diff --git a/src/main/java/com/android/tools/r8/utils/ResourceShrinkerUtils.java b/src/main/java/com/android/tools/r8/utils/ResourceShrinkerUtils.java
index 47742f0..d9ad4ff 100644
--- a/src/main/java/com/android/tools/r8/utils/ResourceShrinkerUtils.java
+++ b/src/main/java/com/android/tools/r8/utils/ResourceShrinkerUtils.java
@@ -88,12 +88,16 @@
     return new ShrinkerDebugReporter() {
       @Override
       public void debug(Supplier<String> logSupplier) {
-        consumer.accept(logSupplier.get(), diagnosticsHandler);
+        // The default usage of shrinkerdebug in the legacy resource shrinker does not add
+        // new lines. Add these to make it consistent with the normal usage of StringConsumer.
+        consumer.accept(logSupplier.get() + "\n", diagnosticsHandler);
       }
 
       @Override
       public void info(Supplier<String> logProducer) {
-        consumer.accept(logProducer.get(), diagnosticsHandler);
+        // The default usage of shrinkerdebug in the legacy resource shrinker does not add
+        // new lines. Add these to make it consistent with the normal usage of StringConsumer.
+        consumer.accept(logProducer.get() + "\n", diagnosticsHandler);
       }
 
       @Override
diff --git a/src/test/java/com/android/tools/r8/androidresources/ResourceShrinkerLoggingTest.java b/src/test/java/com/android/tools/r8/androidresources/ResourceShrinkerLoggingTest.java
index 72f9d40..1028b38 100644
--- a/src/test/java/com/android/tools/r8/androidresources/ResourceShrinkerLoggingTest.java
+++ b/src/test/java/com/android/tools/r8/androidresources/ResourceShrinkerLoggingTest.java
@@ -66,7 +66,7 @@
                               new StringConsumer() {
                                 @Override
                                 public void accept(String string, DiagnosticsHandler handler) {
-                                  log.append(string + "\n");
+                                  log.append(string);
                                 }
 
                                 @Override