You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by James Todd <jw...@pacbell.net> on 2003/06/04 17:51:55 UTC
shell like property values ...
has the addition of unix shell pattern expansion been considered.
specifically, adding things like the following to the ${...} property
references:
${foo}
returns the value of foo or empty string if not set (vs the
literal ${foo})
${foo:-bar}
returns bar iff foo is unset
${foo:=bar}
sets foo to bar iff foo isunset, and returns the value of foo
${foo:?bar}
echo error message in the event foo is unset
${foo:+bar}
opposite of ":-"
there are more ...
i'd think the above would ease the process one goes through to check
for property defaults, etc. this should be easily implementable given it
is, for the most part, string maninpulation and logical conditionals
specific
to the ${...} syntax.
thx,
- james
Re: shell like property values ...
Posted by James Todd <jw...@pacbell.net>.
i overstated something. at this time i would advocate only adding extra
evaluation
processing if the ":" delimiter exists. eg:
if foo is not set
${foo} -> ${fooo}
${foo:-} -> ""
i like ant's simplicity and i, personally, hate make so, no, i don't
relish "tab hell."
i think adding a bit of property evaluation logic would go along ways
and should
in no way fall into the rathole "not a scripting language" debate.
i was part of the smallish team that released tomcat/ant/watchdog to apache
"back in the day" and felt then, as i do now, that ant was the gem,
although i love
tomcat. as such, i, in no way, trying to overly complicate ant but feel
some simple
mods would help ant scale in projects that have lots of mutual dependencies.
- james
webhiker@tiscali.fr wrote:
> I personally prefer to see the unprocessed variable reference - it's a
> great way to debug quickly
> if you've cocked up any of your settings.
>
> Seeing "foo" in a trace will likely be loads harder than if you see
> ${foo}, which immediately
> lets you know there's a problem.
>
> Don't over complicate Ant - the main reason is good is it's simplicity.
> Next thing you'll want is obligatory tabs for indenting your targets..
>
> ;>
>
>
>
>
> Matt Benson wrote:
>
>> I have suggested these before as well. What about:
>>
>> ${foofoobarbar%bar} = foofoobar
>> ${foofoobarbar%bar*} = foofoobar
>> ${foofoobarbar%%bar*} = foofoo
>> ${foofoobarbar#foo} = foobarbar
>> ${foofoobarbar##*foo} = barbar
>>
>> etc...
>>
>> Anybody wanna submit an RFE?
>>
>> -Matt
>>
>>
>> --- James Todd <jw...@pacbell.net> wrote:
>>
>>
>>> has the addition of unix shell pattern expansion
>>> been considered.
>>>
>>> specifically, adding things like the following to
>>> the ${...} property
>>> references:
>>>
>>> ${foo}
>>>
>>> returns the value of foo or empty string if
>>> not set (vs the literal ${foo})
>>>
>>> ${foo:-bar}
>>>
>>> returns bar iff foo is unset
>>>
>>> ${foo:=bar}
>>>
>>> sets foo to bar iff foo isunset, and returns
>>> the value of foo
>>>
>>> ${foo:?bar}
>>>
>>> echo error message in the event foo is unset
>>>
>>> ${foo:+bar}
>>>
>>> opposite of ":-"
>>>
>>> there are more ...
>>>
>>> i'd think the above would ease the process one goes
>>> through to check
>>> for property defaults, etc. this should be easily
>>> implementable given it
>>> is, for the most part, string maninpulation and
>>> logical conditionals specific
>>> to the ${...} syntax.
>>>
>>> thx,
>>>
>>> - james
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>>
>>
>>> To unsubscribe, e-mail:
>>> user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail:
>>> user-help@ant.apache.org
>>>
>>>
>>
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
>> http://calendar.yahoo.com
>>
>> ---------------------------------------------------------------------
>> 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: shell like property values ...
Posted by "webhiker@tiscali.fr" <we...@tiscali.fr>.
I personally prefer to see the unprocessed variable reference - it's a
great way to debug quickly
if you've cocked up any of your settings.
Seeing "foo" in a trace will likely be loads harder than if you see
${foo}, which immediately
lets you know there's a problem.
Don't over complicate Ant - the main reason is good is it's simplicity.
Next thing you'll want is obligatory tabs for indenting your targets..
;>
Matt Benson wrote:
>I have suggested these before as well. What about:
>
>${foofoobarbar%bar} = foofoobar
>${foofoobarbar%bar*} = foofoobar
>${foofoobarbar%%bar*} = foofoo
>${foofoobarbar#foo} = foobarbar
>${foofoobarbar##*foo} = barbar
>
>etc...
>
>Anybody wanna submit an RFE?
>
>-Matt
>
>
>--- James Todd <jw...@pacbell.net> wrote:
>
>
>>has the addition of unix shell pattern expansion
>>been considered.
>>
>>specifically, adding things like the following to
>>the ${...} property
>>references:
>>
>> ${foo}
>>
>> returns the value of foo or empty string if
>>not set (vs the
>>literal ${foo})
>>
>> ${foo:-bar}
>>
>> returns bar iff foo is unset
>>
>> ${foo:=bar}
>>
>> sets foo to bar iff foo isunset, and returns
>>the value of foo
>>
>> ${foo:?bar}
>>
>> echo error message in the event foo is unset
>>
>> ${foo:+bar}
>>
>> opposite of ":-"
>>
>> there are more ...
>>
>>i'd think the above would ease the process one goes
>>through to check
>>for property defaults, etc. this should be easily
>>implementable given it
>>is, for the most part, string maninpulation and
>>logical conditionals
>>specific
>>to the ${...} syntax.
>>
>>thx,
>>
>>- james
>>
>>
>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>user-unsubscribe@ant.apache.org
>>For additional commands, e-mail:
>>user-help@ant.apache.org
>>
>>
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
>http://calendar.yahoo.com
>
>---------------------------------------------------------------------
>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: shell like property values ...
Posted by James Todd <jw...@pacbell.net>.
sorry, wasn't aware of the system's dependencies. there are likely other
regex
pgks to borrow. then again, this should amount to simple string
manipulation.
re setting defaults and the like i concur with your view, to a point,
for a single
project but as we start to aggregate projects (i know about maven) dealing
with defaults seems to get quite a bit more involved (eg nexted conditionals
with boolean nodes, which is very cool albeit complex).
i think adding an optional ":" delimiter to the property and going after
2 or 3
of the simplier shell expansion features would go along way and i can't see
how this technically bleeds into the "ant is not a scripting language"
view or
the like. the feature set of ${...} processing has not changed since day one
(which is a nice feature) but i think adding some additional evalution time
logic would prove helpful, should be backwards compatible and should be
well contained within the codebase.
note: in order to achieve backwords compatibility i would leave the existing
logic as is and only add processes iff the ":" delimiter exists, as a
starting point.
side note: i had hoped that i could set a property in an .ant.properties
file which
in turn has a value that references another property and have that
value evaluated
relative the the process space that included the property file (this,
too, would go
along ways) but it looks to fail. i'm pretty sure this is doable as a
system i built
awhile back supported recursive expansion.
hth,
- james
Bill Burton wrote:
> James Todd wrote:
>
>> now that regex is in the jdk the should be all the easier, i would
>> guess.
>
>
> Unfortunately not. It was decided that for Ant 1.6, the minimum
> supported JVM version would be 1.2. The regex stuff wasn't added
> until 1.4.
>
> In any case, adding the more esoteric features of shell expansion to
> Ant probably doesn't fit with the current vision of what is or should be.
> IMHO, declaring default values with <property> tags at the top of the
> build file is much cleaner than scattering them throughout the build
> file embedded in some ${foo:-bar} syntax.
>
> However, it would be nice to have a way to make the build fail if a
> property is unset.
>
> -Bill
>
>>
>>
>> l8r,
>>
>> - james
>>
>> Matt Benson wrote:
>>
>>> I have suggested these before as well. What about:
>>>
>>> ${foofoobarbar%bar} = foofoobar
>>> ${foofoobarbar%bar*} = foofoobar
>>> ${foofoobarbar%%bar*} = foofoo
>>> ${foofoobarbar#foo} = foobarbar
>>> ${foofoobarbar##*foo} = barbar
>>>
>>> etc...
>>>
>>> Anybody wanna submit an RFE?
>>>
>>> -Matt
>>>
>>>
>>> --- James Todd <jw...@pacbell.net> wrote:
>>>
>>>
>>>> has the addition of unix shell pattern expansion
>>>> been considered.
>>>>
>>>> specifically, adding things like the following to
>>>> the ${...} property
>>>> references:
>>>>
>>>> ${foo}
>>>>
>>>> returns the value of foo or empty string if
>>>> not set (vs the literal ${foo})
>>>>
>>>> ${foo:-bar}
>>>>
>>>> returns bar iff foo is unset
>>>>
>>>> ${foo:=bar}
>>>>
>>>> sets foo to bar iff foo isunset, and returns
>>>> the value of foo
>>>>
>>>> ${foo:?bar}
>>>>
>>>> echo error message in the event foo is unset
>>>>
>>>> ${foo:+bar}
>>>>
>>>> opposite of ":-"
>>>>
>>>> there are more ...
>>>>
>>>> i'd think the above would ease the process one goes
>>>> through to check
>>>> for property defaults, etc. this should be easily
>>>> implementable given it
>>>> is, for the most part, string maninpulation and
>>>> logical conditionals specific
>>>> to the ${...} syntax.
>>>>
>>>> thx,
>>>>
>>>> - james
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>>
>>>
>>>> To unsubscribe, e-mail:
>>>> user-unsubscribe@ant.apache.org
>>>> For additional commands, e-mail:
>>>> user-help@ant.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>>
>>> __________________________________
>>> Do you Yahoo!?
>>> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
>>> http://calendar.yahoo.com
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: shell like property values ...
Posted by peter reilly <pe...@corvil.com>.
On Thursday 05 June 2003 16:38, Bill Burton wrote:
>
> However, it would be nice to have a way to make the build fail if a
> property is unset.
? One can do this -
<fail unless="x">Property x is not set</fail>
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: shell like property values ...
Posted by Bill Burton <bi...@progress.com>.
James Todd wrote:
> now that regex is in the jdk the should be all the easier, i would guess.
Unfortunately not. It was decided that for Ant 1.6, the minimum
supported JVM version would be 1.2. The regex stuff wasn't added until 1.4.
In any case, adding the more esoteric features of shell expansion to Ant
probably doesn't fit with the current vision of what is or should be.
IMHO, declaring default values with <property> tags at the top of the
build file is much cleaner than scattering them throughout the build
file embedded in some ${foo:-bar} syntax.
However, it would be nice to have a way to make the build fail if a
property is unset.
-Bill
>
>
> l8r,
>
> - james
>
> Matt Benson wrote:
>
>> I have suggested these before as well. What about:
>>
>> ${foofoobarbar%bar} = foofoobar
>> ${foofoobarbar%bar*} = foofoobar
>> ${foofoobarbar%%bar*} = foofoo
>> ${foofoobarbar#foo} = foobarbar
>> ${foofoobarbar##*foo} = barbar
>>
>> etc...
>>
>> Anybody wanna submit an RFE?
>>
>> -Matt
>>
>>
>> --- James Todd <jw...@pacbell.net> wrote:
>>
>>
>>> has the addition of unix shell pattern expansion
>>> been considered.
>>>
>>> specifically, adding things like the following to
>>> the ${...} property
>>> references:
>>>
>>> ${foo}
>>>
>>> returns the value of foo or empty string if
>>> not set (vs the literal ${foo})
>>>
>>> ${foo:-bar}
>>>
>>> returns bar iff foo is unset
>>>
>>> ${foo:=bar}
>>>
>>> sets foo to bar iff foo isunset, and returns
>>> the value of foo
>>>
>>> ${foo:?bar}
>>>
>>> echo error message in the event foo is unset
>>>
>>> ${foo:+bar}
>>>
>>> opposite of ":-"
>>>
>>> there are more ...
>>>
>>> i'd think the above would ease the process one goes
>>> through to check
>>> for property defaults, etc. this should be easily
>>> implementable given it
>>> is, for the most part, string maninpulation and
>>> logical conditionals specific
>>> to the ${...} syntax.
>>>
>>> thx,
>>>
>>> - james
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>>
>>
>>> To unsubscribe, e-mail:
>>> user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail:
>>> user-help@ant.apache.org
>>>
>>>
>>
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
>> http://calendar.yahoo.com
>>
>> ---------------------------------------------------------------------
>> 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: shell like property values ...
Posted by James Todd <jw...@pacbell.net>.
:)
i've just recently started more actively tracking ant (again) so if i
can be of help, ie submitting the intial rfe, etc i'm glad to help out.
now that regex is in the jdk the should be all the easier, i would guess.
l8r,
- james
Matt Benson wrote:
>I have suggested these before as well. What about:
>
>${foofoobarbar%bar} = foofoobar
>${foofoobarbar%bar*} = foofoobar
>${foofoobarbar%%bar*} = foofoo
>${foofoobarbar#foo} = foobarbar
>${foofoobarbar##*foo} = barbar
>
>etc...
>
>Anybody wanna submit an RFE?
>
>-Matt
>
>
>--- James Todd <jw...@pacbell.net> wrote:
>
>
>>has the addition of unix shell pattern expansion
>>been considered.
>>
>>specifically, adding things like the following to
>>the ${...} property
>>references:
>>
>> ${foo}
>>
>> returns the value of foo or empty string if
>>not set (vs the
>>literal ${foo})
>>
>> ${foo:-bar}
>>
>> returns bar iff foo is unset
>>
>> ${foo:=bar}
>>
>> sets foo to bar iff foo isunset, and returns
>>the value of foo
>>
>> ${foo:?bar}
>>
>> echo error message in the event foo is unset
>>
>> ${foo:+bar}
>>
>> opposite of ":-"
>>
>> there are more ...
>>
>>i'd think the above would ease the process one goes
>>through to check
>>for property defaults, etc. this should be easily
>>implementable given it
>>is, for the most part, string maninpulation and
>>logical conditionals
>>specific
>>to the ${...} syntax.
>>
>>thx,
>>
>>- james
>>
>>
>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>user-unsubscribe@ant.apache.org
>>For additional commands, e-mail:
>>user-help@ant.apache.org
>>
>>
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
>http://calendar.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
Re: shell like property values ...
Posted by Matt Benson <gu...@yahoo.com>.
I have suggested these before as well. What about:
${foofoobarbar%bar} = foofoobar
${foofoobarbar%bar*} = foofoobar
${foofoobarbar%%bar*} = foofoo
${foofoobarbar#foo} = foobarbar
${foofoobarbar##*foo} = barbar
etc...
Anybody wanna submit an RFE?
-Matt
--- James Todd <jw...@pacbell.net> wrote:
>
> has the addition of unix shell pattern expansion
> been considered.
>
> specifically, adding things like the following to
> the ${...} property
> references:
>
> ${foo}
>
> returns the value of foo or empty string if
> not set (vs the
> literal ${foo})
>
> ${foo:-bar}
>
> returns bar iff foo is unset
>
> ${foo:=bar}
>
> sets foo to bar iff foo isunset, and returns
> the value of foo
>
> ${foo:?bar}
>
> echo error message in the event foo is unset
>
> ${foo:+bar}
>
> opposite of ":-"
>
> there are more ...
>
> i'd think the above would ease the process one goes
> through to check
> for property defaults, etc. this should be easily
> implementable given it
> is, for the most part, string maninpulation and
> logical conditionals
> specific
> to the ${...} syntax.
>
> thx,
>
> - james
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com