ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Waugh" <ptwa...@gmail.com>
Subject Re: Optional <entry/> if and only if properties file exists?
Date Thu, 13 Nov 2008 11:12:43 GMT
Thanks.  Yes, this is the thing I did not understand.

Patrick

On Thu, Nov 13, 2008 at 5:09 AM, Rebhan, Gilbert
<Gilbert.Rebhan@huk-coburg.de> wrote:
>
> -----Original Message-----
> From: Patrick Waugh [mailto:ptwaugh@gmail.com]
> Sent: Thursday, November 13, 2008 11:58 AM
> To: Ant Users List
> Subject: Re: Optional <entry/> if and only if properties file exists?
>
> /*
> In other words, I need to test if the property file exists... and then
> include that "code" only in this case.
> */
>
>
> with Jan's macro =
>
> <target name="checkprops">
>  <condition property="propfileexists">
>   <available file="path/to/your/propsfile"/>
>  </condition>
>   ...
> </target>
>
>
> <target name="foobar" depends="checkprops" unless="propfileexists">
> <my.rapc/>
> <target>
>
> <target name="foobaz" depends="checkprops" if="propfileexists">
> <my.rapc>
>    <entry file="entryGUI.properties" />
> </my.rapc>
> <target>
>
>
> or check the condition with antcontrib if/else in one target
>
> <target ....
>  <if>
>   <available file="path/to/your/propsfile"/>
>  <then>
>    <my.rapc>
>     <entry file="entryGUI.properties" />
>    </my.rapc>
>  </then>
>  <else>
>    <my.rapc/>
>  </else>
>  </if>
> </target
>
>
> Regards, Gilbert
>
>
>
>
>
> ---------------------------------------------------------------------
> 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