final GroovyShell groovy = new GroovyShell(classLoader, new Binding(), configuration);This behavior was unexpected since it does not follow the normal Ant convention and because the documentation states the src attribute is a File containing Groovy statements rather than stating it expects a Groovy Script.
final Script script = groovy.parse(txt, scriptName);
script.setProperty("ant", new AntBuilder(this));
// code removed for brevity
Monday, March 10, 2008
Groovy Ant task is for Groovy Scripts
Groovy includes an Ant task for executing either file based or embedded Groovy. I recently discovered the file option denoted by the src attribute must be a Groovy script and not a Groovy class containing a main method. If you have used the Java task, you might expect the Ant arg set to be passed as a parameters to the main method since it is the common Ant convention for passing command line arguments. However, as you can see in the following snippet of code from org.codehaus.groovy.ant.Groovy, a GroovyShell is created and the args are passed as a property to the script.
In May of 2009, I wrote the blog post The Ultimate Enterprise Java Build Solution . Over the past 7 years since I wrote the post I have help...
Class loading issues are a common frustration for many Java developers. The dreaded java.langClassNotFoundException means they can forget a...
In your Grails development with Eclipse, if you have ever used the Run Launch configuration provided by Grails or followed Add domain classe...
Early in my career I took on the role of setting up and operating the build infrastructure of many of the projects I have consulted on. I st...