Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
AW: How to handle conditional capabilities?

AW: How to handle conditional capabilities?

2003-03-31       - By Jan.Materne@(protected)

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@(protected)]
> Gesendet am: Sonntag, 30. M?rz 2003 22:48
> An: user@(protected)
> 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@(protected)
> ***********************************************************
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.