-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
262 lines (221 loc) · 9.9 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
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<?xml version="1.0"?>
<!--
Build file for sardine.
-->
<project name="sardine" default="jar" basedir=".">
<description>
Sardine : An easy to use WebDAV client for Java
</description>
<property name="name" value="${ant.project.name}"/>
<property file="user.properties"/>
<property file="${user.home}/build.properties"/>
<property file="build.properties"/>
<property file="build.credentials.properties"/>
<property file="jar.properties"/>
<property name="base.dir" location="."/>
<property name="build.debug" value="on"/>
<property name="build.deprecation" value="on"/>
<property name="ant.build.javac.target" value="1.5"/>
<property name="ant.build.javac.source" value="1.5"/>
<property name="build.dir" location="target"/>
<property name="build.classes.dir" location="${build.dir}/classes"/>
<property name="build.javadoc.dir" location="${build.dir}/javadoc"/>
<property name="build.jar.file" location="${build.dir}/${name}.jar"/>
<property name="build.test" location="${build.dir}/test"/>
<property name="docs.dir" value="${build.dir}/docs"/>
<property name="javadoc.dir" value="javadoc"/>
<property name="lib.dir" location="lib"/>
<property name="src.dir" location="src"/>
<property name="test.dir" location="test"/>
<tstamp>
<format property="YEAR" pattern="yyyy"/>
</tstamp>
<typedef resource="com/googlecode/svntask/svntask.xml" classpath="${lib.dir}/${svnkit.jar}:${lib.dir}/${svntask.jar}" />
<typedef resource="com/googlecode/sweetened/sweetened.xml" classpath="${lib.dir}/${sweetened.jar}:${lib.dir}/${svnkit.jar}:${lib.dir}/${sqljet.jar}:${lib.dir}/${sequence-library.jar}" />
<sweetenedVersion />
<taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask"
classpath="${lib.dir}/${ant-googlecode.jar}" name="gcupload"/>
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml"/>
<property name="version" value="${sVersionRevision}"/>
<property name="build.version" value="${sVersionRevision}"/>
<property name="build.dist.dir" location="${build.dir}/${ant.project.name}-${version}"/>
<property name="build.dist.zip" location="${build.dir}/${ant.project.name}-${version}.zip"/>
<spath id="sweetened.classpath">
<sfilelist dir="${lib.dir}">
<sfile name="${ant.jar}" scope="compile" />
<sfile name="${commons-codec.jar}" scope="compile" />
<sfile name="${commons-logging.jar}" scope="compile" />
<sfile name="${httpclient.jar}" scope="compile" />
<sfile name="${httpcore.jar}" scope="compile" />
<sfile name="${slf4j-api.jar}" scope="compile" />
<sfile name="${junit.jar}" scope="compile" />
</sfilelist>
</spath>
<spath id="javadoc.classpath" scope="all" parent="sweetened.classpath" />
<spath id="unit.classpath" scope="all" parent="sweetened.classpath" />
<spath id="all.classpath" scope="all" parent="sweetened.classpath" />
<spath id="javac.classpath" scope="compile" parent="sweetened.classpath" />
<path id="master.classpath">
<path path="${toString:all.classpath}"/>
</path>
<path id="run.classpath">
<pathelement location="${build.classes.dir}"/>
<path refid="master.classpath"/>
</path>
<path id="test.classpath">
<pathelement location="${build.classes.dir}"/>
<pathelement location="${test.dir}"/>
<path refid="master.classpath"/>
</path>
<target name=".eclipse">
<sweetenedClasspath file=".classpath">
<sweetenedBits refid="javac.classpath" />
<data>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<sweetenedEntries />
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="output" path="_eclipse"/>
</classpath>
</data>
</sweetenedClasspath>
<echoxml file=".project">
<projectDescription>
<name>${name}-${sVersionBranchName}</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
</echoxml>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="compile">
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
encoding="utf-8"
debug="${build.debug}"
deprecation="${build.deprecation}"
includeantruntime="false">
<classpath refid="master.classpath"/>
</javac>
<copy file="${base.dir}/src/com/googlecode/sardine/ant/sardinetask.xml"
todir="${build.dir}/classes/com/googlecode/sardine/ant/"/>
</target>
<target name="compile-tests" depends="compile">
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="${test.dir}"
destdir="${build.classes.dir}"
encoding="utf-8"
debug="${build.debug}"
deprecation="${build.deprecation}"
includeantruntime="false">
<classpath refid="test.classpath"/>
</javac>
</target>
<target name="test" depends="compile-tests">
<mkdir dir="${build.test}"/>
<junit fork="on" forkmode="perBatch" printsummary="on">
<formatter type="plain"/>
<classpath refid="test.classpath"/>
<batchtest todir="${build.test}">
<fileset dir="${test.dir}" includes="**/*"/>
</batchtest>
</junit>
</target>
<target name="jar" depends="compile">
<jar destfile="${build.jar.file}" basedir="${build.classes.dir}">
<manifest>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Implementation-Version" value="${TODAY}"/>
<attribute name="Main-Class" value="com.googlecode.sardine.Version"/>
</manifest>
</jar>
</target>
<target name="javadoc" depends="compile">
<javadoc
destdir="${build.javadoc.dir}"
packagenames="*"
classpathref="run.classpath"
author="true"
version="true"
Windowtitle="Sardine Javadoc">
<fileset dir="${src.dir}">
<exclude name="**/*.xml"/>
</fileset>
<doctitle><![CDATA[<h1>sardine</h1>]]></doctitle>
<bottom>
<![CDATA[<i>Copyright © ${YEAR} Jon Stevens et al. All Rights Reserved. Build version: ${build.version}</i>]]></bottom>
</javadoc>
<sync todir="${javadoc.dir}" includeEmptyDirs="true">
<fileset dir="${build.javadoc.dir}"/>
<preserveintarget>
<include name="**/.svn/**"/>
</preserveintarget>
</sync>
</target>
<target name="dist" depends="clean, jar, javadoc">
<copy todir="${build.dist.dir}">
<fileset dir="${build.dir}">
<include name="javadoc/**"/>
</fileset>
<fileset dir=".">
<include name="jar.properties"/>
<include name="build.xml"/>
<include name="webdav.xsd"/>
<include name="README.html"/>
</fileset>
</copy>
<copy todir="${build.dist.dir}">
<fileset dir="${build.dir}">
<include name="*.jar"/>
</fileset>
</copy>
<copy todir="${build.dist.dir}/lib">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</copy>
<copy todir="${build.dist.dir}/src">
<fileset dir="${base.dir}/src">
<include name="**"/>
</fileset>
</copy>
<dirname property="build.dist.dir.dirname" file="${build.dist.dir}"/>
<basename property="build.dist.dir.basename" file="${build.dist.dir}"/>
<zip zipfile="${build.dist.zip}" basedir="${build.dist.dir.dirname}">
<include name="${build.dist.dir.basename}/**"/>
</zip>
</target>
<target name="upload">
<gcupload projectname="sardine"
userName="${gc.username}"
password="${gc.password}"
filename="${build.dist.zip}"
targetfilename="${build.dist.zip}"
summary="Sardine distribution"
labels="Featured, Type-Package, OpSys-All"/>
</target>
<target name="sonar" depends="compile-tests,jar">
<property name="sonar.sources" value="${src.dir}"/>
<property name="sonar.binaries" value="${build.classes.dir},${build.test}/test-classes"/>
<property name="sonar.tests" value="${test.dir}"/>
<property name="sonar.surefire.reportsPath" value="${build.test}"/>
<property name="sonar.dynamicAnalysis" value="reuseReports"/>
<pathconvert property="sonar.libraries" refid="sweetened.classpath" pathsep=","/>
<sonar:sonar key="com.googlecode:sardine" version="${build.version}" xmlns:sonar="antlib:org.sonar.ant"/>
</target>
</project>