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...
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...
Like many people, I was a little disappointed by some of the glaring omissions from the Apple iPad announcement. However, as somebody who de...
I was disappointed to discover the iPhone SDK did not include a Checkbox component. Yes, I know there is the UISwitch component. But sometim...