forked from versionone/VersionOne.Integration.GitSCM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
executable file
·227 lines (196 loc) · 8.61 KB
/
build.xml
File metadata and controls
executable file
·227 lines (196 loc) · 8.61 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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?xml version="1.0" encoding="UTF-8"?>
<project name="V1GIT">
<property file="build.properties" />
<target name="init" >
<!-- Versioning -->
<!-- CI should set ver.build otherwise use 0 as "developing" build -->
<property name="ver.build" value="0" />
<property name="build.version" value="${ver.major}.${ver.minor}.${ver.build}" />
<!-- Compiler settings -->
<property name="compiler.debug" value="on"/>
<property name="compiler.generate.no.warnings" value="off"/>
<property name="compiler.max.memory" value="128m"/>
<property name="compiler.args" value=""/>
<property name="publish.dir" value="./publish"/>
<property name="jar.filename" value="V1GitIntegration.jar"/>
<property name="zip.filename" value="V1GitIntegration.${build.version}.zip"/>
<property name="zip.source.filename" value="V1GitIntegration.Source.${build.version}.zip"/>
<property name="wrapper.licence.filename" value="LICENSE.txt"/>
<!-- Directories -->
<property name="base.dir" value="."/>
<property name="service.dir" value="service"/>
<property name="doc.dir" value="${basedir}/doc"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="res.dir" value="${basedir}/resources"/>
<property name="distr.dir" value="${basedir}/distr"/>
<property name="tests.dir" value="${basedir}/tests"/>
<property name="servicewrapper.dir" value="${basedir}/ServiceWrapper"/>
<!-- Build Directories -->
<property name="build.dir" value="${basedir}/build"/>
<property name="bin.product.dir" value="${build.dir}/bin_production"/>
<property name="junit.output.dir" value="junit"/>
<property name="publish.git.dir" value="${publish.dir}/tmpl/GitIntegration"/>
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<patternset id="compiler.resources">
<include name="**/?*.properties"/>
<include name="**/?*.xml"/>
<include name="**/?*.gif"/>
<include name="**/?*.png"/>
<include name="**/?*.jpeg"/>
<include name="**/?*.jpg"/>
<include name="**/?*.html"/>
<include name="**/?*.dtd"/>
<include name="**/?*.tld"/>
</patternset>
<path id="base.classpath">
<fileset dir="${lib.dir}" includes="*.jar">
<exclude name="junit-4.4.jar"/>
<exclude name="hamcrest-core-1.1.jar" />
<exclude name="hamcrest-library-1.1.jar" />
<exclude name="jmock-2.5.1.jar" />
<exclude name="jmock-junit4-2.5.1.jar" />
</fileset>
</path>
<pathconvert property="manifest.classpath" pathsep=" ">
<path refid="base.classpath"/>
<mapper>
<chainedmapper>
<flattenmapper/>
<globmapper from="*.jar" to="lib/*.jar"/>
</chainedmapper>
</mapper>
</pathconvert>
</target>
<!-- Clean -->
<target name="compile.clean" depends="init" >
<delete dir="${bin.product.dir}"/>
<delete dir="${build.dir}"/>
</target>
<target name="build.clean" depends="init" >
<delete file="${build.dir}/${jar.filename}"/>
</target>
<target name="package.clean" depends="init" >
<delete dir="${distr.dir}"/>
<delete file="${zip.filename}"/>
<delete file="${zip.source.filename}"/>
<delete dir="${junit.output.dir}"/>
<delete dir="." includes="cobertura.ser"/>
</target>
<target name="clean"
depends="compile.clean, package.clean, build.clean, coverage.clean"
description="cleanup all"/>
<!-- Compile -->
<target name="integration.compile.git" depends="init"
description="Compile VersionOne integration for Git">
<mkdir dir="${bin.product.dir}"/>
<javac destdir="${bin.product.dir}" debug="${compiler.debug}"
nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}"
fork="true" includeantruntime="false">
<compilerarg line="${compiler.args}"/>
<classpath refid="classpath"/>
<src path="${tests.dir}"/>
<src path="${src.dir}"/>
<src path="${res.dir}"/>
</javac>
</target>
<!-- Jar creation -->
<target name="integration.build.git"
depends="init,integration.compile.git">
<mkdir dir="${distr.dir}"/>
<copy todir="${bin.product.dir}/">
<fileset dir="${res.dir}/">
<include name="**/*.*"/>
</fileset>
</copy>
<copy file="${base.dir}/log4j.properties"
tofile="${bin.product.dir}/log4j.properties"/>
<jar destfile="${distr.dir}/${jar.filename}" duplicate="preserve">
<zipfileset dir="${bin.product.dir}" prefix=""/>
<manifest>
<attribute name="BuiltBy" value="VersionOne"/>
<attribute name="Main-Class" value="com.versionone.git.Main"/>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="BuildVersion" value="${build.version}"/>
<attribute name="BuildRev" value="${ver.build}"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
</manifest>
</jar>
</target>
<!-- package -->
<target name="integration.package.git"
depends="init,integration.build.git">
<mkdir dir="${publish.git.dir}"/>
<copy file="${distr.dir}/${jar.filename}" todir="${publish.git.dir}"/>
<!-- copy configuration -->
<copy file="${base.dir}/configuration.xml" todir="${publish.git.dir}"/>
<!-- copy runner -->
<copy file="${base.dir}/RunGitIntegration.bat" todir="${publish.git.dir}"/>
<!-- copy service wrapper-->
<copy todir="${publish.git.dir}">
<fileset dir="${servicewrapper.dir}/">
<exclude name="${wrapper.licence.filename}"/>
</fileset>
</copy>
<copy file="${servicewrapper.dir}/${wrapper.licence.filename}" todir="${publish.git.dir}/${service.dir}/"/>
<!-- copy libraries -->
<copy todir="${publish.git.dir}/lib">
<fileset dir="${lib.dir}/">
<exclude name="${lib.dir}/junit-4.4.jar"/>
</fileset>
</copy>
<!-- copy docs -->
<copy todir="${publish.git.dir}/doc">
<fileset dir="${doc.dir}"/>
</copy>
<zip destfile="${publish.dir}/${zip.filename}">
<fileset dir="${publish.dir}/tmpl/"/>
</zip>
<delete dir="${publish.dir}/tmpl"/>
<zip destfile="${publish.dir}/${zip.source.filename}">
<fileset dir="${base.dir}">
<include name="build.xml"/>
<include name="resources/**/*"/>
<include name="src/**/*"/>
<include name="ServiceWrapper/**/*"/>
<include name="tests/**/*"/>
<include name="lib/**/*"/>
<include name="configuration.xml"/>
<include name="log4j.properties"/>
<include name="License.rtf"/>
<include name="RunGitIntegration.bat"/>
<include name="doc/**/*"/>
</fileset>
</zip>
</target>
<!-- covarage -->
<target name="coverage.clean">
</target>
<target name="testing" depends="init,integration.compile.git">
<mkdir dir="${junit.output.dir}"/>
<!-- copy test data for tests -->
<copy todir="${bin.product.dir}/">
<fileset dir="${tests.dir}/">
<include name="**/*.xml"/>
</fileset>
</copy>
<junit fork="true" printsummary="withOutAndErr">
<classpath>
<pathelement location="${bin.product.dir}"/>
<path refid="classpath"/>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="${junit.output.dir}">
<fileset dir="${bin.product.dir}">
<include name="**/*Tester.class"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="teamcity.build" depends="clean, testing, integration.package.git"
description="build all"/>
</project>