-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
57 lines (50 loc) · 2.22 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
52
53
54
55
56
57
<project default="test">
<!-- input directories and files -->
<property name="app.src.dir" value="src" />
<property name="tests.src.dir" value="test" />
<property name="lib.dir" value="lib" />
<!-- output directories and files -->
<property name="build.dir" value="build" />
<property name="app.classes.dir" value="${build.dir}/application/classes" />
<property name="app.jar.dir" value="${build.dir}/application/jar" />
<property name="app.jar.name" value="Unformatter.jar" />
<property name="app.jar.main-class" value="com.flyingspaniel.unformatter.Unformatter" />
<property name="tests.classes.dir" value="${build.dir}/tests/classes" />
<property name="install.dir" value="${user.home}/bin" />
<target name="build">
<mkdir dir="${app.classes.dir}" />
<mkdir dir="${app.jar.dir}" />
<mkdir dir="${tests.classes.dir}" />
<javac srcdir="${app.src.dir}" destdir="${app.classes.dir}" />
<jar destfile="${app.jar.dir}/${app.jar.name}" basedir="${app.classes.dir}">
<manifest>
<attribute name="Main-Class" value="${app.jar.main-class}" />
</manifest>
</jar>
<javac srcdir="${tests.src.dir}" destdir="${tests.classes.dir}">
<classpath>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
<path location="${app.jar.dir}/${app.jar.name}"/>
</classpath>
</javac>
</target>
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target name="test" depends="build">
<junit printsummary="on" haltonfailure="yes" fork="true">
<classpath>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
<path location="${app.jar.dir}/${app.jar.name}"/>
<pathelement location="${tests.classes.dir}"/>
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${tests.src.dir}" includes="**/*Test.java" />
</batchtest>
</junit>
</target>
<target name="install" depends="build">
<copy file="${app.jar.dir}/${app.jar.name}" todir="${install.dir}" />
</target>
</project>