You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Chun Ji <CJ...@pro-unlimited.com> on 2007/03/12 18:24:52 UTC

property value setting

I have a build.xml file in which there is a property value "PW90". And this value is initialized through the command line, such as: ant -f build.xml -DPW90="...". 

However, I just realize that 95% of time, the value is same. So I am just wondering if I could set a default value for this "PW90" inside the build.xml. Only when "-DPW90=.." is specified on the command line, then it will be overwritten by the input value. 

I am using ant 1.7 on Linux box. 


Thanks for the tips. 


Charlie



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


Re: property value setting

Posted by Steve Loughran <st...@apache.org>.
Chun Ji wrote:
> I have a build.xml file in which there is a property value "PW90". And this value is initialized through the command line, such as: ant -f build.xml -DPW90="...". 
> 
> However, I just realize that 95% of time, the value is same. So I am just wondering if I could set a default value for this "PW90" inside the build.xml. 

yes. <property name="PW90" value="something"/>


>Only when "-DPW90=.." is specified on the command line, then it will be overwritten by the input value. 

Anything set on the command line ovrrides any definitions in your build 
file...

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


RE: property value setting

Posted by James Oltmans <jo...@bolosystems.com>.
Any properties set on the command line are always set first before any
task is run in ant.

Go ahead and set PW90 in a property to its default value. 
Anytime you use -DPW90="..." on the command line it will be set first
and your default variable will not override it.

-----Original Message-----
From: Chun Ji [mailto:CJi@pro-unlimited.com] 
Sent: Monday, March 12, 2007 11:25 AM
To: Ant Users List
Subject: property value setting 


I have a build.xml file in which there is a property value "PW90". And
this value is initialized through the command line, such as: ant -f
build.xml -DPW90="...". 

However, I just realize that 95% of time, the value is same. So I am
just wondering if I could set a default value for this "PW90" inside the
build.xml. Only when "-DPW90=.." is specified on the command line, then
it will be overwritten by the input value. 

I am using ant 1.7 on Linux box. 


Thanks for the tips. 


Charlie



---------------------------------------------------------------------
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