poi/tools/centipede/targets/compile.xtarget
2002-03-03 22:25:28 +00:00

131 lines
4.7 KiB
Plaintext

<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare" depends="init">
<mkdir dir="${build.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Prepares the source code -->
<!-- =================================================================== -->
<target name="prepare-src" depends="prepare">
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>
<copy todir="${build.src}" filtering="on">
<fileset dir="${java.dir}"/>
</copy>
<mkdir dir="${build.scratchpad.src}"/>
<mkdir dir="${build.scratchpad.dest}"/>
<copy todir="${build.scratchpad.src}" filtering="on">
<fileset dir="${scratchpad.src}"/>
</copy>
<mkdir dir="${build.contrib.src}"/>
<mkdir dir="${build.contrib.dest}"/>
<copy todir="${build.contrib.src}" filtering="on">
<fileset dir="${contrib.src}"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Compiles the source directory -->
<!-- =================================================================== -->
<target name="compile" depends="prepare-src"
description="Compiles the source code">
<copy todir="${build.dest}">
<fileset dir="${build.src}">
<include name="**"/>
</fileset>
</copy>
<echo message="Compiling with Java ${ant.java.version}, debug ${debug}, optimize ${optimize}, deprecation ${deprecation}"/>
<javac srcdir="${build.src}"
destdir="${build.dest}"
debug="${debug}"
optimize="${optimize}"
deprecation="${deprecation}"
target="${target.vm}"
nowarn="${nowarn}">
<classpath refid="classpath"/>
</javac>
<copy todir="${build.scratchpad.dest}">
<fileset dir="${build.scratchpad.src}">
<include name="**"/>
</fileset>
</copy>
<javac srcdir="${build.scratchpad.src}"
destdir="${build.scratchpad.dest}"
debug="${debug}"
optimize="${optimize}"
deprecation="${deprecation}"
target="${target.vm}">
<classpath refid="scratchpad.classpath"/>
</javac>
<copy todir="${build.contrib.dest}">
<fileset dir="${build.contrib.src}">
<include name="**"/>
</fileset>
</copy>
<javac srcdir="${build.contrib.src}"
destdir="${build.contrib.dest}"
debug="${debug}"
optimize="${optimize}"
deprecation="${deprecation}"
target="${target.vm}">
<classpath refid="contrib.classpath"/>
</javac>
</target>
<!-- =================================================================== -->
<!-- Creates the jar file -->
<!-- =================================================================== -->
<target name="all" depends="package" description="Default target"/>
<target name="package" depends="compile" description="Generates the jar package">
<jar jarfile="${build.dir}/${name}.jar" manifest="${build.src}/Manifest.mf">
<fileset dir="${build.dest}">
<include name="**"/>
<include name="META-INF/**"/>
</fileset>
</jar>
<jar jarfile="${build.dir}/${scratchpad.name}.jar">
<fileset dir="${build.scratchpad.dest}">
<include name="**"/>
</fileset>
</jar>
<jar jarfile="${build.dir}/${contrib.name}.jar">
<fileset dir="${build.contrib.dest}">
<include name="**"/>
</fileset>
</jar>
</target>
<!-- =================================================================== -->
<!-- Copies the tools.jar to javac.jar in web-inf/lib -->
<!-- =================================================================== -->
<target name="prepare-tools-lib" depends="package" if="tools.jar.present">
<!-- NOTE: java.home is normally set by the JVM to the /jre directory -->
<copy file="${tools.jar}" tofile="${build.war}/WEB-INF/lib/javac.jar"/>
</target>
<!-- =================================================================== -->
<!-- Clean targets -->
<!-- =================================================================== -->
<target name="clean" depends="init" description="* Cleans the build directories">
<delete dir="${build.dir}"/>
</target>
<target name="cleandocs" depends="init" description="* Cleans the build docs directories">
<delete dir="${build.docs}"/>
</target>