ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: Can these targets be combined?
Date Tue, 21 Feb 2006 22:03:45 GMT
You do not need to use the <available> task within a target (as long as
you are using Ant 1.6 or greater) . You could rewrite this as...

  <available file="project/${env.PROJECT_NAME}/bootstrap.xml"
               property="bootstrap"/>

  <target name="bootstrap" if="bootstrap">
    <ant antfile="project/${env.PROJECT_NAME}/bootstrap.xml"/>
  </target>

-Rob A

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Ian Pilcher
> Sent: Friday, February 17, 2006 2:29 PM
> To: user@ant.apache.org
> Subject: Can these targets be combined?
> 
> I need to execute a single task if a file exists.  Here's 
> what I've been able to glean from the Ant manual (which 
> desperately needs an index,
> BTW):
> 
>   <target name="check-bootstrap">
>     <available file="project/${env.PROJECT_NAME}/bootstrap.xml"
>                property="bootstrap"/>
>   </target>
> 
>   <target name="bootstrap" if="bootstrap" depends="check-bootstrap">
>     <ant antfile="project/${env.PROJECT_NAME}/bootstrap.xml"/>
>   </target>
> 
> Is there a way to combine these two targets into one?
> 
> Thanks!
> 
> --
> ==============================================================
> ==========
> Ian Pilcher                                        
> i.pilcher@comcast.net
> ==============================================================
> ==========
> 
> 
> ---------------------------------------------------------------------
> 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