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,
j3d.

----------------------------------------
Giuseppe Greco

::agamura::

phone:  +41 (0)91 604 67 65
mobile: +41 (0)79 602 99 27
email:  [EMAIL PROTECTED]
web:    www.agamura.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-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to