-
Notifications
You must be signed in to change notification settings - Fork 199
/
build.xml
320 lines (279 loc) · 10.7 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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<project name="dsiutils" default="jar" basedir="." xmlns:resolver="antlib:org.apache.maven.resolver.ant">
<property name="build.sysclasspath" value="ignore"/>
<property file="build.properties"/>
<property environment="env"/>
<!-- ************************************** WARNING: MAVEN SH*T ************************************** -->
<!-- define Maven coordinates -->
<property name="groupId" value="it.unimi.dsi" />
<property name="artifactId" value="fastutil" />
<property name="version" value="${version}" />
<!-- define artifacts' name, which follows the convention of Maven -->
<property name="maven-core-jar" value="${dist}/lib/${artifactId}-core-${version}.jar" />
<property name="maven-jar" value="${dist}/lib/${artifactId}-${version}.jar" />
<property name="maven-core-sources-jar" value="${dist}/lib/${artifactId}-core-${version}-sources.jar" />
<property name="maven-sources-jar" value="${dist}/lib/${artifactId}-${version}-sources.jar" />
<property name="maven-core-javadoc-jar" value="${dist}/lib/${artifactId}-core-${version}-javadoc.jar" />
<property name="maven-javadoc-jar" value="${dist}/lib/${artifactId}-${version}-javadoc.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="src-core">
<delete dir="$src}-core"/>
<mkdir dir="${src}-core"/>
<copy todir="${src}-core">
<fileset dir="${src}" includesfile="fastutil-src-core.txt"/>
</copy>
</target>
<target name="core" depends="compile">
<delete dir="${build}-core"/>
<mkdir dir="${build}-core"/>
<copy todir="${build}-core">
<fileset dir="${build}" includesfile="fastutil-core.txt"/>
</copy>
</target>
<target name="osgi-core" depends="core">
<taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="bnd/biz.aQute.bnd-5.2.0.jar"/>
<bnd
classpath="${build}-core"
eclipse="false"
failok="false"
exceptions="true"
output="${maven-core-jar}"
files="fastutil-core.bnd"/>
</target>
<target name="osgi" depends="compile">
<taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="bnd/biz.aQute.bnd-5.2.0.jar"/>
<bnd
classpath="${build}"
eclipse="false"
failok="false"
exceptions="true"
output="${maven-jar}"
files="fastutil.bnd"/>
</target>
<!-- end OSGi manifest generation -->
<target name="dist-javadoc-core" depends="javadoc-core" description="generate the distribution Javadoc (core)">
<!-- build the javadoc artifact (from symbolic link created in init) -->
<jar jarfile="${maven-core-javadoc-jar}">
<fileset dir="${dist}/javadoc-core" />
</jar>
</target>
<target name="dist-javadoc" depends="javadoc" description="generate the distribution Javadoc">
<!-- build the javadoc artifact (from symbolic link created in init) -->
<jar jarfile="${maven-javadoc-jar}">
<fileset dir="${dist}/javadoc" />
</jar>
</target>
<target name="dist-core" depends="osgi-core,dist-javadoc-core" description="generate the distribution (core)">
<!-- build the sources artifact -->
<jar jarfile="${maven-core-sources-jar}">
<fileset dir="." includes="README.md,CHANGES,LICENSE-2.0,build.xml,pom-core-model.xml,pom-model.xml,fastutil-core.bnd,fastutil.bnd,split.sh,build.properties,makefile,${drv}/*.drv,gencsource.sh,src/overview.html"/>
<fileset dir="src" includesfile="fastutil-src-core.txt"/>
</jar>
</target>
<target name="dist" depends="osgi,dist-javadoc" description="generate the distribution">
<!-- build the sources artifact -->
<jar jarfile="${maven-sources-jar}">
<fileset dir="src"/>
</jar>
</target>
<target name="pom-core" description="insert version into pom (core)">
<copy tofile="pom-core.xml" file="pom-core-model.xml" overwrite="true">
<filterset>
<filter token="VERSION" value="${version}"/>
</filterset>
</copy>
</target>
<target name="pom" description="insert version into pom">
<copy tofile="pom.xml" file="pom-model.xml" overwrite="true">
<filterset>
<filter token="VERSION" value="${version}"/>
</filterset>
</copy>
</target>
<target name="stage-core" depends="pom-core,dist-core" description="deploy release version to Maven staging repository (core)">
<!-- sign and deploy the main artifact -->
<exec executable="gpg">
<arg value="-sba"/>
<arg value="--yes"/>
<arg value="${maven-core-jar}"/>
</exec>
<exec executable="gpg">
<arg value="-sba"/>
<arg value="--yes"/>
<arg value="${maven-core-sources-jar}"/>
</exec>
<exec executable="gpg">
<arg value="-sba"/>
<arg value="--yes"/>
<arg value="${maven-core-javadoc-jar}"/>
</exec>
<exec executable="gpg">
<arg value="-sba"/>
<arg value="--yes"/>
<arg value="pom-core.xml"/>
</exec>
<resolver:deploy>
<pom file="pom-core.xml"/>
<remoterepo id="${maven-staging-repository-id}" url ="${maven-staging-repository-url}"/>
<artifact file="pom-core.xml.asc" type="pom.asc"/>
<artifact file="${maven-core-jar}" type="jar"/>
<artifact file="${maven-core-sources-jar}" type="jar" classifier="sources"/>
<artifact file="${maven-core-javadoc-jar}" type="jar" classifier="javadoc"/>
<artifact file="${maven-core-jar}.asc" type="jar.asc"/>
<artifact file="${maven-core-sources-jar}.asc" type="jar.asc" classifier="sources"/>
<artifact file="${maven-core-javadoc-jar}.asc" type="jar.asc" classifier="javadoc"/>
</resolver:deploy>
</target>
<target name="stage" depends="pom,dist" description="deploy release version to Maven staging repository">
<!-- sign and deploy the main artifact -->
<exec executable="gpg">
<arg value="-sba"/>
<arg value="--yes"/>
<arg value="${maven-jar}"/>
</exec>
<exec executable="gpg">
<arg value="-sba"/>
<arg value="--yes"/>
<arg value="${maven-sources-jar}"/>
</exec>
<exec executable="gpg">
<arg value="-sba"/>
<arg value="--yes"/>
<arg value="${maven-javadoc-jar}"/>
</exec>
<exec executable="gpg">
<arg value="-sba"/>
<arg value="--yes"/>
<arg value="pom.xml"/>
</exec>
<resolver:deploy>
<pom file="pom.xml"/>
<remoterepo id="${maven-staging-repository-id}" url ="${maven-staging-repository-url}"/>
<artifact file="pom.xml.asc" type="pom.asc"/>
<artifact file="${maven-jar}" type="jar"/>
<artifact file="${maven-sources-jar}" type="jar" classifier="sources"/>
<artifact file="${maven-javadoc-jar}" type="jar" classifier="javadoc"/>
<artifact file="${maven-jar}.asc" type="jar.asc"/>
<artifact file="${maven-sources-jar}.asc" type="jar.asc" classifier="sources"/>
<artifact file="${maven-javadoc-jar}.asc" type="jar.asc" classifier="javadoc"/>
</resolver:deploy>
</target>
<target name="stage-all" depends="stage-core,stage" description="stage all release versions to Maven staging repository">
</target>
<!-- ************************************** END OF MAVEN SH*T ************************************** -->
<condition property="j2se.apiurl" value="${local.j2se.apiurl}" else="${remote.j2se.apiurl}"><isset property="local"/></condition>
<property name="j2se.apiurl" value="http://java.sun.com/j2se/5.0/docs/api/"/>
<target name="init">
<delete dir="${dist}"/>
<mkdir dir="${build}"/>
<mkdir dir="${dist}/lib"/>
<mkdir dir="${reports}"/>
<symlink link="${dist}/javadoc-core" resource="../${docs}-core" overwrite="true"/>
<symlink link="${dist}/javadoc" resource="../${docs}" overwrite="true"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}"
debug="on"
deprecation="on"
optimize="on"
destdir="${build}"
memoryMaximumSize="2G"
fork="yes"
release="8"
>
<compilerarg value="-Xlint:all"/>
</javac>
</target>
<target name="compile-tests" depends="compile">
<javac srcdir="${test}"
debug="on"
deprecation="on"
optimize="on"
classpath="lib/junit-4.13.jar:lib"
destdir="${build}"
memoryMaximumSize="2G"
fork="yes"
release="8"
/>
</target>
<target name="jar" depends="compile">
<jar jarfile="fastutil-${version}.jar">
<fileset dir="${build}"/>
<manifest>
<attribute name="Automatic-Module-Name" value="it.unimi.dsi.fastutil"/>
</manifest>
</jar>
</target>
<target name="jar-tests" depends="compile">
<jar jarfile="fastutil-${version}.jar">
<fileset dir="${build}"/>
</jar>
</target>
<target name="javadoc-core" depends="src-core" description="Generates documentation (core)">
<mkdir dir="${docs}-core"/>
<javadoc destdir="${docs}-core"
packagenames = "it.unimi.dsi.fastutil,it.unimi.dsi.fastutil.*"
overview="${src}/overview.html"
sourcepath="${src}-core"
public="on"
source="1.8"
windowtitle="fastutil ${version}"
additionalparam="-breakiterator -Xmaxwarns 1 -tag "apiNote:a:API Notes:" -tag "implSpec:a:Implementation Specification:" -tag "implNote:a:Implementation Notes:\""
maxmemory="2G"
>
</javadoc>
</target>
<target name="javadoc" description="Generates documentation">
<mkdir dir="${docs}"/>
<javadoc destdir="${docs}"
packagenames = "it.unimi.dsi.fastutil,it.unimi.dsi.fastutil.*"
overview="${src}/overview.html"
sourcepath="${src}"
public="on"
source="1.8"
windowtitle="fastutil ${version}"
additionalparam="-breakiterator -Xmaxwarns 1 -tag "apiNote:a:API Notes:" -tag "implSpec:a:Implementation Specification:" -tag "implNote:a:Implementation Notes:\""
maxmemory="2G"
>
</javadoc>
</target>
<target name="junit" depends="compile-tests" description="Runs JUnit tests">
<junit printsummary="yes" fork="yes" haltonfailure="off" haltonerror="off">
<classpath location="${build}"/>
<classpath location="${src}"/>
<classpath location="lib/junit-4.13.jar"/>
<classpath location="lib/hamcrest-all-1.3.jar"/>
<jvmarg value="-Xmx3G" />
<assertions><enable/></assertions>
<formatter type="xml"/>
<formatter type="plain"/>
<batchtest fork="yes" todir="${reports}">
<fileset dir="${build}">
<include name="**/*Test.class"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="reports">
<fileset dir="reports">
<include name="TEST-*.xml"/>
</fileset>
<report todir="reports/html"/>
</junitreport>
</target>
<!-- ************ CLEAN ********************* -->
<target name="clean">
<delete dir="${build}"/>
<delete dir="${build}-core"/>
<delete dir="${src}-core"/>
<delete dir="${dist}"/>
<delete dir="${reports}"/>
<delete dir="${docs}-core"/>
<delete dir="${docs}"/>
<delete>
<fileset dir="." includes="fastutil-*.jar"/>
</delete>
</target>
</project>