Use a precompiler with Java : Introduction « Ant « Java Tutorial
- Java Tutorial
- Ant
- Introduction
Your Java code:
//@START@//
your code
//@END@//
<target name="compileprod">
<copy todir="out">
<filterchain>
<tokenfilter>
<replacestring from="//@START@//" to="/*" />
<replacestring from="//@END@//" to="*/" />
</tokenfilter>
</filterchain>
<fileset dir=".">
<include name="**/*.java" />
</fileset>
</copy>
</target>