Jaim/build.xml

119 lines
4.5 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<!-- Written to assume that classpath is rooted in the current directory. -->
<!-- So this should be OK if you make this script in the root of a filesystem. -->
<!-- If not, you may prefer to adjust the basedir, or move some directories around. -->
<!-- The idea is that both Ant and NetBeans have to know what the package root is -->
<!-- for the classes in your application. -->
<project basedir="." default="all" name="jaimlib">
2024-05-09 23:32:34 +00:00
<target name="init">
</target>
<target depends="init" name="compile">
2024-05-09 23:32:34 +00:00
<mkdir dir="build"/>
<!-- Both srcdir and destdir should be package roots. -->
<!-- They could be different of course; in that case NetBeans can also be set -->
<!-- up to compile to a different filesystem in the same way; see Compiler Types: -->
<javac debug="true" deprecation="true" destdir="build" srcdir="src">
</javac>
</target>
<target depends="init,compile" name="jar">
<mkdir dir="lib"/>
2024-05-09 23:32:34 +00:00
<copy todir="build">
<fileset dir="src">
<include name="**/*.properties"/>
</fileset>
</copy>
2024-05-09 23:32:34 +00:00
<jar basedir="build" compress="true" jarfile="lib/jaimlib.jar">
<exclude name="**/*.java"/>
<exclude name="**/jaimtest/**"/>
</jar>
</target>
<target depends="init,compile" name="jartest">
<mkdir dir="lib"/>
2024-05-09 23:32:34 +00:00
<jar basedir="build" compress="true" jarfile="lib/jaimtest.jar">
<manifest>
<attribute name="Main-Class" value="com.wilko.jaimtest.JaimTest"/>
</manifest>
<exclude name="**/*.java"/>
</jar>
</target>
<target depends="init,jar,jartest" description="Build everything." name="all">
</target>
<target depends="init" description="Javadoc for my API." name="javadoc">
<mkdir dir="doc/apidoc"/>
<javadoc destdir="doc/apidoc" packagenames="com.wilko.jaim.*">
<sourcepath>
<pathelement location="src"/>
</sourcepath>
<footer><![CDATA[<a href="http://jaimlib.sourceforge.net">jaimlib.sourceforge.net</a>]]></footer>
</javadoc>
</target>
<target depends="init" description="Clean all build products." name="clean">
2024-05-09 23:32:34 +00:00
<delete dir="doc/apidoc" includeEmptyDirs="true"/>
<delete dir="build" includeEmptyDirs="true"/>
<delete dir="lib" includeEmptyDirs="true"/>
<delete>
<fileset dir="src" includes="**/*.class"/>
</delete>
</target>
<target depends="javadoc,compile,jar,jartest" name="dist">
<delete>
2024-05-09 23:32:34 +00:00
<fileset dir="." includes="jaimlib.tar*"/>
</delete>
<mkdir dir="jaimlib"/>
<mkdir dir="jaimlib/lib"/>
<mkdir dir="jaimlib/doc"/>
<copy todir="jaimlib">
2024-05-09 23:32:34 +00:00
<fileset dir="." includes="license.txt"/>
<fileset dir="." includes="build.xml"/>
<fileset dir="." includes="changes.txt"/>
<fileset dir="." includes="readme.txt"/>
</copy>
<copy todir="jaimlib/lib">
2024-05-09 23:32:34 +00:00
<fileset dir="lib"/>
</copy>
<copy todir="jaimlib/doc">
<fileset dir="doc"/>
</copy>
<tar basedir="." includes="jaimlib/**/*" tarfile="jaimlib.tar"/>
<gzip src="jaimlib.tar" zipfile="jaimlib.tar.gz"/>
<delete file="jaimlib.tar"/>
<delete dir="jaimlib" includeEmptyDirs="true"/>
</target>
<target depends="javadoc,compile,jar,jartest" name="srcdist">
<delete>
2024-05-09 23:32:34 +00:00
<fileset dir="." includes="jaimlibsrc.tar*"/>
</delete>
<mkdir dir="jaimlib"/>
<mkdir dir="jaimlib/lib"/>
<mkdir dir="jaimlib/doc"/>
<mkdir dir="jaimlib/src"/>
<copy todir="jaimlib">
2024-05-09 23:32:34 +00:00
<fileset dir="." includes="license.txt"/>
<fileset dir="." includes="build.xml"/>
<fileset dir="." includes="changes.txt"/>
<fileset dir="." includes="readme.txt"/>
</copy>
<copy todir="jaimlib/lib">
2024-05-09 23:32:34 +00:00
<fileset dir="lib"/>
</copy>
<copy todir="jaimlib/doc">
<fileset dir="doc"/>
</copy>
<copy todir="jaimlib/src">
<fileset dir="src"/>
</copy>
<tar basedir="." includes="jaimlib/**/*" tarfile="jaimlibsrc.tar"/>
<gzip src="jaimlibsrc.tar" zipfile="jaimlibsrc.tar.gz"/>
<delete file="jaimlibsrc.tar"/>
<delete dir="jaimlib" includeEmptyDirs="true"/>
</target>
</project>