unexpected token in groovy



The build.groovy file is an excerpt from:


Pragmatic Project Automation: How to Build, Deploy, and Monitor Java
Applications: The Pragmatic Starter Kit, Volume III
by Mike Clark

I'm not sure how to interpret the error.



Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>groovy java\build.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed, java\build.groovy: 5: unexpected token: srcDir @ line 5, column
3.
srcDir = "src"
^

1 Error

C:\>type java\build.groovy

import java.io.File
class Build {

srcDir = "src"
buildDir = "build"
buildProdDir = buildDir + File.separator + "prod"
vendorLibDir = "vendor" + File.separator + "lib"

ant = new AntBuilder()

void clean() {
ant.delete(dir: buildDir)
}

void prepare() {
clean()
ant.mkdir(dir: buildProdDir)
}

void compile() {
prepare()
ant.javac(srcdir: srcDir,
destdir: buildProdDir,
classpath: projectClasspath())
}
String projectClasspath() {
ant.path {
fileset(dir: vendorLibDir) {
include(name: "**/*.jar")
}
}
}
}
new Build().compile()
C:\>
C:\>
C:\>
C:\>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\

11/21/2005 11:15p <DIR> Documents and Settings
06/24/2006 09:23p <DIR> groovy-1.0-jsr-05
06/26/2006 12:49p <DIR> java
06/19/2006 03:34a <DIR> news
06/25/2006 10:30p <DIR> Program Files
06/21/2006 09:28p <DIR> WINNT
0 File(s) 0 bytes
6 Dir(s) 811,622,400 bytes free

C:\>cd java

C:\java>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\java

06/26/2006 12:49p <DIR> .
06/26/2006 12:49p <DIR> ..
06/25/2006 06:20p <DIR> build
06/26/2006 12:53p 663 build.groovy
06/19/2006 03:25p 677 build.groovy.HelloWorldApp
06/25/2006 06:19p 1,291 build.xml
06/25/2006 06:19p 1,291 build.xml.HelloWorldApp
06/26/2006 12:49p 21 hello.groovy
06/25/2006 05:41p <DIR> src
06/24/2006 10:05p <DIR> vendor
5 File(s) 3,943 bytes
5 Dir(s) 811,622,400 bytes free

C:\java>groovy build.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed, build.groovy: 5: unexpected token: srcDir @ line 5, column 3.
srcDir = "src"
^

1 Error

C:\java>










thanks,


Thufir

.