99ba17a8b1c30d4edbef3e279719914dfae7c92e
[jpim.git] / build.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="PIMStuff" default="build" basedir=".">
3
4         <property name="src" location="src" />
5         <property name="build" location="bin" />
6         <property name="main" value="de.j32.pimstuff.Main" />
7         <property name="lib" value="libs" />
8         <property name="test" value="tests" />
9
10         <target name="makedirs">
11                 <mkdir dir="${build}" />
12         </target>
13
14         <path id="classpath">
15                 <fileset dir="${lib}">
16                         <include name="**/*.jar" />
17                 </fileset>
18         </path>
19
20         <fileset id="tests" dir="${test}">
21                 <include name="**/*.java" />
22         </fileset>
23
24         <target name="build" depends="makedirs" description="Compile project to ${build} directory">
25                 <javac srcdir="${src}" destdir="${build}" classpathref="classpath" />
26         </target>
27
28         <target name="clean" description="Clean up ${build} directory">
29                 <delete>
30                         <fileset dir="${build}" />
31                 </delete>
32         </target>
33
34         <target name="run" depends="build" description="Start main class">
35                 <java fork="true" classpath="${build}" classpathref="classpath" classname="${main}" />
36         </target>
37
38         <target name="build-tests" depends="build" description="Compile tests">
39                 <javac srcdir="${test}" destdir="${build}" classpath="${build}" classpathref="classpath" />
40         </target>
41
42         <target name="test" depends="build-tests" description="Run JUnit tests">
43                 <junit fork="true" printsummary="withOutAndErr" haltonerror="true">
44                         <classpath>
45                                 <path refid="classpath" />
46                                 <pathelement path="${build}" />
47                                 <pathelement path="${test}" />
48                         </classpath>
49                         <batchtest>
50                                 <fileset refid="tests" />
51                         </batchtest>
52                 </junit>
53         </target>
54
55 </project>