ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bhadra, Jatin" <Jatin.Bha...@landg.com>
Subject RE: [Maybe Spam] Condition operation based on existance of a file ?
Date Fri, 09 Sep 2005 10:43:17 GMT
Try this.

<target name="init">
	<available file="${toplevel.dir}/${Name}.jar" property="doMerge"/>
</target>


<target name="unzip" if="doMerge" >
    <unzip src="${toplevel.dir}/${Name}.jar" dest="${dist.dir}">
      <patternset>
        <include name="**/*"/>
      </patternset>
    </unzip>
</target>

-----Original Message-----
From: Darryl L. Miles [mailto:darryl@netbauds.net]
Sent: 09 September 2005 10:23
To: user@ant.apache.org
Subject: [Maybe Spam] Condition operation based on existance of a file ?



How can I instruct ANT to conditionally do something, like a regular 
if() statement.

Here is what I have so far (the unzip is my conditional operation):

  <available file="${toplevel.dir}/${Name}.jar" property="doMerge"/>
    <!-- IF doMerge -->
    <unzip src="${toplevel.dir}/${Name}.jar" dest="${dist.dir}">
      <patternset>
        <include name="**/*"/>
      </patternset>
    </unzip>
    <!-- ENDIF -->

Thanks

-- 
Darryl L. Miles



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


The following companies are subsidiary companies of the Legal & General Group Plc which
are authorised and regulated by the Financial Services Authority for advising and arranging
the products shown: Legal & General Partnership Services Limited (insurance and mortgages),
Legal & General Insurance Limited (insurance), Legal & General Assurance Society Limited
(life assurance, pensions and investments), Legal & General Unit Trust Managers Limited
and Legal & General Portfolio Management Services Limited (investments).

They are registered in England under numbers shown. 
The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 4TP. 

Legal & General Partnership Services Limited: 5045000 Legal & General Assurance Society
Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 Legal &general
(Portfolio Management Services) Limited: 2457525 Legal & General Insurance Limited: 423930

They are registered with the Financial Services Authority under numbers shown. You can check
this at www.fsa.gov.uk/register

Legal & General Partnership Services Limited: 300792 Legal & General Assurance Society
Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 Legal &general
(Portfolio Management Services) Limited: 146786 Legal & General Insurance Limited: 202050


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message