Last active
September 13, 2016 07:08
-
-
Save MikeN123/a9000a9ac4c1ed0f3d0222a5ae0c1b7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configurations { | |
compileGwt | |
} | |
jar { | |
from { | |
compileGwt.buildDir | |
} | |
// Exclude GWT client code and resources | |
rootSpec.exclude('nl') | |
} | |
dependencies { | |
compile 'com.google.guava:guava-gwt' | |
// Compile GWT libs, needed for compileGwt and the javaCompile | |
// Also includes the servlet-api | |
compileOnly 'com.google.gwt:gwt-user' | |
compileGwt 'com.google.gwt:gwt-dev' | |
} | |
task compileGwt (dependsOn: classes, type: JavaExec) { | |
ext.buildDir = "${project.buildDir}/gwt" | |
ext.extraDir = "${project.buildDir}/extra" | |
classpath { | |
[ | |
configurations.compileGwt, | |
sourceSets.main.java.srcDirs, // Java source | |
sourceSets.main.output.resourcesDir, // Generated resources | |
sourceSets.main.output.classesDir, // Generated classes | |
sourceSets.main.compileClasspath, // Deps | |
] | |
} | |
inputs.files classpath | |
outputs.dir buildDir | |
// Workaround input change detection (GRADLE-3528), fixed after Gradle 3.0 | |
def iter = environment.iterator() | |
while(iter.hasNext()) { | |
def entry = iter.next() | |
if (entry.key =~ /APP_NAME_\d+|APP_ICON_\d+|JAVA_MAIN_CLASS_\d+/) { | |
iter.remove() | |
} | |
} | |
doFirst { | |
file(buildDir).mkdirs() | |
} | |
main = 'com.google.gwt.dev.Compiler' | |
def cpus = System.properties['gwt.cpus']?:2 | |
def arguments = | |
[ | |
'nl.my.MailClass', | |
'-war', buildDir, | |
'-logLevel', 'INFO', | |
'-localWorkers', cpus, | |
'-compileReport', | |
'-extra', extraDir, | |
'-strict' | |
] | |
args = arguments | |
maxHeapSize = '512M' | |
} | |
jar.dependsOn compileGwt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment