-
Notifications
You must be signed in to change notification settings - Fork 4
/
build_jre17.xml
362 lines (322 loc) · 12.3 KB
/
build_jre17.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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<?xml version="1.0"?><!-- vim:set ts=2 sw=2 expandtab: -->
<!--
SPDX-License-Identifier: MPL-2.0
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright 2024 MonetDB Foundation;
Copyright August 2008 - 2023 MonetDB B.V.;
Copyright 1997 - July 2008 CWI.
-->
<!--
Build file to allow ant (http://ant.apache.org/) to be used
to build the MonetDB Java packages, such as the JDBC driver.
-->
<project name="MonetDB_Java_Drivers" default="default" basedir=".">
<!-- set global properties for this build -->
<property name="srcdir" value="src/main/java" />
<property name="libdir" value="lib" />
<property name="jardir" value="jars" />
<property name="builddir" value="build" />
<property name="docdir" value="doc" />
<property name="jdbc-package" value="org/monetdb/jdbc" />
<property name="mcl-package" value="org/monetdb/mcl" />
<property name="client-package" value="org/monetdb/client" />
<property name="util-package" value="org/monetdb/util" />
<property name="mero-control-package" value="org/monetdb/merovingian" />
<property file="build.local.properties" />
<property file="build.properties" />
<!--
Update: cross-compile for JVM 8 (=1.8), profile compact2
2020-02-12, [email protected]
Update: cross-compile for JVM 17, profile compact2
2023-03-08, [email protected]
-->
<property name="jvm.version" value="17" />
<property name="jre.version" value="jre17" />
<property name="javac.flags" value="-source 8" />
<property name="javac.flags" value="-target 17" />
<property name="javac.flags" value="-profile compact2" />
<property name="javac.flags" value="-Xlint" />
<property name="jdbc-jar"
value="${jardir}/monetdb-jdbc-${JDBC_MAJOR}.${JDBC_MINOR}.${jre.version}.jar" />
<property name="jdbcclient-jar"
value="${jardir}/jdbcclient.${jre.version}.jar" />
<property name="jmonetdb-jar"
value="${jardir}/jmonetdb.${jre.version}.jar" />
<property name="mero-control-jar"
value="${jardir}/merocontrol.${jre.version}.jar" />
<!-- full target -->
<target name="all">
<antcall target="distjdbc" />
<antcall target="distmerocontrol" />
<antcall target="doc" />
</target>
<target name="distall">
<antcall target="distjdbc" />
<antcall target="distmerocontrol" />
</target>
<target name="default">
<antcall target="jar_jdbcclient" />
<antcall target="jar_jmonetdb" />
</target>
<target name="distjdbc">
<antcall target="jar_jdbc" />
<antcall target="jar_jdbcclient" />
</target>
<target name="distmerocontrol">
<antcall target="jar_mero_control" />
</target>
<!-- jar targets -->
<target name="jar_jdbc" depends="compile_mcl,compile_jdbc"
unless="uptodate.jdbc-jar">
<echo file="${builddir}/META-INF/services/java.sql.Driver" append="false">org.monetdb.jdbc.MonetDriver</echo>
<jar jarfile="${jdbc-jar}">
<fileset dir="${builddir}">
<include name="META-INF/services/java.sql.Driver" />
<include name="${jdbc-package}/**/*.class" />
<include name="${mcl-package}/**/*.class" />
<include name="${util-package}/FileTransferHandler.class" />
</fileset>
</jar>
</target>
<target name="jar_client" depends="compile_util,compile_client">
<jar jarfile="${jardir}/monetdb-clients.jar">
<fileset dir="${builddir}">
<include name="${client-package}/**/*.class" />
<include name="${util-package}/**/*.class" />
</fileset>
</jar>
</target>
<!-- a convenience jar of jdbcclient command line program plus JDBC driver -->
<target name="jar_jdbcclient"
depends="compile_mcl,compile_jdbc,compile_util,compile_client"
unless="uptodate.jdbcclient-jar">
<echo message="Building jdbcclient + JDBC driver convenience jar" />
<jar jarfile="${jdbcclient-jar}">
<fileset dir="${builddir}">
<include name="${client-package}/**/*.class" />
<include name="${util-package}/**/*.class" />
<include name="META-INF/services/java.sql.Driver" />
<include name="${jdbc-package}/**/*.class" />
<include name="${mcl-package}/**/*.class" />
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="org.monetdb.client.JdbcClient" />
</manifest>
</jar>
</target>
<!-- a convenience jar of MeroControl plus the JMonetDB utility -->
<target name="jar_jmonetdb"
depends="compile_mcl,compile_util,compile_mero_control,compile_client"
unless="uptodate.jmonetdb-jar">
<echo message="Building MeroControl + JmonetDB convenience jar" />
<jar jarfile="${jmonetdb-jar}">
<fileset dir="${builddir}">
<include name="${mero-control-package}/**/*.class" />
<include name="${mcl-package}/**/*.class" />
<include name="${client-package}/JMonetDB.class" />
<include name="${util-package}/**/*.class" />
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="org.monetdb.client.JMonetDB" />
</manifest>
</jar>
</target>
<target name="jar_mero_control"
depends="compile_mcl,compile_mero_control">
<jar jarfile="${mero-control-jar}">
<fileset dir="${builddir}">
<include name="${mero-control-package}/**/*.class" />
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
</jar>
</target>
<!-- compile targets -->
<target name="compile_jdbc" depends="prepare,driver">
<echo message="Compiling JDBC driver" />
<javac
classpath="${srcdir}"
destdir="${builddir}"
debug="${debug}"
optimize="${optimize}"
includeantruntime="false"
source="${jvm.version}"
target="${jvm.version}"
>
<src path="${srcdir}" />
<include name="${jdbc-package}/**/*.java" />
<include name="${util-package}/FileTransferHandler.java" />
<compilerarg line="${javac.flags}" />
</javac>
</target>
<target name="compile_mcl" depends="prepare,driver">
<echo message="Compiling MCL" />
<javac
classpath="${srcdir}"
srcdir="${srcdir}"
destdir="${builddir}"
debug="${debug}"
optimize="${optimize}"
includeantruntime="false"
source="${jvm.version}"
target="${jvm.version}"
>
<include name="${mcl-package}/**/*.java" />
<compilerarg line="${javac.flags}" />
</javac>
</target>
<target name="compile_client" depends="prepare">
<echo message="Compiling Clients" />
<javac
classpath="${srcdir}"
srcdir="${srcdir}"
destdir="${builddir}"
debug="${debug}"
optimize="${optimize}"
includeantruntime="false"
source="${jvm.version}"
target="${jvm.version}"
>
<include name="${client-package}/**/*.java" />
<compilerarg line="${javac.flags}" />
</javac>
</target>
<target name="compile_util" depends="prepare">
<echo message="Compiling Utilities" />
<javac
classpath="${srcdir}"
srcdir="${srcdir}"
destdir="${builddir}"
debug="${debug}"
optimize="${optimize}"
includeantruntime="false"
source="${jvm.version}"
target="${jvm.version}"
>
<include name="${util-package}/**/*.java" />
<compilerarg line="${javac.flags}" />
</javac>
</target>
<target name="compile_mero_control" depends="prepare">
<echo message="Compiling Merovingian Control library" />
<javac
classpath="${srcdir}"
srcdir="${srcdir}"
destdir="${builddir}"
debug="${debug}"
optimize="${optimize}"
includeantruntime="false"
source="${jvm.version}"
target="${jvm.version}"
>
<include name="${mero-control-package}/**/*.java" />
<compilerarg line="${javac.flags}" />
</javac>
</target>
<!--
This generates MonetVersion.java from its ".java.in" equivalent.
It's required for importing the driver version properties.
-->
<target name="driver" depends="prepare" unless="uptodate.drivers">
<tstamp>
<format property="TODAY" pattern="yyyyMMdd" />
</tstamp>
<!-- Some defaults -->
<filter token="JDBC_MAJOR" value="${JDBC_MAJOR}" />
<filter token="JDBC_MINOR" value="${JDBC_MINOR}" />
<filter token="JDBC_VER_SUFFIX" value="${JDBC_VER_SUFFIX} ${TODAY}" />
<fail unless="JDBC_MAJOR" message="'JDBC_MAJOR' undefined. Please follow the directions in build.properties."/>
<fail unless="JDBC_MINOR" message="'JDBC_MINOR' undefined. Please follow the directions in build.properties."/>
<fail unless="JDBC_VER_SUFFIX" message="'JDBC_VER_SUFFIX' undefined. Please follow the directions in build.properties."/>
<!-- now copy and filter the file -->
<copy file="${srcdir}/${jdbc-package}/MonetVersion.java.in"
overwrite="true"
tofile="${srcdir}/${jdbc-package}/MonetVersion.java"
filtering="yes" />
<echo message="Configured build for the ${JDBC_MAJOR}.${JDBC_MINOR} (${JDBC_VER_SUFFIX}) edition driver" />
</target>
<!-- Prepares the build directory and sets some variables -->
<!-- checks whether regeneration of files is necessary -->
<target name="prepare">
<condition property="debug" value="true">
<equals arg1="${enable_debug}" arg2="true" casesensitive="false" trim="true" />
</condition>
<condition property="debug" value="false">
<not>
<equals arg1="${enable_debug}" arg2="true" casesensitive="false" trim="true" />
</not>
</condition>
<condition property="optimize" value="true">
<equals arg1="${enable_optimize}" arg2="true" casesensitive="false" trim="true" />
</condition>
<condition property="optimize" value="false">
<not>
<equals arg1="${enable_optimize}" arg2="true" casesensitive="false" trim="true" />
</not>
</condition>
<uptodate targetfile="${jdbc-jar}" property="uptodate.jdbc-jar">
<srcfiles dir="${srcdir}">
<include name="${jdbc-package}/**/*.java" />
<include name="${mcl-package}/**/*.java" />
</srcfiles>
</uptodate>
<uptodate targetfile="${jdbcclient-jar}" property="uptodate.jdbcclient-jar">
<srcfiles dir="${srcdir}">
<include name="${client-package}/**/*.java" />
<include name="${jdbc-package}/**/*.java" />
<include name="${mcl-package}/**/*.java" />
</srcfiles>
</uptodate>
<uptodate targetfile="${jmonetdb-jar}" property="uptodate.jmonetdb-jar">
<srcfiles dir="${srcdir}">
<include name="${client-package}/**/*.java" />
<include name="${mero-control-package}/**/*.java" />
<include name="${mcl-package}/**/*.java" />
</srcfiles>
</uptodate>
<condition property="uptodate.drivers">
<and>
<uptodate targetfile="${builddir}/src/${jdbc-package}/MonetVersion.java">
<srcfiles dir="${srcdir}">
<include name="build.properties" />
<include name="build.local.properties" />
<include name="${jdbc-package}/MonetVersion.java.in" />
<include name="${jdbc-package}/**/*.java" />
</srcfiles>
</uptodate>
</and>
</condition>
<mkdir dir="${builddir}" />
<mkdir dir="${jardir}" />
<echo message="Debug is ${debug}, optimise is ${optimize}" />
</target>
<!-- This target removes the build, jar and doc directories -->
<target name="clean">
<delete quiet="true" dir="${builddir}" />
<delete quiet="true" dir="${jardir}" />
<delete quiet="true" dir="${docdir}" />
</target>
<!-- documentation target -->
<target name="doc"
depends="driver">
<javadoc
destdir="${docdir}"
author="false"
version="false"
use="true"
windowtitle="MonetDB Java APIs">
<fileset dir="${srcdir}" defaultexcludes="yes">
<include name="${jdbc-package}/**/*.java" />
<include name="${mcl-package}/**/*.java" />
<include name="${client-package}/**/*.java" />
<include name="${util-package}/**/*.java" />
<include name="${mero-control-package}/**/*.java" />
</fileset>
</javadoc>
</target>
</project>