def ant = new AntBuilder()
def webinf = "war/WEB-INF"
def aesdk = "appengine" //change this to the location of AppEngine SDK
ant."import" (file: "${aesdk}/config/user/ant-macros.xml")
ant.sequential() {
taskdef name: "groovyc", classname: "org.codehaus.groovy.ant.Groovyc"
groovyc srcdir: "src", destdir: "${webinf}/classes", {
classpath {
fileset dir: "${webinf}/lib", {
include name: "*.jar"
}
pathelement path: "${webinf}/classes"
}
javac source: "1.5", target: "1.5", debug: "on"
}
copy toDir: "${webinf}/groovy", {
fileset dir:"groovlets"
}
if(args.find{it.startsWith("-u")}) {
appcfg action:"update", war:"war"
}
}
Please note that appcfg is a task defined in the GAE SDK. By importing the relevant xml file (and having the respective jar files on classpath), this and all other ant tasks become available to groovy scripts.
If you run this script with
"groovy build -u
" 3 things will happen:- all stuff in "src" will get compiled
- all stuff in "groovlets" will get copied over to the appropriate directory (no need to compile those, if you follow Guillaume's hints regarding web.xml configuration
- all stuff will get pushed to the AppEngine
Keine Kommentare:
Kommentar veröffentlichen