ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ninju Bohra <ninju_bo...@yahoo.com>
Subject Re: Can these targets be combined?
Date Fri, 17 Feb 2006 22:41:34 GMT
Nope...the way you have it written the "standard" ANT way of doing it... now if you want to
introduce some behavior defined in the ant-contrib project, particularly the <if> task
then you can write it as:
 
  <target name="bootstrap">
    <if>
        <available file="project/${env.PROJECT_NAME}/bootstrap.xml"/>
        <then>
           <ant antfile="project/${env.PROJECT_NAME}/bootstrap.xml"/>
        </then>
    </if>
  </target>
 



----- Original Message ----
From: Ian Pilcher <i.pilcher@comcast.net>
To: user@ant.apache.org
Sent: Friday, February 17, 2006 4:28:53 PM
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
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message