You can put as many tasks within the <if> as you want.
I was experimenting with different forms of the test.  In fact, I
removed the <ifnot> tests that I had in the script.

Noel

-----Original Message-----
From: Burton, Kevin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 29, 2004 10:52 AM
To: Gifford, Noel; Merrill Cornish; [EMAIL PROTECTED]
Subject: RE: [Nant-users] <if> not evaluated?

So can <if> only surround one task? I notice that you have <if> around
each of the <echo> tasks. I have an <if> that surrounds both <echo> and
<csc>.

Kevin

-----Original Message-----
From: Gifford, Noel [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 29, 2004 12:47 PM
To: Merrill Cornish; Burton, Kevin; [EMAIL PROTECTED]
Subject: RE: [Nant-users] <if> not evaluated?


Kevin,

The following script works for your question:


<project name="Test" default="Test">

    <property name="project.config" value="debug" />

    <target name="Test">
        <if test="${property::exists('project.config') and
string::to-lower(project.config) = 'debug'}" verbose="true">
            <echo message="if -- exists and correct"/>
        </if>
        <if test="${string::to-lower(project.config)='debug'}" >
            <echo message="if -- value correct" />
        </if>
    </target>

</project>

C:\Projects\NANT-0~1.85->bin\nant /f:Test.build
NAnt 0.85 (Build 0.85.1664.0; net-1.0.win32; nightly; 7/22/2004)
Copyright (C) 2001-2004 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///C:/Projects/NANT-0~1.85-/Test.build
Target(s) specified: Test


Test:

     [echo] if -- exists and correct
     [echo] if -- value correct

Build succeeded

Total time: 0.1 seconds.


Noel

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Merrill
Cornish
Sent: Thursday, July 29, 2004 10:30 AM
To: Burton,Kevin; [EMAIL PROTECTED]
Subject: Re: [Nant-users] <if> not evaluated?

>>> property::exists(project.config)

I think what you want is property::exists('project.config').  Otherwise,
you are checking the existence of the property NAMED in the value of the
project.config property.

Merrill


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to