ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bailey, Darragh" <dbai...@hp.com>
Subject RE: Better alternative than using foreach, for and if/then/else?
Date Fri, 07 May 2010 10:46:00 GMT


> -----Original Message-----
> From: Stefan Bodewig [mailto:bodewig@apache.org] 
> Sent: 06 May 2010 04:39
> To: user@ant.apache.org
> Subject: Re: Better alternative than using foreach, for and 
> if/then/else?
> 
> On 2010-05-05, Bailey, Darragh <dbailey@hp.com> wrote:
> 
> > 1) Is for/foreach the only real option for what I'm attempting to
> > accomplish here in building multiple end targets based on 
> the contents
> > of properties?
> 
> I'd recommend writing a custom task for this rather than trying to
> implement it in XML.  Using Ant's support for scripting engines you
> could implement that task inline - for example if compiling and
> deploying a Java task as part of the build process was too difficult.

That does seem to be the best solution at the moment, I was hoping that there would be a way
to accomplish this through adjusting how I was trying to use Ant.


> If you use Java6 you have all parts required to write tasks in
> JavaScript together.
> 
> There may be tricks to make things work with pure XML and the 
> antcontrib
> tasks, but I'm not convinced the result will be maintainable.
> 
> Stefan

Yeah, I think that a combination of for/foreach and some macrodefs could accomplish what I
want, but I'm not sure how well it can be maintained. I'll probably experiment with that before
building a custom task in Java, at the very least to have a comparison.


--
Regards,
Darragh Bailey

Systems Software Engineer
Hewlett Packard Galway Ltd.

Postal Address:    Hewlett Packard Galway Limited, Ballybrit Business Park, Galway
Registered Office: Hewlett Packard Galway Limited, 63-74 Sir John Rogerson's Quay Dublin 2
Registered Number: 361933 



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


Mime
View raw message