Thanks. Yes, this is the thing I did not understand. Patrick
On Thu, Nov 13, 2008 at 5:09 AM, Rebhan, Gilbert <[EMAIL PROTECTED]> wrote: > > -----Original Message----- > From: Patrick Waugh [mailto:[EMAIL PROTECTED] > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
