Title: Lazy evaluation of properties - is it possible?

Hi,

I thought I saw somewhere in the doc or various articles that you could tell NAnt to do a lazy eval of a property, but I can't find this in a doc search this morning.

What I am doing is setting one property to a certain value (e.g. a path), then setting a second property to a value that contains the first property (e.g. extending the path). Later I have a target that modifies the first property. Finally, I use the second property, after the first has been modified, and I'd like the second property to evaluate using the new value of the first property.

After that confusing description I have a simple example:

        <property name="config" value="Release"/>
        <property name="out.path" value="./project/bin/${config}"/>
       
        <target name="setDebug">
                <property name="config" value="Debug"/>
        </target>

        <target name="test">
                <echo message="config = ${config}" />
                <echo message="out.path = ${out.path}" />
        </target>


when I run 'NAnt.exe test' I get:
   test:
     [echo] config = Release
     [echo] out.path = ./project/bin/Release

when I run 'NAnt.exe setDebug test' I get:
   setDebug:
   test:
     [echo] config = Debug
     [echo] out.path = ./project/bin/Release

I'd like for ${out.path} to be evaluated when I use it, rather than when I define it such that it outputs:
     [echo] out.path = ./project/bin/Debug

Can I delay a property's evaluation in any fashion?

Thanks,
 - Josh

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to