ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject AW: How to organize project properties.
Date Wed, 08 Sep 2004 05:09:04 GMT
The source distro contains an "embed" directory [1] where someone played
(a long time ago) with iterating over xml using xpath. What it does:
- create a new PropertyHelper (datatype)
- register that (using a task)
- use a special property syntax
  ${  prefix  :  xmldocument  /  xpath}

Last year (or so) I played with that and got good results. Last time when
I did that I got only errors. But I havent spent more time on that, so I
dont know if it works any more ... but you should have a look

A complete different way would be trying to create a list of values 
(value1;value2;...) so you could use AntContribs for/foreach task. Maybe you
could print out the props into a file using <echoproperties> with prefix,
using <replaceregexp> for changing the ${line.separator} to ";" ...



> -----Urspr√ľngliche Nachricht-----
> Von:
> []
> Gesendet am: Mittwoch, 8. September 2004 00:38
> An:
> Betreff: How to organize project properties.
> This is more of a data organization question rather than ant question.
> I want to keep all configuration data in a sepreate properties file. 
> either plain text or preferably XML.
> say for plain text
> #sys-name java-src jsp-src java-dest jsp-comp-dest
> system1 /proj1/src /proj1/jsp /proj1/classes /proj1/servlets
> system2 /proj2/src /proj2/jsp /proj2/classes /proj2/servlets
> The XML file can be something like
> <systems>
> <system value="system1">
>         <java-src value="/proj1/src" />
>         ....
> </system>
> <system...
> </system>
> </systems>
> Now my main build script should either iterate over the 
> entire set or a 
> specified set or a single system and 
> carry out certain sequential tasks.
> I have tried to use <xmlproperty> task to initialise, but how do I 
> iterate. for e.g.
> in first loop the property should be 
> /proj1/src , 
> while in second iteration it
> should be /proj2/src.
> Is this doable, any other alternatives that you may have implemented ?
> thanks
> bhaskar
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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