ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ciramella, EJ" <>
Subject RE: Parsing task
Date Tue, 11 Feb 2003 21:53:18 GMT
Why not break these properties out into a property file?  Then you could
handle it one of two ways:

- have,,, etc and rename
them when doing the packaging (using a glob file mapper).

- or - 

- look at the optional task, PropertyFile (this allows you to modify a
property file).

-----Original Message-----
From: Chris Reeves []
Sent: Tuesday, February 11, 2003 4:44 PM
Subject: Parsing task

I've been searching for a task that would do a little parsing for seems I've seen this sort of thing before, but that may have
been a dream...

I have two ant xml files for my project - one builds the project
(build.xml), one runs the executable (run.xml) produced by the build;
this second file is simply bundled with the distribution.

It works great - except that the properties in the run.xml must be
changed on a per-environment basis (dev, stage, prod). And I only need
to change a couple of lines.

So, I'd like to have something like:

<!-- ========== mail properties ========== -->

<property name="to.address"
<property name="from.address"
<property name="smtp.server"

<property name="to.address"
<property name="from.address"
<property name="smtp.server"

<property name="to.address"
<property name="from.address"
<property name="smtp.server"

The end product should contain only the xml relevant for the environment
it was built for.

Also, I know I could run ant with a specific target that sets these
properties, but that means that all properties for all env's would be on
each system.

I suppose I could use xslt to alter the file, but it seems there should
be something easier. I scoured the Hatchet/Loughran book, but didn't
find what I was looking for. Any ideas?


Chris Reeves
Senior Software Developer
Medfusion, Inc.

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message