Store JVM in JAR from command line

I am running the closure pattern compiler on a soy file with a clock - it just runs

java -jar SoyToJsSrcCompiler.jar  --outputPathFormat simple.js   simple.soy

      

every time the file changes.

The problem is that it takes a long time for each banner to load each one. Is there an easy way (simple = command line tool) that will keep the JVM starting up to speed up each startup?

+3


source to share


2 answers


Checkout Nailgun http://www.martiansoftware.com/nailgun/index.html



+2


source


You can create a simple class that calls the main SoyToJsSrcCompiler method passing in arguments taken from System.in.

Something like this (not tested) (enter "quit" to quit the application):

  public static void main(String args[]) throws Exception
  {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    while (true)
    {
      System.out.println("Enter command (eg: --outputPathFormat simple.js   simple.soy): ");
      String line = br.readLine();
      if (line.equals("quit"))
        break;

      com.google.template.soy.SoyToJsSrcCompiler.main(line.split(" +"));
    }    
  }

      



And execute your launchers with arguments:

java -cp MyLauncher.jar:SoyToJsSrcCompiler.jar launcher.MyLauncher

      

+1


source







All Articles