ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: ant property not set question
Date Thu, 19 Apr 2007 06:10:05 GMT
I think Rob means, that you could delete all your is.dev.home occurences and
just using env.IS_DEV_HOME.
If you want to define that in a propery file just use
  env.IS_DEV_HOME=someValue
It's "just" a normal property ...

But personally I prefer using different properties. So you are free to do more
complicated stuff without modifying the rest of your buildfile


	<!-- Check env variables with different writings -->
	<condition property="is.dev.home" value="${env.IS_DEV_HOME}"><isset property="env.IS_DEV_HOME"/>...
<condition property="is.dev.home" value="${env.is_dev_home}"><isset property="env.is_dev_home"/>...
	<!-- checks standard installation paths -->
	<available property="is.dev.home" ... >
	<condition ... >


Jan


>-----Urspr√ľngliche Nachricht-----
>Von: Anderson, Rob (Global Trade) [mailto:Rob.Anderson@nike.com] 
>Gesendet: Mittwoch, 18. April 2007 18:51
>An: Ant Users List
>Betreff: RE: ant property not set question
>
>Forget about is.dev.home, you don't need it. Just use the environment
>variable only...
>
><fail unless="env.IS_DEV_HOME" 
>message="IS_DEV_HOME/is.dev.home variable
>is not set."/>
>
>-Rob Anderson
> 
>
>> -----Original Message-----
>> From: Philip Swenson [mailto:pswenson@webmethods.com] 
>> Sent: Friday, April 13, 2007 1:06 PM
>> To: user@ant.apache.org
>> Subject: ant property not set question
>> 
>> I have a property that is declared like this:
>> 
>>  
>> 
>>     <property name="is.dev.home" value="${env.IS_DEV_HOME}"/>
>> 
>>  
>> 
>> So if an environment variable is set then the value gets set. 
>>  However if a build.properties file exists, this value can be 
>> overridden in the properties file like :  is.dev.home=c:/blah
>> 
>>  
>> 
>> This works fine.... Howeverk, I want to validate that the 
>> property has been set in one of the two methods (env variable 
>> or properties file) by doing
>> this:
>> 
>>  
>> 
>>         <fail unless="is.dev.home" 
>> message="IS_DEV_HOME/is.dev.home variable is not set."/>
>> 
>>  
>> 
>> This doesn't work, because the value of is.dev.home becomes 
>> "$is.dev.home"
>> literally if the value isn't set.  I know this because 
>> further down the path I get this message instead of my 
>> failure message:
>> 
>> [copy] Copying 27 files to C:\dev\hoth\dev\${env.IS_DEV_HOME}
>> 
>>  
>> 
>> Any ideas on how to make this validation work?
>> 
>>  
>> 
>> Thanks
>> 
>> phil
>> 
>>  
>> 
>>  
>> 
>> 
>
>
>---------------------------------------------------------------------
>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


Mime
View raw message