# HG changeset patch # User Jaroslav Tulach # Date 1417849353 -3600 # Node ID 0e949cf1b0735995a1dcf38a088d111b52d65b2a # Parent c097ff7c46b8b6a79c2c958a1efbf89a6dd5681a ko-bck2brwsr now provides precompiled versions of org.netbeans.html libraries. emul.zip is precompiled as well. diff -r c097ff7c46b8 -r 0e949cf1b073 ko/bck2brwsr/pom.xml --- a/ko/bck2brwsr/pom.xml Sat Dec 06 07:16:51 2014 +0100 +++ b/ko/bck2brwsr/pom.xml Sat Dec 06 08:02:33 2014 +0100 @@ -29,6 +29,25 @@ false + + org.apidesign.bck2brwsr + bck2brwsr-maven-plugin + ${project.version} + + + + library + + + + + + org.netbeans.html:* + + false + false + + @@ -121,5 +140,15 @@ ko4j ${net.java.html.version} + + org.netbeans.html + net.java.html.geo + ${net.java.html.version} + + + org.netbeans.html + net.java.html.sound + ${net.java.html.version} + diff -r c097ff7c46b8 -r 0e949cf1b073 rt/emul/zip/pom.xml --- a/rt/emul/zip/pom.xml Sat Dec 06 07:16:51 2014 +0100 +++ b/rt/emul/zip/pom.xml Sat Dec 06 08:02:33 2014 +0100 @@ -32,7 +32,19 @@ false java.util.zip - + + + org.apidesign.bck2brwsr + bck2brwsr-maven-plugin + ${project.version} + + + + library + + + + @@ -51,7 +63,7 @@ org.apidesign.bck2brwsr emul.mini ${project.version} - compile + provided jar diff -r c097ff7c46b8 -r 0e949cf1b073 rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java Sat Dec 06 07:16:51 2014 +0100 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java Sat Dec 06 08:02:33 2014 +0100 @@ -90,7 +90,7 @@ try { Manifest m = new Manifest(); - { + if (!"false".equals(minified)) { Attributes attr = new Attributes(); attr.putValue("Bck2BrwsrArtifactId", prj.getArtifactId()); attr.putValue("Bck2BrwsrGroupId", prj.getGroupId()); @@ -98,7 +98,7 @@ attr.putValue("Bck2BrwsrMinified", "true"); m.getEntries().put(minified, attr); } - { + if (!"false".equals(debug)) { Attributes attr = new Attributes(); attr.putValue("Bck2BrwsrArtifactId", prj.getArtifactId()); attr.putValue("Bck2BrwsrGroupId", prj.getGroupId()); @@ -123,38 +123,32 @@ } { Attributes attr = new Attributes(); - attr.putValue("Bck2BrwsrArtifactId", prj.getArtifactId()); - attr.putValue("Bck2BrwsrGroupId", prj.getGroupId()); - attr.putValue("Bck2BrwsrVersion", prj.getVersion()); + attr.putValue("Bck2BrwsrArtifactId", a.getArtifactId()); + attr.putValue("Bck2BrwsrGroupId", a.getGroupId()); + attr.putValue("Bck2BrwsrVersion", a.getVersion()); attr.putValue("Bck2BrwsrDebug", "true"); m.getEntries().put(artifactName(a, false), attr); } - } + } } FileOutputStream fos = new FileOutputStream(this.aotJar); JarOutputStream os = new JarOutputStream(fos, m); - Bck2Brwsr c = Bck2BrwsrJars.configureFrom(null, mainJar, loader); - if (exports != null) { - for (String e : exports) { - c = c.addExported(e.replace('.', '/')); - } - } - { + if (!"false".equals(debug)) { os.putNextEntry(new JarEntry(debug)); Writer w = new OutputStreamWriter(os); - c. + configureMain(loader). obfuscation(ObfuscationLevel.NONE). generate(w); w.flush(); os.closeEntry(); } - { + if (!"false".equals(minified)) { os.putNextEntry(new JarEntry(minified)); Writer w = new OutputStreamWriter(os); - c. + configureMain(loader). obfuscation(ObfuscationLevel.FULL). generate(w); w.flush(); @@ -166,6 +160,13 @@ if (!matches(aotDeps, a)) { continue; } + getLog().info("Generating bck2brwsr for " + a.getFile()); + Bck2Brwsr c = Bck2BrwsrJars.configureFrom(null, a.getFile(), loader); + if (exports != null) { + for (String e : exports) { + c = c.addExported(e.replace('.', '/')); + } + } { os.putNextEntry(new JarEntry(artifactName(a, true))); Writer w = new OutputStreamWriter(os); @@ -195,6 +196,16 @@ } } + private Bck2Brwsr configureMain(URLClassLoader loader) throws IOException { + Bck2Brwsr c = Bck2BrwsrJars.configureFrom(null, mainJar, loader); + if (exports != null) { + for (String e : exports) { + c = c.addExported(e.replace('.', '/')); + } + } + return c; + } + private static String artifactName(Artifact a, boolean debug) { return a.getGroupId() + "-" + a.getArtifactId() + (debug ? "-debug.js" : "-min.js"); }