ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: How to handle conditional capabilities?
Date Mon, 31 Mar 2003 06:15:22 GMT
You usually use different targets, call the one you want and don´t use a
flag like build.type:


<project>

    <target name="clean">
        <!-- delete all dirs -->
    </target>

    <target name="compile">
        <!-- compile the sources -->
    </target>

    <target name="dist" depends="compile">
        <!-- create the archives; classes have to be compiled ==> depends
-->
    </target>

</project>

So you would invoke
	ant clean
or
	ant dist
or
	ant clean dist



Jan Matèrne


> -----Ursprüngliche Nachricht-----
> Von: Duffey, Kevin [mailto:KDuffey@marketron.com]
> Gesendet am: Sonntag, 30. März 2003 22:48
> An: user@ant.apache.org
> Betreff: How to handle conditional capabilities?
> 
> Hi all,
> 
> I am using Eclipse 2.1 (just released) and Ant 1.5.1. I have 
> like 8 build scripts, one for development, one for a clean 
> build, one to build and package, and so forth. What I would 
> like to do is consolidate into one build file since most of 
> the build files are the same. I am fairly familiar with the 
> basics of ant as I have been using it for a few years. I 
> haven't done anything like what I want to do now. Basically, 
> I want to be able to pass in some parameters that set 
> properties. I may have something like:
> 
> <property name="version" value="1.2"/>
> <property name="build.type" value="clean"/>
> 
> What I would like to do is somehow something like:
> 
> If (build.type == "clearn")
> {
>   <delete all dirs>
> }
> else if (build.type == "dev")
> {
>   <compile only changes>
> }
> 
> the properties, the compiling of source, etc is the same for 
> all my build files so either a single build file, or perhaps 
> some links to how to make pretty solid build scripts for 
> different types of builds would be very helpful.
> 
> Thanks.
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.463 / Virus Database: 262 - Release Date: 3/17/2003
>  
> 
> 
> ***********************************************************
> The information contained in this e-mail message may be 
> confidential and  protected from disclosure. If you are 
> not the intended recipient, any dissemination, distribution
> or copying is strictly prohibited. If you think that you 
> have received this e-mail message in error,
> please e-mail the sender at exchangeadmins@marketron.com
> ***********************************************************
> 
> 
> ---------------------------------------------------------------------
> 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