You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by teknokrat <te...@yahoo.com> on 2007/02/12 21:04:33 UTC
how do i use propertyfile on windows?
When ever I use the propertyfile task to add a filepath on windows it
escapes the colon in front of the drive e.g. c:/ turns to c\:/ which
completely messes up the path. How do I make it stop escaping characters?
thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: how do i use propertyfile on windows?
Posted by teknokrat <te...@yahoo.com>.
Anderson, Rob (Global Trade) wrote:
>> -----Original Message-----
>> From: news [mailto:news@sea.gmane.org] On Behalf Of teknokrat
>> Sent: Monday, February 12, 2007 12:05 PM
>> To: user@ant.apache.org
>> Subject: how do i use propertyfile on windows?
>>
>> When ever I use the propertyfile task to add a filepath on
>> windows it escapes the colon in front of the drive e.g. c:/
>> turns to c\:/ which completely messes up the path. How do I
>> make it stop escaping characters?
>>
>> thanks
>>
>
> I would suggest using a properties file in the same directory as the
> build.xml that contains the path to the other properties file. Some this
> like this...
>
> buld.properties
> ================
> some.other.properties=C:\Path\To\Other.properties
>
> build.xml
> ================
> ...
> <property file="build.properties"/>
> <property file="${some.other.properties}"/>
> ...
>
> -Rob Anderson
I need to be able to dynamically generate those paths
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: how do i use propertyfile on windows?
Posted by Steve Loughran <st...@apache.org>.
teknokrat wrote:
> Antoine Levy-Lambert wrote:
>> Hello teknokrat,
>>
>> the fact that c:/ is written as c\:/ in a property file belongs to the
>> spec of properties in Java. The : character is always escaped in
>> property files.
>>
>> Do you use the property file that you generate using <propertyfile/>
>> also with a Java program, or is it consumed by something else, such as
>> a shell script ?
>>
>> Regards,
>>
>> Antoine
>> -------- Original-Nachricht --------
>> Datum: Mon, 12 Feb 2007 14:08:18 -0800
>> Von: "Anderson, Rob (Global Trade)" <Ro...@nike.com>
>> An: "Ant Users List" <us...@ant.apache.org>
>> CC: Betreff: RE: how do i use propertyfile on windows?
>>
>>>> -----Original Message-----
>>>> From: news [mailto:news@sea.gmane.org] On Behalf Of teknokrat
>>>> Sent: Monday, February 12, 2007 12:05 PM
>>>> To: user@ant.apache.org
>>>> Subject: how do i use propertyfile on windows?
>>>>
>>>> When ever I use the propertyfile task to add a filepath on windows
>>>> it escapes the colon in front of the drive e.g. c:/ turns to c\:/
>>>> which completely messes up the path. How do I make it stop escaping
>>>> characters?
>>>>
> It is consumed by another program
well, I'm afraid that you can't use propertyfile, which uses
java.util.properties. The examples in the manual show how : chars get
prefixed -this is by design in java classes.
why not just use <echo> to print something to a file?
-steve
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: how do i use propertyfile on windows?
Posted by teknokrat <te...@yahoo.com>.
Antoine Levy-Lambert wrote:
> Hello teknokrat,
>
> the fact that c:/ is written as c\:/ in a property file belongs to the spec of properties in Java. The : character is always escaped in property files.
>
> Do you use the property file that you generate using <propertyfile/> also with a Java program, or is it consumed by something else, such as a shell script ?
>
> Regards,
>
> Antoine
> -------- Original-Nachricht --------
> Datum: Mon, 12 Feb 2007 14:08:18 -0800
> Von: "Anderson, Rob (Global Trade)" <Ro...@nike.com>
> An: "Ant Users List" <us...@ant.apache.org>
> CC:
> Betreff: RE: how do i use propertyfile on windows?
>
>>> -----Original Message-----
>>> From: news [mailto:news@sea.gmane.org] On Behalf Of teknokrat
>>> Sent: Monday, February 12, 2007 12:05 PM
>>> To: user@ant.apache.org
>>> Subject: how do i use propertyfile on windows?
>>>
>>> When ever I use the propertyfile task to add a filepath on
>>> windows it escapes the colon in front of the drive e.g. c:/
>>> turns to c\:/ which completely messes up the path. How do I
>>> make it stop escaping characters?
>>>
>>> thanks
>>>
>> I would suggest using a properties file in the same directory as the
>> build.xml that contains the path to the other properties file. Some this
>> like this...
>>
>> buld.properties
>> ================
>> some.other.properties=C:\Path\To\Other.properties
>>
>> build.xml
>> ================
>> ...
>> <property file="build.properties"/>
>> <property file="${some.other.properties}"/>
>> ...
>>
>> -Rob Anderson
>>
>>
It is consumed by another program
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: RE: how do i use propertyfile on windows?
Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello teknokrat,
the fact that c:/ is written as c\:/ in a property file belongs to the spec of properties in Java. The : character is always escaped in property files.
Do you use the property file that you generate using <propertyfile/> also with a Java program, or is it consumed by something else, such as a shell script ?
Regards,
Antoine
-------- Original-Nachricht --------
Datum: Mon, 12 Feb 2007 14:08:18 -0800
Von: "Anderson, Rob (Global Trade)" <Ro...@nike.com>
An: "Ant Users List" <us...@ant.apache.org>
CC:
Betreff: RE: how do i use propertyfile on windows?
> > -----Original Message-----
> > From: news [mailto:news@sea.gmane.org] On Behalf Of teknokrat
> > Sent: Monday, February 12, 2007 12:05 PM
> > To: user@ant.apache.org
> > Subject: how do i use propertyfile on windows?
> >
> > When ever I use the propertyfile task to add a filepath on
> > windows it escapes the colon in front of the drive e.g. c:/
> > turns to c\:/ which completely messes up the path. How do I
> > make it stop escaping characters?
> >
> > thanks
> >
>
> I would suggest using a properties file in the same directory as the
> build.xml that contains the path to the other properties file. Some this
> like this...
>
> buld.properties
> ================
> some.other.properties=C:\Path\To\Other.properties
>
> build.xml
> ================
> ...
> <property file="build.properties"/>
> <property file="${some.other.properties}"/>
> ...
>
> -Rob Anderson
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: how do i use propertyfile on windows?
Posted by "Anderson, Rob (Global Trade)" <Ro...@nike.com>.
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of teknokrat
> Sent: Monday, February 12, 2007 12:05 PM
> To: user@ant.apache.org
> Subject: how do i use propertyfile on windows?
>
> When ever I use the propertyfile task to add a filepath on
> windows it escapes the colon in front of the drive e.g. c:/
> turns to c\:/ which completely messes up the path. How do I
> make it stop escaping characters?
>
> thanks
>
I would suggest using a properties file in the same directory as the
build.xml that contains the path to the other properties file. Some this
like this...
buld.properties
================
some.other.properties=C:\Path\To\Other.properties
build.xml
================
...
<property file="build.properties"/>
<property file="${some.other.properties}"/>
...
-Rob Anderson
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org