Re: Set a default value to property.

2010-11-30 Thread ritchie
Thanks all for your replies, i tried some thing like this and it worked. ... .. and when i ran the command ant -Dversion=25 it worked. Actually my ant task is replacing a regular expression with the version value. When i dont pass the arguments -Dversion=xxx it sets the token value as 23. --

Re: Set a default value to property.

2010-11-30 Thread Scot P. Floess
Honestly, its quite possible I am remembering wrong... I'm looking over some of my old code...it looks like I wanted to emit a warning if overriding - its me...again ;) On Tue, 30 Nov 2010, Niklas Matthies wrote: I don't think this (emitting a warning) was ever the case. Setting and over

Re: Set a default value to property.

2010-11-30 Thread Niklas Matthies
I don't think this (emitting a warning) was ever the case. Setting and overriding defaults this way is one of the basic techniques in Ant. It should probably be made more explicit in the manual. -- Niklas Matthies On Tue 2010-11-30 at 14:30h, Scot P. Floess wrote on user: > > Actually, nothing a

Re: Set a default value to property.

2010-11-30 Thread David Weintraub
On Tue, Nov 30, 2010 at 2:04 PM, ritchie wrote: > > My ant script takes a value for a property at runtime(-Denv=xxx), if the > argument is not passed i want the value to be set as a default arbitary > value. How to accomplish this? What do you mean "arbitrary" value? Do you mean some value that y

Re: Set a default value to property.

2010-11-30 Thread Scot P. Floess
Actually, nothing at all... I swear at one time I thought a warning was emitted when doing that... It was at that time I started using the enclosed macrodef... Perhaps I am just remembering wrong... On Tue, 30 Nov 2010, Niklas Matthies wrote: How is this different from just ? -- N

Re: Set a default value to property.

2010-11-30 Thread Niklas Matthies
How is this different from just ? -- Niklas Matthies On Tue 2010-11-30 at 14:11h, Scot P. Floess wrote on user: > > Here is something I like to use... I macrodef'd it out so I can call it > for many properties that require default values... > > > > > > >

Re: Set a default value to property.

2010-11-30 Thread Alexander Enrique Urieles Nieto
What may it be wrong about simply using: Since properties are immutable and if it was set in the command line call it won't change? Best regards, Alexander. On Tue, Nov 30, 2010 at 8:20 PM, Scot P. Floess wrote: > Clearly my snippet is wrong: > >     >         >    

Re: Set a default value to property.

2010-11-30 Thread Scot P. Floess
Clearly my snippet is wrong: - Call to was using the wrong attribute On Tue, 30 Nov 2010, Scot P. Floess wrote: Here is something I like to use... I

Re: Set a default value to property.

2010-11-30 Thread Scot P. Floess
Here is something I like to use... I macrodef'd it out so I can call it for many properties that require default values... This works with stock Ant (meani