ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul King <pa...@asert.com.au>
Subject Re: [ANN] Apache AntUnit 1.0 Beta 1 Released
Date Sat, 23 Sep 2006 16:19:16 GMT
> The Ant Team is proud to announce the first Beta release of
> Apache AntUnit 1.0.

Sorry I have a question that is half Groovy and half AntUnit related.
It is also half user/half dev related. I am wanting to know the best
way to use the API (and potentially some normally internal pieces).

I was trying to create an AntUnit example with Groovy - mainly just
to check out some namespace support which has just been added to
Groovy's AntBuilder and currently have the following example working:

  import org.apache.tools.ant.taskdefs.Antlib
  def ant = new AntBuilder()
  def url = this.class.getResource('org/apache/ant/antunit/antlib.xml')
  Antlib.createAntlib(ant.project, url,
    'antlib:org.apache.ant.antunit').execute()
  ant.assertFileDoesntExist(file:'copytest1.tmp')
  ant.copy(file:'antunit.groovy', tofile:'copytest1.tmp')
  ant.assertFileExists(file:'copytest1.tmp')
  ant.delete(file:'copytest1.tmp')

Groovy includes an AntBuilder class which allows Ant build files to
be expressed as Groovy notation. It also has its own lifecycle which
I guess is bootstrapped slightly differently to the normal launcher.
I am not asking this group about the Groovy side of things but I
am interested in an opinion on what is the best way to do this
from an Ant perspective.

Does the "Antlib.createAntlib" part look like a violation of what
I should be doing from an Ant perspective? AntBuilder doesn't normally
involve explicitly creating anything equivalent to the project or
target - these are done under the covers.

Also, I was expecting to have to muck around with namespaces but they
just dissappeared from the example at the moment. (Not sure this is a
good thing or not.)

Cheers, Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message