ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <k...@panix.com>
Subject Conditional compilation
Date Wed, 12 Jun 2002 21:50:38 GMT




Hi!  I want to be able to invoke 'ant -DDEBUG=1' whenever I want my
project to be compiled with javac's -g flag.  How do I write the build
file for this?  One klunky way would be something like

  <target name="compile" unless="DEBUG>
    <javac debug="off"/>
  </target>

  <target name="compilewithdebug" if="DEBUG>
    <javac debug="on"/>
  </target>

  <target name="dist" depends="compile,compilewithdebug"/>

But that's a lot of machinery for a simple conditional!  (Not to
mention that it is ugly.)  Is this the only way?

Thanks!

kynn


--
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