Hi Johannes,

(not replying inline: I wish Outlook would be more smart when it comes to
properly indenting the original message)

You'd actually use it like this:

<path id="antldr.classpath" >
        <pathelement
file="${path::combine(sharedlibs.dir,'antlr-v3.x.jar')}" />
        <pathelement
file="${path::combine(sharedlibs.dir,'stringtemplate-v3.x.jar')}" />
        <pathelement
file="${path::combine(sharedlibs.dir,'antlr-v3.x.jar')}" />
</path>

<exec program="javac">
        <arg value="-cp" />
        <arg>
                <path refid="antldr.classpath" />
        </arg>
</exec>

Or you can use it inline:

<exec program="javac">
        <arg value="-cp" />
        <arg>
                <path>
                        <pathelement
file="${path::combine(sharedlibs.dir,'antlr-v3.x.jar')}" />
                        <pathelement
file="${path::combine(sharedlibs.dir,'stringtemplate-v3.x.jar')}" />
                        <pathelement
file="${path::combine(sharedlibs.dir,'antlr-v3.x.jar')}" />
                </path>
        </arg>
</exec>

Note:

You use the "path" attribute of <pathelement> if you want to include an
existing PATH-like string (eg. the value of the CLASSPATH environment
variable).

Hope this helps,

Gert

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

Gert Driesen schrieb:
> 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.

Thanks, the latter is certainly more general.

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

I have the following property (new lines before the $ inserted for better
formatting):

<property name="antlr.classpath"
value="${path::combine(sharedlibs.dir,'antlr-v3.x.jar')}
${java.classpath.separator}
${path::combine(sharedlibs.dir,'stringtemplate-v3.x.jar')}
${java.classpath.separator}
${path::combine(sharedlibs.dir,'antlr-2.7.7.jar')}"/>

"${java.classpath.separator}" replaced ";" which doesn't work on Linux.
As I don't want different build files for each platform I require a way to
select the right separator.

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

I didn't know that there is a <path>-element. Unfortunately, I can't find a
use case for this. How do I reference this:

<path id="classpath-includes" >
        <pathelement
path="${path::combine(sharedlibs.dir,'antlr-v3.x.jar')}" />
        <pathelement
path="${path::combine(sharedlibs.dir,'stringtemplate-v3.x.jar')}" />
        <pathelement
path="${path::combine(sharedlibs.dir,'antlr-v3.x.jar')}" /> </path>

Thanks again!
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