ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <>
Subject RE: Optional <entry/> if and only if properties file exists?
Date Thu, 13 Nov 2008 11:09:58 GMT

-----Original Message-----
From: Patrick Waugh []
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"/>

<target name="foobar" depends="checkprops" unless="propfileexists">

<target name="foobaz" depends="checkprops" if="propfileexists">
    <entry file="" />

or check the condition with antcontrib if/else in one target

<target ....
   <available file="path/to/your/propsfile"/>
     <entry file="" />

Regards, Gilbert

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message