Ant debug control implementation
- From: Karsten Wutzke <kwutzke@xxxxxx>
- Date: 26 Apr 2007 08:46:24 -0700
Hi all!
How is the control of a debug flag implemtend correctly in an Ant XML
build file?
I need two versions of class files, one with debug information when
compiling in development (standard test compile and dist targets etc.)
and one without debug info for my deployment JAR.
Because I didn't really figure out a better way I created a compile-
debug and compile-nodebug target with the only difference being the
debug="true"/"false" setting, everything else is *equivalent*:
<target name="compile-debug" depends="init" description="Compile the
class files">
<javac srcdir="${src.dir}" destdir="${bin.dir}" debug="true">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="compile-nodebug" depends="init" description="Compile
the class files">
<javac srcdir="${src.dir}" destdir="${bin.dir}" debug="false">
<classpath refid="compile.classpath"/>
</javac>
</target>
There's a problem however:
Anytime I switch calling those debug and nondebug compilation targets,
the class files ought to be recreated. The way Ant works, for every
followup execution of any of the two targets doesn't recompile the
sources (which is logical)...
So I think I just don't handle the debug flag as I ought to do. What
is the standard way to do it?
Maybe someone has some code snip to look at and learn from?
TIA
Karsten
.
- Prev by Date: Re: To Get Class Information
- Next by Date: JVM problem when starting eclipse
- Previous by thread: Ant FTP task NoClassDefFoundError
- Next by thread: JVM problem when starting eclipse
- Index(es):