# HG changeset patch # User Jaroslav Tulach # Date 1372268254 -7200 # Node ID 592cb4e0f363b200401988d30a8aeb3d1f856ef4 # Parent 462dd9238173202b58d9e613f3693f1b2383cf8b# Parent aa82f9de8e33583282942f6a1cfeb16d086c1753 Merge with default branch diff -r 462dd9238173 -r 592cb4e0f363 launcher/fx/src/main/java/org/apidesign/bck2brwsr/launcher/fximpl/WebDebug.java --- a/launcher/fx/src/main/java/org/apidesign/bck2brwsr/launcher/fximpl/WebDebug.java Wed Jun 26 19:29:54 2013 +0200 +++ b/launcher/fx/src/main/java/org/apidesign/bck2brwsr/launcher/fximpl/WebDebug.java Wed Jun 26 19:37:34 2013 +0200 @@ -66,11 +66,13 @@ @Override public void run() { try { - String p = "/home/jarda/src/bck2brwsr/html~demo/twitter/src/main/resources/org/apidesign/html/demo/twitter/index.html"; - File f = new File(p); - String[] args = {"--livehtml", f.getAbsolutePath()}; - File dir = f.getParentFile(); - cliHandler(args, toDbg, this, System.err, dir); + String p = System.getProperty("startpage.file"); + File f; + if (p != null && (f = new File(p)).exists()) { + String[] args = {"--livehtml", f.getAbsolutePath()}; + File dir = f.getParentFile(); + cliHandler(args, toDbg, this, System.err, dir); + } } catch (Exception ex) { LOG.log(Level.SEVERE, null, ex); } @@ -152,7 +154,7 @@ for (;;) { WebDebug.this.flush(); try { - current = pending.poll(100, TimeUnit.MILLISECONDS); + current = pending.poll(5, TimeUnit.MILLISECONDS); if (current == null) { return 0; } diff -r 462dd9238173 -r 592cb4e0f363 rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/BrwsrMojo.java --- a/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/BrwsrMojo.java Wed Jun 26 19:29:54 2013 +0200 +++ b/rt/mojo/src/main/java/org/apidesign/bck2brwsr/mojo/BrwsrMojo.java Wed Jun 26 19:37:34 2013 +0200 @@ -29,6 +29,7 @@ import java.util.Collection; import java.util.List; import org.apache.maven.artifact.Artifact; +import org.apache.maven.model.Resource; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; @@ -75,7 +76,6 @@ if (startpage == null) { throw new MojoExecutionException("You have to provide a start page"); } - try { Closeable httpServer; if (directory != null) { @@ -83,6 +83,13 @@ } else { URLClassLoader url = buildClassLoader(classes, prj.getArtifacts()); try { + for (Resource r : prj.getResources()) { + File f = new File(r.getDirectory(), startpage().replace('/', File.separatorChar)); + if (f.exists()) { + System.setProperty("startpage.file", f.getPath()); + } + } + httpServer = Launcher.showURL(launcher, url, startpage()); } catch (Exception ex) { throw new MojoExecutionException("Can't open " + startpage(), ex);