2 outputJar = "tspec-${version}.jar"
4 includeTargets << gant.targets.Clean
5 cleanPattern << ['**/*~', '**/*.bak', outputJar]
6 cleanDirectory << 'bin'
8 groovyHome = System.properties.'groovy.home'
9 if ( ( groovyHome == null ) || ( groovyHome == '' ) ) {
10 println ( 'Real problem: property groovy.home is not set and this is Gant executing.' )
14 compileJarSet = 'compileJarSet'
15 ant.path ( id : compileJarSet ) {
16 fileset ( dir : groovyHome + '/lib' , includes : 'groovy*.jar' )
17 fileset ( dir : groovyHome + '/lib' , includes : 'commons-cli*.jar' )
18 fileset ( dir : groovyHome + '/lib' , includes : 'asm*.jar' )
19 fileset ( dir : groovyHome + '/lib' , includes : 'ant*.jar' ) // Picks up antlr as well as ant. This is intended.
22 testJarSet = 'testJarSet'
23 ant.path ( id : testJarSet ) {
24 path ( refid : compileJarSet )
25 fileset ( dir : groovyHome + '/lib' , includes : 'junit*.jar' )
29 target(compile: 'Compile TSpec') {
30 ant.mkdir ( dir : 'bin' )
31 ant.taskdef ( name : 'groovyc' , classname : 'org.codehaus.groovy.ant.Groovyc' , classpathref : compileJarSet )
32 ant.groovyc ( srcdir : 'src/java' , destdir : 'bin' , fork : 'false' , failonerror : 'true', encoding:'UTF-8' ) {
34 pathelement ( location : 'bin' )
35 path ( refid : compileJarSet )
37 javac ( source : '1.5' , target : '1.5' , debug : 'on' )
41 target(jar: 'Build a TSpec jar') {
43 ant.jar (basedir:'bin', destfile:outputJar)
46 target('local-test':'Copy to test dir') {
48 copy(file:outputJar, todir:"c:\\grails\\land\\lib")
51 setDefaultTarget(compile)