----- Original Message ----- From: <[EMAIL PROTECTED]> To: <nant-users@lists.sourceforge.net> Sent: Monday, August 22, 2005 6:59 PM Subject: [Nant-users] "if" attribute on mkdir ignored
> I am running RC3 and the following build source fails: > > <?xml version="1.0" encoding="utf-8" ?> > <project name="HotKey" default="build"> > <target name="build" > > <property name="empty" value="" /> > <echo message="length of empty = > ${string::get-length(empty)}" /> > <mkdir dir="${empty}" > if="${string::get-length(empty) != 0}" /> > <echo message="It worked"/> > </target> > </project> > > I get the following output: > > NAnt 0.85 (Build 0.85.1932.0; rc3; 4/16/2005) > Copyright (C) 2001-2005 Gerry Shaw > http://nant.sourceforge.net <http://nant.sourceforge.net> > > Buildfile: file:///C:/Projects/Eden4All/test.build > <file:///C:/Projects/Eden4All/test.build> > Target framework: Microsoft .NET Framework 1.1 > Target(s) specified: build > > > build: > > [echo] length of empty = 0 > > BUILD FAILED > > C:\Projects\Eden4All\test.build(6,4): > An empty string is not a valid value for attribute 'dir' of <mkdir > ... />. > > Total time: 0 seconds. > > I checked the bug list and did not find this listed. There is a similar bug > relating to <asminfo> and if/unless. > > 1) Has this been fixed in a recent nightly build? > 2) If not, do you want me to enter bug at sourceforge? > > I can work around for now by embedding <mkdir> in an <if> block. The value of the if/unless attribute is not evaluated before the initialization of other attributes or child elements, hence you still get build errors when you specify invalid values for these other attributes. I'm not sure if this is something we should change. Gert ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Nant-users mailing list Nant-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users