If this logic doesn't fit or seem appealing, you could
also try a simple task I wrote...works like you'd
probably expect.

Check it out here, if you're interested.
http://www.mail-archive.com/ant-user@jakarta.apache.org/msg03062.html

John

--- Don Taylor <[EMAIL PROTECTED]> wrote:
> No, you can't use if-statements like that. To
> accomplish what you want,
> try this instead:
> 
> <target name="isAvailable">
>   <available file="config.xml"
>     property="config.xml.available"/>
> </target>
> 
> <target name="copy" depends="isAvailable"
>   unless="config.xml.available">
>   <copy file="config_template.xml"
> tofile="config.xml"/>
> </target>
> 
> <target name="deploy" depends="copy">
>   <!-- Do your deploy stuff here -->
> </target>
> 
> Sorry, but that's how conditional logic is handled
> in Ant.
> 
> - Don
> 
> --- Martin Gerlach <[EMAIL PROTECTED]> wrote:
> > Hi there
> > 
> > is it possible to use if-statements in ant's
> build.xml-Files?
> > Like:
> > 
> > <target name="Test">
> >     <if property="${property_value}" 
> >         condition="EQUAL" 
> >         value="${property_value}">
> >             <delete ... >
> >             </delete>
> >     </if>
> > </target>
> > 
> > Espacially, i wan't to copy a file only when it
> not
> > exists. I want to copy a config_template.xml-File
> to 
> > a directory every time i make a deploy, but i want
> to 
> > copy the config_template.xml to config.xml only if
> 
> > there is NOT a previous config.xml. How to do that
> ?
> > 
> > Thanks in advance
> >     M. Gerlach
> > -- 
> >
>
_______________________________________________________________
> > 
> >     Martin Gerlach                Distributed
> Systems
> >     
> >     phone: +49 (0)221 250-1046   
> mailto:[EMAIL PROTECTED]
> >     fax:   +49 (0)221 250-1588   
> http://www.planb-media.de
> >     
> >     plan_b media ag               Coloneum
> >     Butzweilerstr. 255            D-50829 Cologne,
> Germany
> >
>
_______________________________________________________________
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/


=====
John Casey

[EMAIL PROTECTED]
Omni CodeWorks, Inc.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to