-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuildScripts.xml
165 lines (128 loc) · 5.05 KB
/
buildScripts.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<project name="gnubridge" default="integrate">
<property name="build.dir" value="temp" />
<property name="jar.publish.dir" value="${build.dir}/publish" />
<property name="jar.candidate.dir" value="${build.dir}/candidate" />
<property name="lib.dir" location="lib" />
<!-- ************* INTEGRATE ***************** -->
<target name="integrate" depends="set-version-latest, build-jar, run-tests, publish" description="Continuous Integration: build-test-publish " />
<target name="set-version-latest">
<property name="version" value="latest" />
</target>
<!-- ************* RUN TESTS ***************** -->
<target name="run-tests" depends="build-jar, prepare-unit-tests, prepare-acceptance-tests, execute-tests" description="run all tests" />
<target name="prepare-unit-tests">
<copy todir="${build.dir}/test/">
<fileset dir="./test/">
<include name="**/*.java" />
</fileset>
</copy>
<mkdir dir="${build.dir}/classes/test/" />
<javac srcdir="${build.dir}/test/" destdir="${build.dir}/classes/test/" debug="on">
<classpath>
<pathelement location="${jar.candidate.dir}/gnubridge-${version}.jar" />
<pathelement location="${lib.dir}/junit-3.8.2.jar" />
<pathelement path="${java.class.path}" />
</classpath>
</javac>
</target>
<target name="prepare-acceptance-tests">
<copy todir="${build.dir}/acceptance/">
<fileset dir="./acceptance/">
<include name="**/*.java" />
</fileset>
</copy>
<mkdir dir="${build.dir}/classes/acceptance/" />
<javac srcdir="${build.dir}/acceptance/" destdir="${build.dir}/classes/acceptance/" debug="on">
<classpath>
<pathelement location="${jar.candidate.dir}/gnubridge-${version}.jar" />
<pathelement location="${lib.dir}/junit-3.8.2.jar" />
<pathelement location="${build.dir}/classes/test/" />
<pathelement path="${java.class.path}" />
</classpath>
</javac>
</target>
<target name="execute-tests" depends="clean-publish-dir">
<mkdir dir="${build.dir}/test/temp/" />
<junit failureproperty="junit.failure" showoutput="true" printsummary="on" tempdir="${build.dir}/test/temp/">
<classpath>
<pathelement location="${jar.candidate.dir}/gnubridge-${version}.jar" />
<pathelement location="${build.dir}/classes/test/" />
<pathelement location="${build.dir}/classes/acceptance/" />
<pathelement location="${lib.dir}/junit-3.8.2.jar" />
<pathelement path="${java.class.path}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${build.dir}/test/">
<fileset dir="${build.dir}/classes/test/">
<include name="**/*Test.class" />
</fileset>
<fileset dir="${build.dir}/classes/acceptance/">
<include name="**/BiddingAcceptanceTest.class" />
</fileset>
</batchtest>
</junit>
<mkdir dir="${jar.publish.dir}tests/" />
<!--junitreport todir="${jar.publish.dir}tests/">
<fileset dir="${build.dir}/test/">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${jar.publish.dir}tests/"/>
</junitreport-->
<fail message="Test(s) failed." if="junit.failure" />
</target>
<!-- ************* BUILD JAR ***************** -->
<target name="build-jar" depends="clean, create-compile-dir, set-version-release,unjar-swing-worker" description="build jar">
<copy todir="${build.dir}/src/">
<fileset dir="./src/">
<include name="**/*.java" />
</fileset>
</copy>
<copy todir="${build.dir}/resources/">
<fileset dir="./data/images/cards/jfitz/">
<include name="**/*.png" />
</fileset>
</copy>
<javac srcdir="${build.dir}/src/" destdir="${build.dir}/classes/" debug="on" target="1.5"/>
<mkdir dir="${jar.candidate.dir}" />
<jar destfile="${jar.candidate.dir}/gnubridge-${version}.jar">
<fileset dir="${build.dir}/classes/" />
<fileset dir="${build.dir}/resources/" />
<manifest>
<attribute name="Main-Class" value="org.gnubridge.presentation.gui.Main" />
</manifest>
</jar>
</target>
<target name="unjar-swing-worker" depends="clean, create-compile-dir">
<unjar src="./lib/swing-worker-1.2.jar" dest="${build.dir}/classes/" />
</target>
<target name="create-compile-dir">
<mkdir dir="${build.dir}/classes/" />
</target>
<target name="clean">
<deltree dir="${build.dir}" />
<mkdir dir="${build.dir}" />
</target>
<target name="set-version-release" unless="${version}">
<property name="version" value="0.1.19" />
</target>
<!-- ************* PUBLISH ***************** -->
<target name="publish" depends="clean-publish-dir,publish-jar,publish-test-results" />
<target name="clean-publish-dir">
<deltree dir="${jar.publish.dir}" />
<mkdir dir="${jar.publish.dir}" />
</target>
<target name="publish-jar">
<copy todir="${jar.publish.dir}">
<fileset dir="${jar.candidate.dir}">
<include name="**/*.jar" />
</fileset>
</copy>
</target>
<target name="publish-test-results">
<!-- copy todir="${jar.publish.dir}/test/">
<fileset dir="${build.dir}/test/">
<include name="*.*" />
</fileset>
</copy -->
</target>
</project>