GWT compile: Fork mode


(Firas Fafi) #1

Hello, can anyone explain us how to fork gwt compiling in gradle. However in Ant build it was a simple option to add:

<java classpathref="gwt-classpath" classname="com.google.gwt.dev.Compiler" fork="true" failonerror="true">

Well my solution for gwt compiling look like this:

task gwtcompile( type:JavaExec){
  main="com.google.gwt.dev.Compiler"
  inputs.dir sourceSets.myproject.output.classesDir
  outputs.dir "$buildDir/war"
  classpath{
    [
      sourceSets.myproject.java.srcDirs,
      configurations.gwt
       ]
  }
    args "-style"
  args "PRETTY"
  args "-localWorkers"
  args "5"
  //args "-war"
  //args "$buildDir/war"
  args "-logLevel"
  args "INFO"
  args "com.myproject.FrontEnd"
  args "-draftCompile"
      jvmArgs "-Xmx1024M"
  jvmArgs "-Xss1024k"
  jvmArgs "-Djava.awt.headless=true"
     maxHeapSize = '256M'
}

I don’t understand also why this causes an exception:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space...

Thank you


(Thad Humphries) #2

Check out Steffen Schäfer’s GWT Gradle: https://github.com/steffenschaefer/gwt-gradle-plugin It’s much less painless that the GWT Maven plugin, especially for SuperDevMode.