# HG changeset patch # User Jaroslav Tulach # Date 1459137343 -7200 # Node ID 88b00e03fc8ff6a0ae7fc0bd058370f724f77542 # Parent fe2e6f5a204448d3169e25cd0d42216ee0387206 Introducing vmtest.precompiled= to verify that bck2brwsr generated resources are really used diff -r fe2e6f5a2044 -r 88b00e03fc8f launcher/http/pom.xml --- a/launcher/http/pom.xml Fri Mar 25 21:47:31 2016 +0100 +++ b/launcher/http/pom.xml Mon Mar 28 05:55:43 2016 +0200 @@ -30,6 +30,29 @@ false + + org.apidesign.bck2brwsr + bck2brwsr-maven-plugin + 0.17 + + + + library + + + + + false + + + + org.apidesign.bck2brwsr + aot + ${project.version} + jar + + + @@ -70,7 +93,7 @@ org.apidesign.bck2brwsr aot - 0.18 + ${project.version} jar diff -r fe2e6f5a2044 -r 88b00e03fc8f launcher/http/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java --- a/launcher/http/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java Fri Mar 25 21:47:31 2016 +0100 +++ b/launcher/http/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java Mon Mar 28 05:55:43 2016 +0200 @@ -24,11 +24,10 @@ import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; -import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Set; import java.util.logging.Level; +import java.util.regex.Pattern; /** * Lightweight server to launch Bck2Brwsr applications and tests. @@ -59,6 +58,10 @@ } catch (URISyntaxException ex) { throw new IOException(ex); } + final String precompile = System.getProperty("vmtest.precompiled"); + if (precompile != null && Pattern.compile(precompile).matcher(jar.toString()).find()) { + throw new IOException("Compilation of " + jar + " forbidden"); + } LOG.log(Level.INFO, "No precompiled version for {0} found. Compiling.", jar); return CompileCP.compileJAR(f, testClasses); } diff -r fe2e6f5a2044 -r 88b00e03fc8f rt/emul/compact/src/main/assembly/rt.xml --- a/rt/emul/compact/src/main/assembly/rt.xml Fri Mar 25 21:47:31 2016 +0100 +++ b/rt/emul/compact/src/main/assembly/rt.xml Mon Mar 28 05:55:43 2016 +0200 @@ -12,7 +12,7 @@ provided - META-INF/maven/** + META-INF/maven/**/*mini*/** diff -r fe2e6f5a2044 -r 88b00e03fc8f rt/emul/compacttest/pom.xml --- a/rt/emul/compacttest/pom.xml Fri Mar 25 21:47:31 2016 +0100 +++ b/rt/emul/compacttest/pom.xml Mon Mar 28 05:55:43 2016 +0200 @@ -29,12 +29,26 @@ ${project.groupId} + launcher.http + ${project.version} + bck2brwsr + test + + + ${project.groupId} emul rt ${project.version} test + ${project.groupId} + emul + bck2brwsr + ${project.version} + test + + org.netbeans.api org-openide-util-lookup test @@ -76,7 +90,12 @@ - + + + .* + + + diff -r fe2e6f5a2044 -r 88b00e03fc8f rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java Fri Mar 25 21:47:31 2016 +0100 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/AOTLibrary.java Mon Mar 28 05:55:43 2016 +0200 @@ -18,6 +18,7 @@ package org.apidesign.bck2brwsr.mojo; import java.io.File; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; @@ -141,10 +142,12 @@ } } - FileOutputStream fos = new FileOutputStream(this.aotJar); - JarOutputStream os = new JarOutputStream(fos, m); + JarOutputStream os = null; if (!"false".equals(debug)) { + if (os == null) { + os = aotJar(m); + } os.putNextEntry(new JarEntry(debug)); Writer w = new OutputStreamWriter(os, "UTF-8"); configureMain(loader). @@ -154,6 +157,9 @@ os.closeEntry(); } if (!"false".equals(minified)) { + if (os == null) { + os = aotJar(m); + } os.putNextEntry(new JarEntry(minified)); Writer w = new OutputStreamWriter(os, "UTF-8"); @@ -177,6 +183,9 @@ } } { + if (os == null) { + os = aotJar(m); + } os.putNextEntry(new JarEntry(artifactName(a, true))); Writer w = new OutputStreamWriter(os, "UTF-8"); c. @@ -197,7 +206,9 @@ } } } - os.close(); + if (os != null) { + os.close(); + } projectHelper.attachArtifact(prj, "jar", "bck2brwsr", aotJar); } catch (IOException ex) { @@ -205,6 +216,13 @@ } } + private JarOutputStream aotJar(Manifest m) throws IOException, FileNotFoundException { + this.aotJar.getParentFile().mkdirs(); + FileOutputStream fos = new FileOutputStream(this.aotJar); + JarOutputStream os = new JarOutputStream(fos, m); + return os; + } + private Bck2Brwsr configureMain(URLClassLoader loader) throws IOException { Bck2Brwsr c = Bck2BrwsrJars.configureFrom(null, mainJar, loader, ignoreBootClassPath); if (exports != null) {