ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Mark Bram <relaxed...@optusnet.com.au>
Subject Re: Pathconvert question - yes SOLVED
Date Tue, 22 Jun 2004 03:42:13 GMT
OK, I get it now.. thank you very much Diane and all else on the list..

<!--  Which dir did you install Jini to? -->
<property name="jiniHome" location="C:\java\jini2_0_001"/>

<path id="jini.jarfiles.path">
<filelist id="jini.jarfiles"
dir="${jiniHome}/lib"
files="jini-core.jar,
jini-ext.jar,
sun-util.jar" />
</path>

<pathconvert dirsep="${file.separator}" pathsep="${path.separator}"
property="jinifiles" refid="jini.jarfiles.path"/>


And then to allow for jiniHome on multiple OS's, I can use property 
files..
<property file="${os.name}.properties"/>
<property file="default.properties"/>

where I can have Linux.properties and Windows.properties and they would 
each specify there own jiniHome..

Now I am satisfied - having learnt some new things today!

Rob
:)


> --- Robert Mark Bram <relaxedrob@optusnet.com.au> wrote:
>> Hi All!
>>
>> In the docs for the pathconvert task, it says that targetos is required
>> *unless* "pathsep and/or dirsep are specified".
>
> You've misinterpreted what the pathSep is in the case of <pathconvert>. 
> It
> doesn't have to be the separator for path-type vars (eg., : or ;) -- it
> can be whatever you want. See Example 3 in the docs.
>
> Also, ${file.separator} and ${path.separator} are available to use --
> they'll resolve to what's appropriate for the current platform (if memory
> serves -- it's been quite awhile since I've used Ant).
>
> Diane
>
> --- relaxedrob@optusnet.com.au wrote:
>> Hi All,
>>
>> I should have tested further - using multiple
>> pathconvert tasks does NOT work - instead it
>> concatenates values together!
>>
>> For example:
>> <path id="jiniHome.windows">
>>    <pathelement path="C:\java\jini2_0_001"/>
>> </path>
>> <path id="jiniHome.unix">
>>    <pathelement path="/usr/local/java/jini2_0_001"/>
>> </path>
>>
>> and
>>
>> <pathconvert targetos="windows" property="jiniHome"
>> refid="jiniHome.windows"/>
>> <pathconvert targetos="unix" property="jiniHome"
>> refid="jiniHome.unix"/>
>>
>> Outputs the following for ${jiniHome}:
>> \BigBrain3\java\JiniHelloWorld\C;\java\jini2_0_001
>>
>> :-/ This is terrible!
>>
>> Rob
>> :)
>>
>> > relaxedrob@optusnet.com.au wrote:
>> >
>> > Hi All!
>> >
>> > Please ignore my question - I didn't realise that you
>> can have more
>> > than one
>> > pathconvert tasks for each OS:
>> >	<pathconvert targetos="windows"
>> property="jinifiles"
>> > refid="jini.jarfiles.path"/>
>> >	<pathconvert targetos="unix"
>> property="jinifiles"
>> > refid="jini.jarfiles.path"/>
>> >
>> > It works wonderfully!
>> >
>> > Rob
>> > :)
>> >
>> >
>> >
>> > > Robert Mark Bram <relaxedrob@optusnet.com.
>> au> wrote:
>> > >
>> > > Hi All!
>> > >
>> > > In the docs for the pathconvert task, it says that
>> targetos is
>> > > required
>> > > *unless* "pathsep and/or dirsep are specified".
>> > > The docs for pathsep and dirsep say they are not
>> required because
>> > > they
>> > > default to current JVM File.pathSeparator and
>> JVM File.separator
>> > > respectively.
>> > >
>> > > So I tried the following:
>> > >
>> > > <path id="jini.jarfiles.path">
>> > > <filelist id="jini.jarfiles"
>> > > dir="${jiniHome}/lib"
>> > > files="jini-core.jar,
>> > > jini-ext.jar,
>> > > sun-util.jar" />
>> > > </path>
>> > > <pathconvert property="jinifiles" refid="jini.jarfiles.
>> path"/>
>> > >
>> > > and got this error:
>> > > BUILD FAILED
>> > > E:\java\JiniHelloWorld\bin\build.xml:123: You
>> must specify at least
>> > > one of
>> > > targetOS, dirSep, or pathSep
>> > >
>> > > I was hoping to avoid specifying targetos, pathsep
>> and dirsep to
>> > keep
>> > > this
>> > > script as portable as possible.. otherwise I will
>> have to write
>> > > different
>> > > versions of pathconvert for every OS I hope to
>> support and *then*
>> > put
>> > > in
>> > > some decision making structure in my targets that
>> use the converted
>> > > path!
>> > >
>> > > Any advice would be most welcome!
>> > >
>> > > Rob
>> > > :)
>> > >
>> > >
>> > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: user-unsubscribe@ant.
>> apache.org
>> > > For additional commands, e-mail: user-help@ant.
>> apache.org
>> > >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@ant.
>> apache.org
>> > For additional commands, e-mail: user-help@ant.
>> apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
>
> =====
> (holtdl@yahoo.com)
>
>



-- 
Robert Mark Bram
B.Comp.(Systems Development/Business Systems)
B.Net.Comp.(Hons)
Doctor of Philosophy Student

School of Network Computing
Faculty of Information Technology
Monash University
Peninsula Campus
McMahons Rd
Frankston, VIC 3199
AUSTRALIA

Phone:  61 3 9904 4394
Facsimile:  61 3 9904 4124
Email: robert.bram@infotech.monash.edu.au

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message