25 Mar 2004 19:43
Re: GroovyMarkup with Ant and JUnit
On 25 Mar 2004, at 18:14, Mike Clark wrote:
> Howdy,
>
> I'm using GroovyMarkup to script Ant tasks. So I have a Build class
> that defines a few methods, like so:
>
> ----
>
> void compileTests() {
>
> ant.javac(srcdir:"test",
> destdir:"classes",
> classpath:classpath())
> }
>
> void test() {
>
> compileTests()
>
> ant.junit(haltonfailure:true) {
> test(name:"com.xyz.MyTest")
> }
> }
>
> ----
>
> Calling "ant.javac" in the compileTests() method works brilliantly.
> (I heart not having to type angle brackets!)
Me too! :)
There's something refreshing about scripting Ant inside a scripting
language, rather than putting a scripting language inside CDATA
sections inside XML.
> Calling "ant.junit" in the test() method, however, gives me:
>
> Mar 25, 2004 11:10:28 AM groovy.util.AntBuilder createNode
> WARNING: Could not convert tag: junit into an Ant task, data type or
> property
> Mar 25, 2004 11:10:28 AM groovy.util.AntBuilder createNode
> WARNING: Could not convert tag: test into an Ant task, data type or
> property
>
> Am I missing something obvious, or is this just a limitation of
> GroovyMarkup at this point?
I think there's some issue here with the AntBuilder - i.e. its not
quite figured out how to instantiate the Ant task correctly. The
protocol to instantiate Ant tasks is surprisingly wierd & complex &
bizarre and does change from time to time - it might just need some
jiggery pokery in the AntBuilder class to press the right Ant buttons
to instantiate the Task.
So its nothing to do with GroovyMarkup - its just a kink in our
AntBuilder support. Someone else reported an issue with something else
in Ant 1.6 - will try take a look shortly.
James
-------
http://radio.weblogs.com/0112098/
RSS Feed