1228bda5e5a4c025ad80d7e06649bed3a49d94cb
[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       <pathelement location="/usr/share/hamcrest-core/lib/hamcrest-core.jar"/>
17     </path>
18   </target>
19   <target name="all" depends="jar,javadoc"
20           description="Pseudo-target that builds JAR and Javadoc">
21   </target>
22   <target name="build" depends="init"
23           description="Compiles the classes">
24     <mkdir dir="${build}"/>
25     <javac destdir="${build}" srcdir="${src}" debug="true"
26            deprecation="true" includeantruntime="false">
27       <classpath refid="project.class.path"/>
28       <classpath refid="build.class.path"/>
29     </javac>
30   </target>
31   <target name="test" depends="build">
32     <junit>
33       <classpath refid="project.class.path" />
34       <classpath refid="test.class.path"/>
35       <formatter type="brief" usefile="false" />
36       <batchtest>
37         <fileset dir="${build}" includes="**/test/*.class" />
38       </batchtest>
39     </junit>
40   </target>
41   <target name="javadoc" depends="init"
42           description="Generates Javadoc API documentation">
43     <mkdir dir="${doc}/api"/>
44     <javadoc packagenames="*"
45              sourcepath="${src}" destdir="${doc}/api"
46              author="true"       version="true"
47              use="true"          private="true"/>
48   </target>
49   <target name="jar" depends="build"
50           description="Builds a project JAR file">
51     <jar basedir="${build}" jarfile="${basedir}/fits.jar">
52       <manifest>
53         <attribute name="Version" value="1.06.0"/>
54         <attribute name="Main-Class"
55                    value="fits"/>
56       </manifest>
57     </jar>
58   </target>
59   <target name="clean" depends="init"
60           description="Erase all generated files and dirs">
61     <delete dir="${build}" verbose="true"/>
62     <delete dir="${doc}/api" verbose="true"/>
63     <delete file="fits.jar" verbose="true"/>
64   </target>
65 </project>