-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
93 lines (71 loc) · 2.39 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!-- @@author A0125975U-reused </!-->
<!--this code is adapted from this project https://github.com/pavlobaron/travis-java-playground </!-->
<project name="travis" default="dist" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>
For Travis CI.
</description>
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="test" location="test" />
<property name="antlib" location="libs/ant-javafx.jar" />
<property name="junit" location="libs/junit.jar" />
<path id="classpath.src">
<pathelement location="${antlib}" />
<pathelement location="libs/gson lib/gson-2.4.jar" />
<fileset dir="libs/">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="classpath.test">
<pathelement location="${junit}" />
<pathelement location="${test}" />
<pathelement location="${build}/main" />
<pathelement location="${build}/test" />
<fileset dir="libs/">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
<mkdir dir="${build}/test" />
<mkdir dir="${build}/main" />
</target>
<target name="compile" depends="init" description="compile">
<javac srcdir="${src}" destdir="${build}/main">
<classpath refid="classpath.src" />
</javac>
</target>
<target name="compile-tests" depends="compile" description="compile-tests">
<javac srcdir="${test}" destdir="${build}/test">
<classpath>
<pathelement location="${build}/main" />
<pathelement location="${antlib}" />
<pathelement location="libs/gson lib/gson-2.4.jar" />
<pathelement location="libs/" />
<pathelement location="${junit}" />
</classpath>
</javac>
</target>
<target name="dist" depends="compile">
<mkdir dir="${dist}/lib" />
<jar jarfile="${dist}/lib/travis-${DSTAMP}.jar" basedir="${build}" />
</target>
<target name="test" depends="compile-tests">
<junit fork="off" haltonfailure="true">
<classpath refid="classpath.test" />
<classpath location="${build}/test" />
<batchtest fork="yes" todir="tres">
<formatter type="brief" usefile="false" />
<fileset dir="${test}">
<include name="**/*Test*.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="clean" description="clean up">
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
</project>