You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Steele, Richard" <ri...@steelezone.net> on 2011/02/01 14:53:52 UTC

Wisdom of using ":" in property name

For better or for worse, I'm using ":" as a separator character in my
property names as part of a set of reusable build files.  The part before
the ":" indicates which build file the property is defined in.

I've come across at least one incompatibility doing this, however, and that
is with the Bundlor tool (from SpringSource) for generating OSGi manifests.
The issue appears to be that Bundlor uses the ":" character for its own
purposes and is getting confused by my property naming convention.  I'm
faced with several choices:

1. Use something other than Bundlor, like bnd.
2. Work around or patch Bundlor to make it work with my property naming
convention.
3. Use some other naming convention (or none at all).

None of these choices are all that appealing, but if the Ant community says
something like "you're nuts, don't use : in property names" that will
obviously push me towards #3.

(If you're curious, I chose ":" both because the obvious choice of "."
wasn't distinct enough from many built-in property names, and because I also
use ":" in my target names.)

Thanks,
Rich

Re: Wisdom of using ":" in property name

Posted by Andreas Krey <a....@gmx.de>.
On Tue, 01 Feb 2011 13:48:52 +0000, Steele, Richard wrote:
...
> I think I really have no choice but to use "." as it's the only character
> guaranteed to work in Ant, various extensions and tools, property files, and
> command lines--unless someone has a better choice?

You may turn the colon onto its side and use ".." as separator.

> very large, reusable build "suites" broken into multiple separate build
> files?  (Beside switching tools, of course.  :-)

Embedding such tools in ant? :-) We do call make and leave only the
ivy stuff to ant.

Andreas

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


Re: Wisdom of using ":" in property name

Posted by "Steele, Richard" <ri...@steelezone.net>.
This is getting rather frustrating.  I was going to use "_" (the underscore)
until someone sent me a note saying that AntContrib doesn't like properties
with that in its name (especially with its foreach task).  To be honest I
don't care to relay on AntContrib but sometimes <foreach> really is a
life-saver.

Since I'm trying to create what is in essence a namespace for property names
(and not having much luck doing it), I wonder if this is something that Ant
should support naively, much like it does with target names and import.  Or
perhaps it's a scoping issue, and not a namespace issue: I want properties
which are private to a particular build file.

Someone else pointed out <local>, which I've been using in targets and
macrodefs (and it's awesome).  I didn't even think it could be used outside
of those blocks, but the documentation does say

Note that using the Local task at the global level effectively makes the
property local to the "anonymous target" in which top-level operations are
carried out; it will not be defined for other targets in the buildfile.

So I can use it in the top-level but it's not defined to targets and
macrodefs inside that buildfile?  It's close but not enough for what I'm
trying to accomplish.

I think I really have no choice but to use "." as it's the only character
guaranteed to work in Ant, various extensions and tools, property files, and
command lines--unless someone has a better choice?  What do others do with
very large, reusable build "suites" broken into multiple separate build
files?  (Beside switching tools, of course.  :-)

Sorry for griping.  Ant 1.8 has been a revelation to me and I've been able
to do so much more with so little I should have no reason to complain...

Thanks,
Rich


On Tue, Feb 1, 2011 at 1:07 PM, Steele, Richard <ri...@steelezone.net> wrote:

> This pretty much confirms that I shouldn't be using ":" in my property
> names.  (If I once knew that ":" could be used in property files, I don't
> remember it.)
>
> Thanks,
> Rich
>
>
> On Tue, Feb 1, 2011 at 10:41 AM, Stephen Connolly <
> stephen.alan.connolly@gmail.com> wrote:
>
>> Damn you Peter, you beat me to the punch!
>>
>> On 1 February 2011 14:41, Peter Reilly <pe...@gmail.com>
>> wrote:
>> > : and = and ' ' are used to separate the key from value in java property
>> files.
>> > so, not a good thing to use in property values.
>> >
>> > Peter
>> >
>> >
>> > On Tue, Feb 1, 2011 at 2:37 PM, Vimil Saju <vi...@yahoo.com> wrote:
>> >> you're nuts, don't use : in property names! :P
>> >>
>> >> --- On Tue, 2/1/11, Steele, Richard <ri...@steelezone.net> wrote:
>> >>
>> >>> From: Steele, Richard <ri...@steelezone.net>
>> >>> Subject: Wisdom of using ":" in property name
>> >>> To: user@ant.apache.org
>> >>> Date: Tuesday, February 1, 2011, 5:53 AM
>> >>> For better or for worse, I'm using
>> >>> ":" as a separator character in my
>> >>> property names as part of a set of reusable build
>> >>> files.  The part before
>> >>> the ":" indicates which build file the property is defined
>> >>> in.
>> >>>
>> >>> I've come across at least one incompatibility doing this,
>> >>> however, and that
>> >>> is with the Bundlor tool (from SpringSource) for generating
>> >>> OSGi manifests.
>> >>> The issue appears to be that Bundlor uses the ":" character
>> >>> for its own
>> >>> purposes and is getting confused by my property naming
>> >>> convention.  I'm
>> >>> faced with several choices:
>> >>>
>> >>> 1. Use something other than Bundlor, like bnd.
>> >>> 2. Work around or patch Bundlor to make it work with my
>> >>> property naming
>> >>> convention.
>> >>> 3. Use some other naming convention (or none at all).
>> >>>
>> >>> None of these choices are all that appealing, but if the
>> >>> Ant community says
>> >>> something like "you're nuts, don't use : in property names"
>> >>> that will
>> >>> obviously push me towards #3.
>> >>>
>> >>> (If you're curious, I chose ":" both because the obvious
>> >>> choice of "."
>> >>> wasn't distinct enough from many built-in property names,
>> >>> and because I also
>> >>> use ":" in my target names.)
>> >>>
>> >>> Thanks,
>> >>> Rich
>> >>>
>> >>
>> >>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
>

Re: Wisdom of using ":" in property name

Posted by "Steele, Richard" <ri...@steelezone.net>.
This pretty much confirms that I shouldn't be using ":" in my property
names.  (If I once knew that ":" could be used in property files, I don't
remember it.)

Thanks,
Rich

On Tue, Feb 1, 2011 at 10:41 AM, Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> Damn you Peter, you beat me to the punch!
>
> On 1 February 2011 14:41, Peter Reilly <pe...@gmail.com>
> wrote:
> > : and = and ' ' are used to separate the key from value in java property
> files.
> > so, not a good thing to use in property values.
> >
> > Peter
> >
> >
> > On Tue, Feb 1, 2011 at 2:37 PM, Vimil Saju <vi...@yahoo.com> wrote:
> >> you're nuts, don't use : in property names! :P
> >>
> >> --- On Tue, 2/1/11, Steele, Richard <ri...@steelezone.net> wrote:
> >>
> >>> From: Steele, Richard <ri...@steelezone.net>
> >>> Subject: Wisdom of using ":" in property name
> >>> To: user@ant.apache.org
> >>> Date: Tuesday, February 1, 2011, 5:53 AM
> >>> For better or for worse, I'm using
> >>> ":" as a separator character in my
> >>> property names as part of a set of reusable build
> >>> files.  The part before
> >>> the ":" indicates which build file the property is defined
> >>> in.
> >>>
> >>> I've come across at least one incompatibility doing this,
> >>> however, and that
> >>> is with the Bundlor tool (from SpringSource) for generating
> >>> OSGi manifests.
> >>> The issue appears to be that Bundlor uses the ":" character
> >>> for its own
> >>> purposes and is getting confused by my property naming
> >>> convention.  I'm
> >>> faced with several choices:
> >>>
> >>> 1. Use something other than Bundlor, like bnd.
> >>> 2. Work around or patch Bundlor to make it work with my
> >>> property naming
> >>> convention.
> >>> 3. Use some other naming convention (or none at all).
> >>>
> >>> None of these choices are all that appealing, but if the
> >>> Ant community says
> >>> something like "you're nuts, don't use : in property names"
> >>> that will
> >>> obviously push me towards #3.
> >>>
> >>> (If you're curious, I chose ":" both because the obvious
> >>> choice of "."
> >>> wasn't distinct enough from many built-in property names,
> >>> and because I also
> >>> use ":" in my target names.)
> >>>
> >>> Thanks,
> >>> Rich
> >>>
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>

Re: Wisdom of using ":" in property name

Posted by Stephen Connolly <st...@gmail.com>.
Damn you Peter, you beat me to the punch!

On 1 February 2011 14:41, Peter Reilly <pe...@gmail.com> wrote:
> : and = and ' ' are used to separate the key from value in java property files.
> so, not a good thing to use in property values.
>
> Peter
>
>
> On Tue, Feb 1, 2011 at 2:37 PM, Vimil Saju <vi...@yahoo.com> wrote:
>> you're nuts, don't use : in property names! :P
>>
>> --- On Tue, 2/1/11, Steele, Richard <ri...@steelezone.net> wrote:
>>
>>> From: Steele, Richard <ri...@steelezone.net>
>>> Subject: Wisdom of using ":" in property name
>>> To: user@ant.apache.org
>>> Date: Tuesday, February 1, 2011, 5:53 AM
>>> For better or for worse, I'm using
>>> ":" as a separator character in my
>>> property names as part of a set of reusable build
>>> files.  The part before
>>> the ":" indicates which build file the property is defined
>>> in.
>>>
>>> I've come across at least one incompatibility doing this,
>>> however, and that
>>> is with the Bundlor tool (from SpringSource) for generating
>>> OSGi manifests.
>>> The issue appears to be that Bundlor uses the ":" character
>>> for its own
>>> purposes and is getting confused by my property naming
>>> convention.  I'm
>>> faced with several choices:
>>>
>>> 1. Use something other than Bundlor, like bnd.
>>> 2. Work around or patch Bundlor to make it work with my
>>> property naming
>>> convention.
>>> 3. Use some other naming convention (or none at all).
>>>
>>> None of these choices are all that appealing, but if the
>>> Ant community says
>>> something like "you're nuts, don't use : in property names"
>>> that will
>>> obviously push me towards #3.
>>>
>>> (If you're curious, I chose ":" both because the obvious
>>> choice of "."
>>> wasn't distinct enough from many built-in property names,
>>> and because I also
>>> use ":" in my target names.)
>>>
>>> Thanks,
>>> Rich
>>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: Wisdom of using ":" in property name

Posted by Niklas Matthies <ml...@nmhq.net>.
On Tue 2011-02-01 at 14:41h, Peter Reilly wrote on user:
> : and = and ' ' are used to separate the key from value in java property files.

Only when they are unescaped, see
http://download.oracle.com/javase/6/docs/api/java/util/Properties.html#load%28java.io.Reader%29.

> so, not a good thing to use in property values.

Yeah, because of broken tools. ;)

(This reminds me of how Majordomo choked on slashes I used to have in
email address localparts, although having those is perfectly valid
according to RFC x822...)

-- Niklas Matthies

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


Re: Wisdom of using ":" in property name

Posted by Peter Reilly <pe...@gmail.com>.
: and = and ' ' are used to separate the key from value in java property files.
so, not a good thing to use in property values.

Peter


On Tue, Feb 1, 2011 at 2:37 PM, Vimil Saju <vi...@yahoo.com> wrote:
> you're nuts, don't use : in property names! :P
>
> --- On Tue, 2/1/11, Steele, Richard <ri...@steelezone.net> wrote:
>
>> From: Steele, Richard <ri...@steelezone.net>
>> Subject: Wisdom of using ":" in property name
>> To: user@ant.apache.org
>> Date: Tuesday, February 1, 2011, 5:53 AM
>> For better or for worse, I'm using
>> ":" as a separator character in my
>> property names as part of a set of reusable build
>> files.  The part before
>> the ":" indicates which build file the property is defined
>> in.
>>
>> I've come across at least one incompatibility doing this,
>> however, and that
>> is with the Bundlor tool (from SpringSource) for generating
>> OSGi manifests.
>> The issue appears to be that Bundlor uses the ":" character
>> for its own
>> purposes and is getting confused by my property naming
>> convention.  I'm
>> faced with several choices:
>>
>> 1. Use something other than Bundlor, like bnd.
>> 2. Work around or patch Bundlor to make it work with my
>> property naming
>> convention.
>> 3. Use some other naming convention (or none at all).
>>
>> None of these choices are all that appealing, but if the
>> Ant community says
>> something like "you're nuts, don't use : in property names"
>> that will
>> obviously push me towards #3.
>>
>> (If you're curious, I chose ":" both because the obvious
>> choice of "."
>> wasn't distinct enough from many built-in property names,
>> and because I also
>> use ":" in my target names.)
>>
>> Thanks,
>> Rich
>>
>
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Wisdom of using ":" in property name

Posted by Vimil Saju <vi...@yahoo.com>.
you're nuts, don't use : in property names! :P

--- On Tue, 2/1/11, Steele, Richard <ri...@steelezone.net> wrote:

> From: Steele, Richard <ri...@steelezone.net>
> Subject: Wisdom of using ":" in property name
> To: user@ant.apache.org
> Date: Tuesday, February 1, 2011, 5:53 AM
> For better or for worse, I'm using
> ":" as a separator character in my
> property names as part of a set of reusable build
> files.  The part before
> the ":" indicates which build file the property is defined
> in.
> 
> I've come across at least one incompatibility doing this,
> however, and that
> is with the Bundlor tool (from SpringSource) for generating
> OSGi manifests.
> The issue appears to be that Bundlor uses the ":" character
> for its own
> purposes and is getting confused by my property naming
> convention.  I'm
> faced with several choices:
> 
> 1. Use something other than Bundlor, like bnd.
> 2. Work around or patch Bundlor to make it work with my
> property naming
> convention.
> 3. Use some other naming convention (or none at all).
> 
> None of these choices are all that appealing, but if the
> Ant community says
> something like "you're nuts, don't use : in property names"
> that will
> obviously push me towards #3.
> 
> (If you're curious, I chose ":" both because the obvious
> choice of "."
> wasn't distinct enough from many built-in property names,
> and because I also
> use ":" in my target names.)
> 
> Thanks,
> Rich
> 


      

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