I'm using a groovy code snippet in an ant build file. Inside the groovy code I'm trying to reference a fileset that has been defined outside of the groovy part, like this:
<target name="listSourceFiles" >
<fileset id="myfileset" dir="${my.dir}">
<patternset refid="mypatterns"/>
</fileset>
<groovy>
def ant = new AntBuilder()
scanner = ant.fileScanner {
fileset(refid:"myfileset")
}
...
</groovy>
</target>
When I execute this I get the following error message:
Buildfile: build.xml
listSourceFiles:
[groovy]
BUILD FAILED
d:\workspace\Project\ant\build.xml:13:
Reference myfileset not found.
What am I missing?