Hi Curtis,

With functions you can do something like the following:

    <property name="config.list" value="web,machine" />

    <property name="web.compilation" value="true"/>
    <property name="web.target" value="debug"/>
    <property name="web.failonerror" value="true"/>

    <property name="machine.compilation" value="true"/>
    <property name="machine.target" value="batch"/>
    <property name="machine.failonerror" value="true"/>

    <foreach item="String" in="${config.list}" delim="," trim="Both"
property="config.file">
        <echo message="Group: ${config.file}"/>
        <echo message="Group compilation:
[${property::get-value(config.file + '.compilation)}]"/>
        <echo message="Group compilation:
[${property::get-value(config.file + '.target)}]"/>
        <echo message="Group compilation:
[${property::get-value(config.file + '.failonerror)}]"/>
    </foreach>

There may be a little bit of tweaking in the code above, but hopefully
it gives you an idea of what can be done (and if it is what you need).
The nightly builds are just linked to off of the project site:
        http://nant.sourceforge.net/


Cheers,


Clayton

> -----Original Message-----
> From: Scott Hernandez [mailto:[EMAIL PROTECTED] 
> Sent: May 10, 2004 12:53 PM
> To: Curtis Zarger; [EMAIL PROTECTED]
> Subject: Re: [Nant-users] calling a task multiple times
> 
> 
> Use a <foreach /> line if you are dealing with a file. You 
> can specify an arbitrary number of matches on a line by the 
> delim string; I do believe. You can also nest the <foreach> 
> if that doesn't work. If you are good with regular 
> expressions[1] you could split up the line that way. There 
> are really endless suggestions. You can also write a custom 
> <script> to do it.
> 
> <foreach item="Line" in="touples.csv" delim="," property="x,y,z">
>     <echo message="Read touple ${x}.${y}=${z}" />
> </foreach>
> 
> 1.] http://nant.sourceforge.net/nightly/help/tasks/regex.html
> 
> ----- Original Message ----- 
> From: "Curtis Zarger" <[EMAIL PROTECTED]>
> To: "'Scott Hernandez'" <[EMAIL PROTECTED]>; 
> <[EMAIL PROTECTED]>
> Cc: "Curtis Zarger" <[EMAIL PROTECTED]>
> Sent: Monday, May 10, 2004 11:52 AM
> Subject: RE: [Nant-users] calling a task multiple times
> 
> 
> > Scott,
> >
> > THX for the reply.  I've tried the foreach task.  My 
> problem there is 
> > that the 'property' attribute only handles 2 values (ie name-value 
> > pair).  I
> need
> > 4.
> >
> > What I am trying to do is make configuration changes, via 
> edits to XML 
> > files.  To do that requires 4 values (file name, element name, 
> > attribute name, attribute value).  The foreach capability to read 
> > lines from a file works great, but only supports two 
> values, .... or 
> > multiple values of a single property as in your example.
> >
> > My example 'lines' in a file might look like this:
> >
> > Web.config,compilation,debug.false
> > Machine.config,compilation,batch,true
> >
> > This would define two separate XML file edits.
> >
> > Any thoughts?  I am unfamiliar with what you call the 
> 'functions stuff 
> > in the nightly builds'.  Can you point me to that?
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by Sleepycat Software
> Learn developer strategies Cisco, Motorola, Ericsson & Lucent 
> use to deliver higher performing products faster, at low TCO. 
> http://www.sleepycat.com/telcomwpreg.php?> From=osdnemail3
> 
> 
> _______________________________________________
> Nant-users mailing list
> [EMAIL PROTECTED] 
> https://lists.sourceforge.net/lists/listinfo/n> ant-users
> 


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to