ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
Subject Re: conditional target
Date Sat, 25 May 2002 17:37:30 GMT
The secret is already part of what you've shown (srcdir="${src}"):

    debug="${build.debug}" instead of debug="off"

Then override it from the command-line using -Dbuild.debug=[off|on]

If you want a single property to control both optimization and debug, then
you'll want to use <condition> to play some tricks setting the properties
based on the value or existence of a controlling property.

    Erik


----- Original Message -----
From: "Levente Farkas" <lfarkas@mindmaker.hu>
To: <ant-user@jakarta.apache.org>
Sent: Saturday, May 25, 2002 1:19 PM
Subject: conditional target


> hi,
> is it possible to write a conditional target in ant?
> what I'd like to do to create ONE compile task, but I'd like to use the
same
> task for debug and optimized compilation too. eg: now I have this
> -------------------------------
> <target name="compile" depends="init" description="compile all sources">
> <javac srcdir="${src}" destdir="${build}" failonerror="false"
> debug="off" optimize="on"
> deprecation="on">
> <classpath refid="project.classpath"/>
> </javac>
> <rmic base="${build}" includes="**/*Impl.class,**/ComponentBase.class"
> stubversion="1.2" verify="yes"
> debug="off">
> <classpath refid="project.classpath"/>
> </rmic>
> </target>
> -------------------------------
> it'd be useful if I can switch with a command line argument to turn on
debug
> info and trun off optimization. is it possible somehow?
> thanks in advance.
>
> --
>   Levente                               "Si vis pacem para bellum!"
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message