ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Free-form ANT Task Structure
Date Tue, 20 May 2003 16:17:57 GMT
Centipede as a <dom> task I think, and I also created one myself a long time
ago... Mine (a DataType) was creating a DOM DocumentFragment, that you could
then use internally, pass on to other classes, or serialize. I believe both
use DynamicConfigurator. Regards, --DD

<project default="test">

  <typedef name="xmlfragment"
           classname="org.apache.tools.ant.types.XmlFragment" />

  <xmlfragment id="root">
    <level1 attr="toto">
      <level2/>
    </level1>
  </xmlfragment>

  <target name="test">
    <property name="root" refid="root" />
    <echo message="Coucou ;-) root=${root}" />
  </target>

</project>
 
> -----Original Message-----
> From: peter reilly [mailto:peter.reilly@corvil.com]
> Sent: Tuesday, May 20, 2003 11:18 AM
> To: Ant Developers List
> Subject: Re: Free-form ANT Task Structure
> 
> To embed the config information, the easiest
> is to map the info to objects.
> 
> Ant introspection is very powerfull and easy
> to use for normal java data object.
> 
> Alternatively one can use the DynamicConfigurator
> interface. This provides the name of the unknown element
> and the name/value of unknown attributes.
> 
> Peter
> 
> On Tuesday 20 May 2003 16:18, Berin Loritsch wrote:
> > I want to write a task that allows me to embed XML configuration
> > information to set up some integration tests using JUnit as a
> > base.
> >
> > I can live with a DOM or JDOM to interpret and transform into my
> > configuration objects.  The concept is based on some work I originally
> > did to extend JUnit for testing Avalon components.  The thing is
> > that I want to change the way the JUnit test runner works so that
> > I can preload my Avalon container with the proper components,
> > and I can iterate through all the implementations of a component
> > with the same test against it.
> >
> > In order for this to happen properly, I need to pass configuration
> > information to the container.  The two options I have is to require
> > the configuration as a separate file, or to allow the configuration
> > to be embedded in the ANT task.
> >
> > I would prefer to have the config embedded so that I can work on
> > things one step at a time.  Otherwise--I have to resort to the
> > file approach.
> >
> > What are your thoughts?  Is it too much to ask for free-form
> > elements as a sub of a task, or do they HAVE to map to objects?
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org

Mime
View raw message