9472ab7ce2d6d90904d55ac38b26a5a729c239ea
[fits.git] / build.xml
1 <?xml version="1.0"?>
2 <project name="fits" default="all" basedir=".">
3   <target name="init" description="Sets build properties">
4     <property name="src" value="${basedir}/src"/>
5     <property name="build" value="${basedir}/build"/>
6     <property name="doc" value="${basedir}/doc"/>
7     <path id="project.class.path">
8     </path>
9     <path id="build.class.path">
10       <!--pathelement location="JUNIT.JAR"/-->
11       <pathelement location="/usr/share/junit-4/lib/junit.jar"/>
12     </path>
13     <path id="test.class.path">
14       <pathelement location="${build}"/>
15       <pathelement location="/usr/share/junit-4/lib/junit.jar"/>
16     </path>
17   </target>
18   <target name="all" depends="jar,javadoc"
19           description="Pseudo-target that builds JAR and Javadoc">
20   </target>
21   <target name="build" depends="init"
22           description="Compiles the classes">
23     <mkdir dir="${build}"/>
24     <javac destdir="${build}" srcdir="${src}" debug="true"
25            deprecation="true" includeantruntime="false">
26       <classpath refid="project.class.path"/>
27       <classpath refid="build.class.path"/>
28     </javac>
29   </target>
30   <target name="test" depends="build">
31     <junit>
32       <classpath refid="project.class.path" />
33       <classpath refid="test.class.path"/>
34       <formatter type="brief" usefile="false" />
35       <batchtest>
36         <fileset dir="${build}" includes="**/test/*.class" />
37       </batchtest>
38     </junit>
39   </target>
40   <target name="javadoc" depends="init"
41           description="Generates Javadoc API documentation">
42     <mkdir dir="${doc}/api"/>
43     <javadoc packagenames="*"
44              sourcepath="${src}" destdir="${doc}/api"
45              author="true"       version="true"
46              use="true"          private="true"/>
47   </target>
48   <target name="jar" depends="build"
49           description="Builds a project JAR file">
50     <jar basedir="${build}" jarfile="${basedir}/fits.jar">
51       <manifest>
52         <attribute name="Version" value="1.06.0"/>
53         <attribute name="Main-Class"
54                    value="fits"/>
55       </manifest>
56     </jar>
57   </target>
58   <target name="clean" depends="init"
59           description="Erase all generated files and dirs">
60     <delete dir="${build}" verbose="true"/>
61     <delete dir="${doc}/api" verbose="true"/>
62     <delete file="fits.jar" verbose="true"/>
63   </target>
64 </project>