> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Giuseppe Greco
> Sent: woensdag 1 december 2004 8:09
> To: Gert Driesen
> Cc: [EMAIL PROTECTED]
> Subject: [Nant-users] <call> task
> 
> Hi Gert,
> 
> I've looked at this deeply and stated the problem was
> due to my huge ignorance!
> 
> Look at this build file:
> 
> <project name="target-test" default="build">
>   <property name="my.dir" value="mydir" />
>   <property name="my.file" value="myfile.cs" />
> 
>   <target name="build">
>     <mkdir dir="${my.dir}" failonerror="false" />
>   <touch file="${my.dir}/${my.file}" />
> 
>   <call target="myFileExists"
>     if="${file::exists('${my.dir}/${my.file}')}" />
> 
>   <delete file="${my.dir}/${my.file}" />
> 
>   <call target="myFileDoesNotExist"
>     unless="${file::exists('${my.dir}/${my.file}')}" />
>         </target>
> 
>   <target name="myFileExists">
>     <echo message="${target::get-current-target()} executed" />
>   </target>
> 
>   <target name="myFileDoesNotExist">
>     <echo message="${target::get-current-target()} executed" />
>   </target>
> </project>
> 
> Do you see something wrong? YES! The parameter passed to the
> file::exists() function in the <call> tasks is absolutely WRONG!
> When using properties as function parameters, one shouldn't enclose
> them in single quotes and curly braces... so the correct <call>
> tasks should look like these:
> 
>   <call target="myFileExists"
>     if="${file::exists(my.dir + '/' + my.file)}" />
>   ...
>   <call target="myFileDoesNotExist"
>     unless="${file::exists(my.dir + '/' + my.file)}" />
> 
> I'm really sorry for that,

No problem at all, glad its working for you now.

Gert



-------------------------------------------------------
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-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to