Skip to content

Instantly share code, notes, and snippets.

@vegegoku
Created May 16, 2018 12:48
Show Gist options
  • Save vegegoku/05ae3942442fa0ebeea2ae6d9698ca7a to your computer and use it in GitHub Desktop.
Save vegegoku/05ae3942442fa0ebeea2ae6d9698ca7a to your computer and use it in GitHub Desktop.
task compileGwt(dependsOn: classes, type: JavaExec) {
ext.buildDir = "${project.buildDir}/gwt"
ext.extraDir = "${project.buildDir}/extra"
inputs.file sourceSets.main.java.srcDirs
inputs.dir sourceSets.main.output.resourcesDir
outputs.dir buildDir
doFirst {
file(buildDir).mkdirs()
}
main = "com.google.gwt.dev.Compiler"
classpath {
[
sourceSets.main.java.srcDirs, // Java source
sourceSets.main.output.resourcesDir, // Generated resources
sourceSets.main.output.classesDir, // Generated classes
sourceSets.main.compileClasspath, // Deps
]
}
if (project.hasProperty('dev')) {
println "Run developer mode"
args = [
"com.test.portal.AppClientModule",
"-war", buildDir,
"-logLevel", "INFO",
"-localWorkers", "4",
"-compileReport",
"-extra", extraDir,
"-style", "OBF",
"-optimize", "9" // 0=none, 9=max
]
} else {
println "Run production mode"
args = [
"com.test.portal.AppClientModule",
"-war", buildDir,
"-logLevel", "INFO",
"-localWorkers", "4",
"-compileReport",
"-extra", extraDir,
"-style", "OBF",
"-optimize", "9" // 0=none, 9=max
]
}
maxHeapSize = "4G"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment