-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.xml
82 lines (67 loc) · 2.45 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
<project name="Paysafe Java SDK" default="dist" basedir=".">
<description>
Complete Build File that handles running and handling of test cases
</description>
<property name="tests" location="tests" />
<property name="src" location="source" />
<property name="build" location="build" />
<property name="build.tests" location="build.tests" />
<property name="report.tests" location="reports/tests" />
<property name="lib" location="lib" />
<property name="dist" location="dist" />
<path id="junit.class.path">
<pathelement location="${lib}/junit-4.11.jar" />
<pathelement location="${lib}/hamcrest-core-1.3.jar" />
</path>
<target name="init">
<tstamp/>
<mkdir dir="${build}" />
<mkdir dir="${dist}" />
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath>
<pathelement location="${lib}/javax.json-1.0.4.jar" />
</classpath>
</javac>
</target>
<target name="dist" depends="compile">
<mkdir dir="${dist}/lib" />
<jar jarfile="${dist}/lib/Paysafe-${DSTAMP}.jar" basedir="${build}" />
<jar jarfile="${dist}/lib/Paysafe.jar" basedir="${build}" />
</target>
<target name="clean">
<delete dir="${build}" />
<delete dir="${build.tests}" />
</target>
<target name="compiletest">
<mkdir dir="${build.tests}" />
<javac srcdir="${tests}" destdir="${build.tests}" includeantruntime="true">
<classpath refid="junit.class.path" />
<classpath>
<pathelement location="${build.tests}" />
<pathelement location="${tests}" />
<pathelement location="${dist}/lib/Paysafe.jar" />
<pathelement location="${lib}/javax.json-1.0.4.jar" />
</classpath>
</javac>
</target>
<target name="test" depends="dist,compiletest">
<mkdir dir="${report.tests}"/>
<junit printsummary="true" showoutput="true" haltonerror="false" haltonfailure="no">
<classpath>
<pathelement location="${lib}/junit-4.11.jar" />
<pathelement location="${lib}/hamcrest-core-1.3.jar" />
<pathelement location="${dist}/lib/Paysafe.jar" />
<pathelement location="${lib}/javax.json-1.0.4.jar" />
<pathelement location="${build.tests}"/>
</classpath>
<formatter type="xml" />
<formatter type="plain"/>
<batchtest fork="yes" todir="${report.tests}">
<fileset dir="${tests}" includes="*Test.java" />
</batchtest>
</junit>
<fail message="Test failure detected, check test results." if="test.failed" />
</target>
</project>