Skip to content

Instantly share code, notes, and snippets.

@christoph-frick
Created February 4, 2014 20:00
Show Gist options
  • Save christoph-frick/8811214 to your computer and use it in GitHub Desktop.
Save christoph-frick/8811214 to your computer and use it in GitHub Desktop.
Compile Vaadin WidgetSet
includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_GrailsClasspath")
includeTargets << grailsScript("_GrailsRun")
target(widgetset_init: "init") {
vaadinConfig = new ConfigSlurper(grails.util.Environment.current.name).parse(new File("${basedir}/grails-app/conf/VaadinConfig.groovy").text)
ant.property(name: "widgetset", value: vaadinConfig.vaadin.widgetset)
ant.property(name: "workers", value: "4")
ant.property(name: "widgetset-path", value: "")
ant.property(name: "client-side-destination", value: "web-app/VAADIN/widgetsets")
ant.property(name: "generate.widgetset", value: "1")
}
target(compile_widgetset: "widgetset") {
depends(classpath, compile, widgetset_init)
ant.echo message: """Compiling ${ant.project.properties.'widgetset'} into ${ant.project.properties."client-side-destination"} directory..."""
ant.java(classname: "com.google.gwt.dev.Compiler", maxmemory: "512m", failonerror: true, fork: true, classpathref: "grails.compile.classpath") {
ant.classpath {
pathelement location: "${basedir}/src/java"
pathelement location: "${basedir}/target/classes"
}
arg(value: "-localWorkers")
arg(value: "${ant.project.properties.'workers'}")
arg(value: "-war")
arg(value: ant.project.properties.'client-side-destination')
arg(value: ant.project.properties.'widgetset')
jvmarg(value: "-Xss1024k")
jvmarg(value: "-Djava.awt.headless=true")
}
}
setDefaultTarget(compile_widgetset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment