# HG changeset patch # User Jaroslav Tulach # Date 1461816566 -7200 # Node ID 442c7f2d54eaf0e0e8035c149eb0cb18b5bc92bb # Parent ebda6f4d0336d68e7749b1a1d453f132c32ab224 Don't report warnings when generating minified version of bck2brwsr libraries diff -r ebda6f4d0336 -r 442c7f2d54ea rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java Thu Apr 28 05:59:32 2016 +0200 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java Thu Apr 28 06:09:26 2016 +0200 @@ -147,7 +147,8 @@ } } } - + + boolean notified = false; JarOutputStream os = null; if (!"false".equals(debug)) { @@ -155,6 +156,8 @@ os = aotJar(m); } os.putNextEntry(new JarEntry(debug)); + getLog().info("Generating bck2brwsr for " + mainJar); + notified = true; Writer w = new OutputStreamWriter(os, "UTF-8"); configureMain(loader). obfuscation(ObfuscationLevel.NONE). @@ -167,7 +170,10 @@ os = aotJar(m); } os.putNextEntry(new JarEntry(minified)); - + + if (!notified) { + getLog().info("Generating bck2brwsr for " + mainJar); + } Writer w = new OutputStreamWriter(os, "UTF-8"); configureMain(loader). obfuscation(obfuscation). diff -r ebda6f4d0336 -r 442c7f2d54ea rt/vm/src/main/java/org/apidesign/vm4brwsr/ClosureWrapper.java --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/ClosureWrapper.java Thu Apr 28 05:59:32 2016 +0200 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/ClosureWrapper.java Thu Apr 28 06:09:26 2016 +0200 @@ -19,6 +19,7 @@ import com.google.javascript.jscomp.CommandLineRunner; import com.google.javascript.jscomp.SourceFile; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; @@ -48,10 +49,10 @@ private String externsCode; private ClosureWrapper(Appendable out, - String compilationLevel, Bck2Brwsr config) { + String compilationLevel, Bck2Brwsr config, PrintStream err) { super( generateArguments(compilationLevel), - new PrintStream(new APS(out)), System.err + new PrintStream(new APS(out)), err ); this.config = config; } @@ -142,16 +143,16 @@ ObfuscationLevel obfuscationLevel, Bck2Brwsr config ) throws IOException { - final ClosureWrapper cw = - new ClosureWrapper(output, - (obfuscationLevel == ObfuscationLevel.FULL) - ? "ADVANCED_OPTIMIZATIONS" - : "SIMPLE_OPTIMIZATIONS", - config); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + PrintStream err = new PrintStream(out); + final ClosureWrapper cw = new ClosureWrapper(output, + (obfuscationLevel == ObfuscationLevel.FULL) ? "ADVANCED_OPTIMIZATIONS" : "SIMPLE_OPTIMIZATIONS", + config, err + ); try { return cw.doRun(); } catch (FlagUsageException ex) { - throw new IOException(ex); + throw new IOException(out.toString(), ex); } }