I'm running Build 0.85.1732.0.  The following simple
script:

<!----------------------snip---------------------->

<?xml version="1.0"?>
<project name="Test" default="go">

   <property name="preTarget" value="do1"
unless="${property::exists('preTarget')}" />

   <target name="do1">
     <echo message="I am in ${preTarget}" />
   </target>

   <target name="do2">
     <echo message="I am in ${preTarget}" />
   </target>

   <target name="go" depends="${preTarget}">
     <echo message="The value of preTarget is:
${preTarget}" />
   </target>
</project>


<!-------------------end snip--------------------->

works for passing in the argument for "preTarget", but
not for using the default setting for "preTarget". 
Here is the output:

<!----------------------snip---------------------->
D:\>nant -f:Test.build -D:preTarget=do1
NAnt 0.85 (Build 0.85.1732.0; net-1.0.win32; nightly;
9/28/2004)
Copyright (C) 2001-2004 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///D:/Test.build
Target(s) specified: go


do1:

     [echo] I am in do1

go:

     [echo] The value of preTarget is: do1

BUILD SUCCEEDED

Total time: 0.1 seconds.


D:\>nant -f:Test.build
NAnt 0.85 (Build 0.85.1732.0; net-1.0.win32; nightly;
9/28/2004)
Copyright (C) 2001-2004 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///D:/Test.build
Target(s) specified: go


BUILD FAILED

D:\Test.build(14,5):
Property evaluation failed.
Expression: ${preTarget}
              ^^^^^^^^^
    Property 'preTarget' has not been set.

Total time: 0 seconds.

<!-------------------end snip--------------------->

Is my syntax correct?  Any help?

Thanks,
Eric


                
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to