-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.xml
More file actions
97 lines (80 loc) · 2.94 KB
/
build.xml
File metadata and controls
97 lines (80 loc) · 2.94 KB
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
94
95
96
97
<project name="TalkToGo" default="jar">
<path id="test-dependencies">
<fileset dir="lib">
<include name="junit-4.7.jar"/>
<include name="mockito-all-1.8.0.jar"/>
</fileset>
</path>
<path id="dependencies">
<fileset dir="lib">
<include name="*.jar"/>
<exclude name="junit-4.7.jar"/>
<exclude name="mockito-all-1.8.0.jar"/>
</fileset>
</path>
<target name="clean">
<delete dir="target"/>
<delete dir="reports"/>
</target>
<target name="init" depends="clean">
<mkdir dir="target/classes/prod"/>
<mkdir dir="target/classes/test"/>
<mkdir dir="reports/xml/junit"/>
</target>
<target name="compile-prod" depends="init">
<javac debug="true"
encoding="UTF-8"
destdir="target/classes/prod"
compiler="javac1.6">
<src path="src"/>
<classpath>
<path refid="dependencies"/>
</classpath>
</javac>
</target>
<target name="compile-test" depends="compile-prod">
<javac debug="true"
encoding="UTF-8"
destdir="target/classes/test"
compiler="javac1.6">
<src path="test"/>
<classpath>
<path refid="test-dependencies"/>
<path refid="dependencies"/>
<path location="target/classes/prod"/>
</classpath>
</javac>
</target>
<target name="-load.short.rev">
<exec executable="git" outputproperty="short_rev">
<arg line="describe --always"/>
</exec>
<property name="api_client.basename" value="go-api-client-g${short_rev}"/>
<property name="api_client.jar.name" value="${api_client.basename}.jar"/>
<property name="api_client.src.jar.name" value="${api_client.basename}-src.jar"/>
</target>
<target name="test" depends="compile-test">
<mkdir dir="reports/xml/junit"/>
<junit fork="yes" forkmode="once" showoutput="true" printsummary="on" failureproperty="build-failed">
<classpath>
<path refid="dependencies"/>
<path refid="test-dependencies"/>
<path location="target/classes/prod"/>
<path location="target/classes/test"/>
</classpath>
<formatter type="plain" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="reports/xml/junit">
<fileset dir="test">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<fail if="build-failed" message="Build halted due to failed tests!"/>
</target>
<target name="jar" depends="test, -load.short.rev">
<jar jarfile="${api_client.jar.name}">
<fileset dir="target/classes/prod"/>
</jar>
</target>
</project>