xidyn/build.xml
2007-02-05 06:10:27 +01:00

162 lines
4.7 KiB
XML

<?xml version="1.0"?>
<!DOCTYPE project>
<!-- Builds the XID Framework jar filen. -->
<project name="xid" default="all" basedir=".">
<property name="targetjar" value="xid.jar"/>
<property name="zip_file" value="xid.zip"/> <!-- Release zip file -->
<property name="src" value="src"/>
<property name="build" value="build"/>
<property name="doc" value="doc"/>
<property name="dist" value="dist"/>
<property name="resources" value="resources"/>
<property name="debug" value="on"/>
<target name="all" depends="build_xid,dist_xid,build_test,dist_test,build_demo,dist_demo" />
<!-- ******* Init ******* -->
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
<mkdir dir="build_demo/classes"/>
<mkdir dir="build_test/classes"/>
<mkdir dir="${build}/classes"/>
<mkdir dir="${dist}"/>
</target>
<!-- ******* build ******* -->
<target name="build_xid" depends="init">
<javac srcdir="${src}" destdir="${build}/classes" debug="${debug}" deprecation="on">
<classpath>
<fileset dir="lib" includes="**/*.jar"/>
</classpath>
</javac>
</target>
<!-- ****** dist_xid ****** -->
<target name="dist_xid" depends="build_xid">
<jar update="no" jarfile="dist/xid.jar">
<fileset dir="build/classes" includes="xid/**.class" />
<fileset dir="resources" includes="**" />
</jar>
</target>
<!-- ******* build_test ******* -->
<target name="build_test" depends="dist_xid">
<javac srcdir="test" destdir="build_test/classes" debug="${debug}" deprecation="on">
<classpath>
<fileset dir="lib" includes="**/*.jar"/>
<pathelement path="dist/xid.jar"/>
</classpath>
</javac>
</target>
<!-- ****** dist_test ****** -->
<target name="dist_test" depends="build_test">
<jar update="no" jarfile="dist/test.jar">
<fileset dir="build_test/classes" includes="xid/test/**.class" />
<fileset dir="resources" includes="**" />
</jar>
</target>
<!-- *********** dotest ******** -->
<target name="dotest" depends="dist_test">
<java classname="xid.test.Test" maxmemory="20m" fork="true">
<classpath>
<fileset dir="lib" includes="**/*.jar" />
<fileset dir="resources" includes="**" />
<pathelement path="dist/xid.jar"/>
<pathelement path="dist/test.jar"/>
</classpath>
</java>
</target>
<!-- ******* build_demo ******* -->
<target name="build_demo" depends="dist_xid">
<javac srcdir="demo" destdir="build_demo/classes" debug="${debug}" deprecation="on">
<classpath>
<fileset dir="lib" includes="**/*.jar"/>
<pathelement path="dist/xid.jar"/>
</classpath>
</javac>
</target>
<!-- ****** dist_demo ****** -->
<target name="dist_demo" depends="build_demo">
<jar update="no" jarfile="dist/demo.jar">
<fileset dir="build_demo/classes" includes="**.class" />
<fileset dir="resources" includes="**" />
</jar>
</target>
<!-- *********** dodemo ******** -->
<target name="dodemo" depends="dist_demo">
<java classname="Demo" maxmemory="20m" fork="true">
<classpath>
<fileset dir="lib" includes="**/*.jar" />
<fileset dir="resources" includes="**" />
<pathelement path="dist/xid.jar"/>
<pathelement path="dist/demo.jar"/>
</classpath>
</java>
</target>
<!-- ******* Examples (the webapp). ******* -->
<target name="examples" depends="dist_xid">
<copy todir="webapp-examples/WEB-INF/lib">
<fileset dir="lib" includes="*.jar" excludes="servlet-api.jar"/>
<fileset dir="dist" includes="*.jar"/>
</copy>
<copy file="${dist}/xid.jar" todir="webapp-examples/WEB-INF/lib" overwrite="yes" preservelastmodified="yes"/>
<delete>
<fileset dir="webapp-examples/WEB-INF/classes/" includes="**.class"/>
<fileset dir="webapp-examples/WEB-INF/classes/" includes="**/**.class"/>
</delete>
<javac srcdir="webapp-examples/WEB-INF/classes/" destdir="webapp-examples/WEB-INF/classes/" debug="${debug}" deprecation="on">
<classpath>
<fileset dir="webapp-examples/WEB-INF/lib" includes="**.jar"/>
</classpath>
</javac>
</target>
<!-- ****** JavaDoc ****** -->
<target name="javadoc" depends="build_xid">
<javadoc sourcepath="${src}" packageNames="xid.*" destdir="${doc}">
<classpath>
<fileset dir="lib" includes="**/*.jar"/>
</classpath>
</javadoc>
</target>
<!-- *************** Clean ***********************-->
<target name="clean">
<delete dir="${build}"/>
<delete dir="build_test"/>
</target>
<!-- *********** Produce ZIP release file ******** -->
<target name="zip">
<zip update="no" zipfile="../${zip_file}" basedir=".">
<include name=".project" />
<include name=".classpath" />
<include name="build.xml" />
<include name="src/**" />
<include name="resources/**" />
<include name="lib/*.jar" />
</zip>
</target>
</project>