-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
51 lines (48 loc) · 2.01 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<project name="WindowSelector">
<property name="src.dir" value="src"/>
<property name="tests.dir" value="tests"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="doc.dir" value="${build.dir}/doc"/>
<property name="lib.dir" value="lib"/>
<property name="main.class" value="TestMain"/>
<property name="junit.path" value="${lib.dir}/junit-4.12.jar"/>
<property name="hamcrest.path" value="${lib.dir}/hamcrest-core-1.3.jar"/>
<property name="class.path" value="${junit.path}:${hamcrest.path}"/>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="build">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" includeantruntime="false" encoding="utf8" classpath="${class.path}" debug="on"/>
</target>
<target name="jar" depends="build">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
</target>
<target name="run" depends="build">
<java classname="${main.class}" classpath="${classes.dir}" fork="true"/>
</target>
<target name="javadoc">
<mkdir dir="${doc.dir}"/>
<javadoc destdir="${doc.dir}" sourcepath="${src.dir}" classpath="${class.path}" charset="UTF-8" link="https://docs.oracle.com/javase/8/docs/api/"/>
</target>
<target name="test" depends="build">
<junit fork="true" printsummary="yes" showoutput="yes">
<formatter type="plain" usefile="false"/>
<classpath>
<pathelement path="${junit.path}"/>
<pathelement path="${hamcrest.path}"/>
<pathelement location="${classes.dir}"/>
</classpath>
<batchtest>
<fileset dir="${classes.dir}" includes="${tests.dir}/*.class"/>
</batchtest>
</junit>
</target>
</project>