Hi Johannes,

NAnt will not resolve PlatformID.Unix to its enum value.

You can use this instead:

        
${operating-system::get-platform(environment::get-operating-system())=='Unix
'}

        However, this will only work if you're running NAnt on .NET 2.0 and
higher (or Mono 2.0 profile).

Or, you can use this:

        ${platform::is-unix()}

        This will work on all CLR's.

May I ask why you need to know the (class)path separator?

Have you tried using the <path> element:
http://nant.sourceforge.net/release/latest/help/types/path.html

Gert

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Johannes
Luber
Sent: zaterdag 22 december 2007 16:48
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Help with property needed

Hi!

I've been trying to set a property dependent on the OS nant is running on,
but so far I've failed. I can't get this to work:

<if
unless="${      (environment::get-operating-system())==PlatformID.Unix}">
        <property name="java.classpath.separator"       value=";"/>
</if>
<if
if="${operating-system::get-platform(environment::get-operating-system())==P
latformID.Unix}">
        <property name="java.classpath.separator"       value=":"/>
</if>

I always receive "Property evaluation failed." as error message. Can someone
help me?

Thanks in advance,
Johannes

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges.
Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to