-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathbuild.xml
More file actions
282 lines (249 loc) · 9.96 KB
/
build.xml
File metadata and controls
282 lines (249 loc) · 9.96 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
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<project name="Thumbnailator" default="dist" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<description>
Thumbnailator Build
</description>
<!-- set global properties for this build -->
<property name="src" location="src" />
<property name="build" location="build-tmp" />
<property name="dist" location="distribution" />
<property name="javadoc-dir" value="javadoc" />
<property name="test-src" location="test" />
<property name="test-build" location="test-tmp" />
<!-- Maven properties -->
<property name="groupId" value="net.coobird" />
<property name="artifactId" value="thumbnailator" />
<property name="version" value="0.4.7" />
<!-- Maven file names -->
<property name="maven-jar" value="${dist}/lib/${artifactId}-${version}.jar" />
<property name="maven-javadoc-jar" value="${dist}/lib/${artifactId}-${version}-javadoc.jar" />
<property name="maven-sources-jar" value="${dist}/lib/${artifactId}-${version}-sources.jar" />
<!-- Defined maven snapshots and staging repository id and url -->
<property name="maven-snapshots-repository-id" value="sonatype-nexus-snapshots" />
<property name="maven-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots/" />
<property name="maven-staging-repository-id" value="sonatype-nexus-staging" />
<property name="maven-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" />
<target name="init">
</target>
<target
name="javadoc"
description="generate the javadocs">
<!-- Generate the javadocs, place into /javadoc directory -->
<javadoc
destdir="${javadoc-dir}"
sourcepath="${src}"
author="true"
version="true"
Public="true"
source="1.5"
doctitle="Thumbnailator API Documentation (Version ${version})"
windowtitle="Thumbnailator API Documentation (Version ${version})"
locale="en_US" >
<link href="http://download.oracle.com/javase/1.5.0/docs/api/" />
</javadoc>
</target>
<target
name="compile"
depends="init"
description="compile the source">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<!-- Compile the source code into the build directory -->
<javac
srcdir="${src}"
destdir="${build}"
source="1.5"
target="1.5" >
<exclude name="**/package-info.java" />
</javac>
</target>
<target
name="test"
depends="compile"
description="Runs unit tests">
<!-- Create the build directory structure used by test -->
<mkdir dir="${test-build}"/>
<!-- Compile the test code into the test build directory -->
<javac
srcdir="${test-src}"
destdir="${test-build}"
source="1.5"
target="1.5"
nowarn="true" >
<classpath path="${build}" />
<classpath path="lib/junit-4.10.jar" />
<classpath path="lib/mockito-all-1.8.5.jar" />
</javac>
<junit haltonfailure="yes" printsummary="yes" reloading="no">
<classpath path="${build}" />
<classpath path="${test-build}" />
<classpath path="lib/junit-4.10.jar" />
<classpath path="lib/mockito-all-1.8.5.jar" />
<batchtest>
<fileset dir="${test-src}">
<include name="**/*.java" />
<exclude name="**/test/**/*.java" />
<exclude name="**/TestUtils.java" />
</fileset>
</batchtest>
</junit>
</target>
<target
name="dist"
depends="compile,test,javadoc"
description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib" />
<!-- JAR file for the Maven Central Repo and Google Project Hosting -->
<jar jarfile="${maven-jar}">
<fileset dir="${build}" />
<metainf dir="." includes="LICENSE" />
<manifest>
<attribute name="Built-By" value="coobird"/>
<section name="Thumbnailator">
<attribute name="Specification-Title" value="Thumbnailator"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="coobird.net"/>
<attribute name="Implementation-Title" value="Thumbnailator"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="coobird.net"/>
</section>
</manifest>
</jar>
<!-- JAR containing source for Google Project Hosting -->
<jar jarfile="${dist}/lib/${artifactId}-${version}-all.jar">
<fileset dir="${build}" />
<fileset dir="${src}" excludes="**/package.info" />
<metainf dir="." includes="LICENSE" />
<manifest>
<attribute name="Built-By" value="coobird"/>
<section name="Thumbnailator">
<attribute name="Specification-Title" value="Thumbnailator with sources"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="coobird.net"/>
<attribute name="Implementation-Title" value="Thumbnailator with sources"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="coobird.net"/>
</section>
</manifest>
</jar>
<!-- Javadoc ZIP file for Google Project Hosting -->
<zip destfile="${dist}/lib/${artifactId}-${version}-javadoc.zip">
<fileset dir="${javadoc-dir}" />
<fileset dir="." includes="LICENSE" />
</zip>
<!-- Javadoc JAR for the Maven Central Repo -->
<jar jarfile="${maven-javadoc-jar}">
<fileset dir="${javadoc-dir}" />
<metainf dir="." includes="LICENSE" />
<manifest>
<attribute name="Built-By" value="coobird"/>
<section name="Thumbnailator">
<attribute name="Specification-Title" value="Thumbnailator API Documentation"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="coobird.net"/>
<attribute name="Implementation-Title" value="Thumbnailator API Documentation"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="coobird.net"/>
</section>
</manifest>
</jar>
<!-- Sources JAR for the Maven Central Repo -->
<jar jarfile="${maven-sources-jar}">
<fileset dir="${src}" />
<metainf dir="." includes="LICENSE" />
<manifest>
<attribute name="Built-By" value="coobird"/>
<section name="Thumbnailator">
<attribute name="Specification-Title" value="Thumbnailator sources"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="coobird.net"/>
<attribute name="Implementation-Title" value="Thumbnailator sources"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="coobird.net"/>
</section>
</manifest>
</jar>
</target>
<target
name="deploy"
description="deploy snapshot version to Maven snapshot repository">
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file" />
<arg value="-Durl=${maven-snapshots-repository-url}" />
<arg value="-DrepositoryId=${maven-snapshots-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${maven-jar}" />
</artifact:mvn>
</target>
<!-- before this, update project version (both build.xml and pom.xml) from SNAPSHOT to RELEASE -->
<target name="stage"
description="deploy release version to Maven staging repository">
<!-- sign and deploy the main artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${maven-staging-repository-url}" />
<arg value="-DrepositoryId=${maven-staging-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${maven-jar}" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- sign and deploy the sources artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${maven-staging-repository-url}" />
<arg value="-DrepositoryId=${maven-staging-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${maven-sources-jar}" />
<arg value="-Dclassifier=sources" />
<arg value="-Pgpg" />
</artifact:mvn>
<!-- sign and deploy the javadoc artifact -->
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${maven-staging-repository-url}" />
<arg value="-DrepositoryId=${maven-staging-repository-id}" />
<arg value="-DpomFile=pom.xml" />
<arg value="-Dfile=${maven-javadoc-jar}" />
<arg value="-Dclassifier=javadoc" />
<arg value="-Pgpg" />
</artifact:mvn>
</target>
<target
name="release"
description="release files to Google Project Hosting">
<taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask" name="gcupload" />
<property file="build.credentials.properties" />
<gcupload
username="${gc.username}"
password="${gc.password}"
projectname="thumbnailator"
filename="${dist}/lib/${artifactId}-${version}-javadoc.zip"
targetfilename="${artifactId}-${version}-javadoc.zip"
summary="Javadocs for Thumbnailator"
labels="Featured" />
<gcupload
username="${gc.username}"
password="${gc.password}"
projectname="thumbnailator"
filename="${dist}/lib/${artifactId}-${version}-all.jar"
targetfilename="${artifactId}-${version}-all.jar"
summary="Thumbnailator JAR file with sources included - Recommended for development"
labels="Featured" />
<gcupload
username="${gc.username}"
password="${gc.password}"
projectname="thumbnailator"
filename="${maven-jar}"
targetfilename="thumbnailator-${version}.jar"
summary="Thumbnailator JAR file"
labels="Featured" />
</target>
<target
name="clean"
description="clean up">
<!-- Delete the ${build} directory tree -->
<delete dir="${build}"/>
<delete dir="${test-build}"/>
<delete dir="${dist}"/>
</target>
</project>