Use a precompiler with Java : Introduction « Ant « Java Tutorial






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>








38.1.Introduction
38.1.1.Create an Ant DTD
38.1.2.Use a precompiler with Java
38.1.3.Suppress warning in ANT script
38.1.4.Ant call another ant script