-
Notifications
You must be signed in to change notification settings - Fork 590
/
build.xml
1635 lines (1343 loc) · 89.5 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
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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2002, 2024, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by
the Free Software Foundation.
This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in
included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the
separately licensed software that they have either included with the program or referenced in the documentation.
Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception,
version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-->
<project name="MySQL Connector/J" default="build" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
<description>
Compiling MySQL Connector/J
===========================
MySQL Connector/J 9.1 supports JDBC4.2 and implements the X DevAPI. This product requires Java 8 for compiling the source code.
The variable 'com.mysql.cj.build.jdk' is used to specify the compiler when building the driver and the variable 'com.mysql.cj.extra.libs' must point to the
location of third-party libraries that aren't distributed but are required for compiling the source code. Further details can be found in
http://dev.mysql.com/doc/connector-j/en/connector-j-installing-source.html.
Targets: "clean", "compile", "build" (default), "package", "package-no-sources", "install"
Testing MySQL Connector/J
=========================
MySQL Connector/J 9.1 ships with an extensive test suite that can be run by providing a MySQL JDBC URL in the variable 'com.mysql.cj.testsuite.url' and by
running the target "test". If nothing else is set, the test suite runs with the JVM referred in the variable 'com.mysql.cj.build.jdk'.
Alternatively, all tests can be run with a distinct JVM, provided that it is pointed out in the variable 'com.mysql.cj.testsuite.jvm'.
Running only one test set is possible by setting the variable 'com.mysql.cj.testsuite.test.class' with the class' fully qualified name. If also a comma
separated list of test names is provided in the variable 'com.mysql.cj.testsuite.test.methods', then only those will be executed.
Targets: "test"
Coverage and instrumentation
============================
This file ships with target "test-coverage" for collecting coverage results and "report-coverage" for creating the HTML coverage report.
The JaCoCo library needed to run these targets can be found at https://github.com/jacoco/jacoco, its JARs should be placed into
${com.mysql.cj.extra.libs}/jacoco directory.
The "test-coverage" target enables tests execution-time JaCoCo instrumentation, runs tests collecting coverage info into a result file
which path is set as ${com.mysql.cj.coverage.result.dir}/${com.mysql.cj.coverage.result.name}.
The "report-coverage" target first merges coverage result files which are placed in 'com.mysql.cj.coverage.result.dir' directory and
their comma-delimited names are passed via 'com.mysql.cj.coverage.merge.files' property. Merge result file path is passed
via 'com.mysql.cj.coverage.merge.result' property. Finally this target builds the HTML report from
'com.mysql.cj.coverage.merge.result' file into the directory passed via 'com.mysql.cj.coverage.report.dir' property.
If some properties are not passed to ANT script then default values are used:
com.mysql.cj.coverage.result.dir - "${com.mysql.cj.testsuite.build.dir}/coverage"
com.mysql.cj.coverage.result.name - "jacoco.exec"
com.mysql.cj.coverage.merge.files - none, merge step is skipped
com.mysql.cj.coverage.merge.result - ${com.mysql.cj.coverage.result.dir}/jacoco.exec
com.mysql.cj.coverage.report.dir - ${com.mysql.cj.coverage.result.dir}/report
Targets: "test-coverage", "report-coverage"
Generate X DevAPI reference documentation
=========================================
The target "xdevapi-docs" generates the Javadocs for the X DevAPI classes. The property "com.mysql.cj.docs.xdevapi" can be used to set the destination of the
Javadoc HTML files.
Targets: "xdevapi-docs"
Sample 'build.properties' that can be used to compile, build and test
=====================================================================
~~~start cut here~~~
# Basic settings for 'compile', 'test' and targets that depend on these.
# External libraries needed for both compiling and testing:
# - Further details in http://dev.mysql.com/doc/connector-j/en/connector-j-installing-source.html
# - Mandatory.
com.mysql.cj.extra.libs=<full_path_to_connector-j-jardeps>
# JDKs needed for compiling:
# - Must point to JDK home directory.
# - Also used for testing if 'com.mysql.cj.testsuite.jvm' is not provided.
# - Mandatory.
com.mysql.cj.build.jdk=<full_path_to_jdk1.8>
# Single JVM/MySQL tests:
# - Must point to JDK or JRE home directory.
# - If not provided, JDBC tests are run with 'com.mysql.cj.build.jdk'.
# - Optional.
com.mysql.cj.testsuite.jvm=<full_path_to_a_jdk_or_jre>
# - URL to the test database.
# - Any of the current MySQL versions.
# - Mandatory for 'test' target.
com.mysql.cj.testsuite.url=jdbc:mysql://<host>:<port>/<testDB>?user=<user>&password=<pwd>
com.mysql.cj.testsuite.mysqlx.url=jdbc:mysql://<user>:<pwd>@<host>:<port>/<testDB>
# Cancels re-compiling between successive test executions.
# - Comment variable if not needed.
# - Optional.
com.mysql.cj.build.noCleanBetweenCompiles=yes
# Other targets may require specific settings. Check 'build.xml' for details.
~~~end cut here~~~
Available build properties
==========================
build.properties - path to properties file
com.mysql.cj.extra.libs - location of third-party libraries: [${com.mysql.cj.extra.libs}]
com.mysql.cj.build.jdk - path to JDK used for building driver: [${com.mysql.cj.build.jdk}]
com.mysql.cj.build.addDebugInfo - whether the driver be compiled with debugging info: [${com.mysql.cj.build.addDebugInfo}]
com.mysql.cj.build.noCleanBetweenCompiles - don't delete compiled classes from previous build: [${com.mysql.cj.build.noCleanBetweenCompiles}]
com.mysql.cj.build.failOnWarnings - fail the build when any warning is found: [${com.mysql.cj.build.failOnWarnings}]
com.mysql.cj.build.verbose - log the extended build info (true/false): [${com.mysql.cj.build.verbose}]
com.mysql.cj.build.commercial - build commercial variant of the driver: [${com.mysql.cj.build.commercial}]
com.mysql.cj.build.filterLicense - build ISV variant of the driver: [${com.mysql.cj.build.filterLicense}]
com.mysql.cj.build.noCrypto - build the driver without SSL support: [${com.mysql.cj.build.noCrypto}]
com.mysql.cj.build.driver.version.major - major version: [${com.mysql.cj.build.driver.version.major}]
com.mysql.cj.build.driver.version.minor - minor version: [${com.mysql.cj.build.driver.version.minor}]
com.mysql.cj.build.driver.version.subminor - subminor version: [${com.mysql.cj.build.driver.version.subminor}]
com.mysql.cj.build.driver.version.status - version status, such as '-rc' or '-dmr': [${com.mysql.cj.build.driver.version.status}]
com.mysql.cj.build.driver.version.series - product series, i.e. x.y: [${com.mysql.cj.build.driver.version.series}]
com.mysql.cj.build.driver.version.numeric - numeric version, i.e. x.y.z: [${com.mysql.cj.build.driver.version.numeric}]
com.mysql.cj.build.driver.version - standard version string (includes version status): [${com.mysql.cj.build.driver.version}]
com.mysql.cj.build.driver.version.extra - optional version information appended to the version string: [${com.mysql.cj.build.driver.version.extra}]
com.mysql.cj.build.driver.version.snapshot - optional version snapshot marker: [${com.mysql.cj.build.driver.version.snapshot}]
com.mysql.cj.build.driver.version.full - full version string: [${com.mysql.cj.build.driver.version.full}]
com.mysql.cj.build.driver.displayName - product display name: [${com.mysql.cj.build.driver.displayName}]
com.mysql.cj.build.driver.name - product name: [${com.mysql.cj.build.driver.name}]
com.mysql.cj.build.driver.extraName - optional extension to product name: [${com.mysql.cj.build.driver.extraName}]
com.mysql.cj.build.driver.extendedName - final product name: [${com.mysql.cj.build.driver.extendedName}]
com.mysql.cj.build.driver.fullName - full product name (includes version): [${com.mysql.cj.build.driver.fullName}]
com.mysql.cj.build.dir - root directory for driver build: [${com.mysql.cj.build.dir}]
com.mysql.cj.build.dir.driver - driver build directory: [${com.mysql.cj.build.dir.driver}]
com.mysql.cj.build.dir.javadoc - javadoc build directory: [${com.mysql.cj.build.dir.javadoc}]
com.mysql.cj.dist.packageExtraName - optional extension to package name: [${com.mysql.cj.dist.packageExtraName}]
com.mysql.cj.dist.packageName - final package name: [${com.mysql.cj.dist.packageName}]
com.mysql.cj.dist.licenseUrl - license book location: [${com.mysql.cj.dist.licenseUrl}]
com.mysql.cj.dist.noMaven - don't create Maven bundles: [${com.mysql.cj.dist.noMaven}]
com.mysql.cj.dist.dir - root directory for driver packaging: [${com.mysql.cj.dist.dir}]
com.mysql.cj.dist.dir.workspace - directory for preparing packages: [${com.mysql.cj.dist.dir.workspace}]
com.mysql.cj.dist.dir.package - directory for preparing packages for given package name: [${com.mysql.cj.dist.dir.package}]
com.mysql.cj.dist.dir.maven - directory for preparing Maven packages: [${com.mysql.cj.dist.dir.maven}]
com.mysql.cj.dist.deb.maintainerEmail - the deb package maintainer email: [${com.mysql.cj.dist.deb.maintainerEmail}]
com.mysql.cj.docs.xdevapi - destination of the X DevAPI Javadoc HTML files: [${com.mysql.cj.dist.dir.maven}]
Available test properties
=========================
com.mysql.cj.testsuite.jvm - path to the JVM used to run the test suite: [${com.mysql.cj.testsuite.jvm}]
com.mysql.cj.testsuite.url - connection string to the test server: [${com.mysql.cj.testsuite.url}]
com.mysql.cj.testsuite.mysqlx.url - connection string to the test server with X Plugin: [${com.mysql.cj.testsuite.mysqlx.url}]
com.mysql.cj.testsuite.test.class - test class name to run: [${com.mysql.cj.testsuite.test.class}]
com.mysql.cj.testsuite.test.methods - a comma separated list of test names existing in the class specified in 'com.mysql.cj.testsuite.test.class': [${com.mysql.cj.testsuite.test.methods}]
com.mysql.cj.testsuite.unavailable.host - a host:port pair used for tests checking socket connection timeout: [${com.mysql.cj.testsuite.unavailable.host}]
com.mysql.cj.testsuite.build.dir - root directory for building the test suite: [${com.mysql.cj.testsuite.build.dir}]
com.mysql.cj.testsuite.junit.results - where to put JUnit reports: [${com.mysql.cj.testsuite.junit.results}]
See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test options.
</description>
<!-- ********************************** -->
<!-- ***** DEFAULT CONFIGURATIONS ***** -->
<!-- ********************************** -->
<!-- If build.properties exists, initialize properties from it. -->
<property file="build.properties" />
<!-- Location of third-party libraries we don't distribute and extra source files. -->
<property name="com.mysql.cj.extra.libs" value="lib" />
<!-- The JDK used to compile the code. -->
<property name="com.mysql.cj.build.jdk" value="/usr/lib/jvm/jdk1.8" />
<property name="com.mysql.cj.build.addDebugInfo" value="yes" />
<property name="com.mysql.cj.build.noCleanBetweenCompiles" value="no" />
<property name="com.mysql.cj.build.failOnWarnings" value="no" />
<property name="com.mysql.cj.build.verbose" value="false" />
<property name="com.mysql.cj.build.commercial" value="no" />
<property name="com.mysql.cj.build.filterLicense" value="no" />
<property name="com.mysql.cj.build.noCrypto" value="no" />
<property name="com.mysql.cj.build.driver.version.major" value="9" />
<property name="com.mysql.cj.build.driver.version.minor" value="1" />
<property name="com.mysql.cj.build.driver.version.subminor" value="0" />
<property name="com.mysql.cj.build.driver.version.status" value="" />
<property name="com.mysql.cj.build.driver.version.series" value="${com.mysql.cj.build.driver.version.major}.${com.mysql.cj.build.driver.version.minor}" />
<property name="com.mysql.cj.build.driver.version.numeric"
value="${com.mysql.cj.build.driver.version.series}.${com.mysql.cj.build.driver.version.subminor}" />
<property name="com.mysql.cj.build.driver.version" value="${com.mysql.cj.build.driver.version.numeric}${com.mysql.cj.build.driver.version.status}" />
<property name="com.mysql.cj.build.driver.version.extra" value="" />
<property name="com.mysql.cj.build.driver.version.snapshot" value="-SNAPSHOT" />
<property name="com.mysql.cj.build.driver.version.full"
value="${com.mysql.cj.build.driver.version}${com.mysql.cj.build.driver.version.extra}${com.mysql.cj.build.driver.version.snapshot}" />
<property name="com.mysql.cj.build.driver.name" value="mysql-connector-j" />
<property name="com.mysql.cj.build.driver.legacyName" value="mysql-connector-java" />
<property name="com.mysql.cj.build.driver.extraName" value="" />
<property name="com.mysql.cj.build.driver.extendedName" value="${com.mysql.cj.build.driver.name}${com.mysql.cj.build.driver.extraName}" />
<property name="com.mysql.cj.build.driver.extendedLegacyName" value="${com.mysql.cj.build.driver.legacyName}${com.mysql.cj.build.driver.extraName}" />
<property name="com.mysql.cj.build.driver.fullName" value="${com.mysql.cj.build.driver.extendedName}-${com.mysql.cj.build.driver.version.full}" />
<property name="com.mysql.cj.build.driver.displayName" value="MySQL Connector/J" />
<property name="com.mysql.cj.build.dir" value="build" />
<property name="com.mysql.cj.build.dir.driver" value="${com.mysql.cj.build.dir}/${com.mysql.cj.build.driver.fullName}" />
<property name="com.mysql.cj.build.dir.javadoc" value="${com.mysql.cj.build.dir.driver}/javadoc" />
<condition property="com.mysql.cj.dist.packageExtraName" value="-commercial" else="">
<istrue value="${com.mysql.cj.build.commercial}" />
</condition>
<property name="com.mysql.cj.dist.packageName"
value="${com.mysql.cj.build.driver.extendedName}${com.mysql.cj.dist.packageExtraName}-${com.mysql.cj.build.driver.version.full}" />
<property name="com.mysql.cj.dist.licenseUrl" value="file:${basedir}/LICENSE" />
<property name="com.mysql.cj.dist.noMaven" value="no" />
<property name="com.mysql.cj.dist.dir" value="dist" />
<property name="com.mysql.cj.dist.dir.workspace" value="${com.mysql.cj.dist.dir}/workspace" />
<property name="com.mysql.cj.dist.dir.package" value="${com.mysql.cj.dist.dir.workspace}/${com.mysql.cj.dist.packageName}" />
<property name="com.mysql.cj.dist.dir.maven" value="${com.mysql.cj.dist.dir.workspace}/${com.mysql.cj.dist.packageName}_maven" />
<property name="com.mysql.cj.dist.deb.maintainerEmail" value="MySQL Release Engineering <[email protected]>" />
<property name="com.mysql.cj.docs.xdevapi" value="docs" />
<property name="com.mysql.cj.testsuite.jvm" value="${com.mysql.cj.build.jdk}" />
<property name="com.mysql.cj.testsuite.url" value="" />
<property name="com.mysql.cj.testsuite.mysqlx.url" value="" />
<property name="com.mysql.cj.testsuite.test.class" value="" />
<property name="com.mysql.cj.testsuite.test.methods" value="" />
<property name="com.mysql.cj.testsuite.unavailable.host" value="" />
<property name="com.mysql.cj.testsuite.build.dir" value="buildtest" />
<property name="com.mysql.cj.testsuite.junit.results" value="${com.mysql.cj.testsuite.build.dir}/junit" />
<!-- Send class files to correct location if running in eclipse. -->
<condition property="com.mysql.cj.build.compiler.output" value="bin" else="${com.mysql.cj.build.dir.driver}">
<or>
<isset property="eclipse.running" />
<isset property="eclipse.pdebuild.home" />
<contains string="${ant.home}" substring="plugins" />
</or>
</condition>
<!-- Send class files to correct location if running in eclipse. -->
<condition property="com.mysql.cj.testsuite.compiler.output" value="bin" else="${com.mysql.cj.testsuite.build.dir}/${com.mysql.cj.build.driver.fullName}">
<or>
<isset property="eclipse.running" />
<isset property="eclipse.pdebuild.home" />
<contains string="${ant.home}" substring="plugins" />
</or>
</condition>
<!-- Propertyset used to forward testsuite properties to JUnit tasks as system variables. -->
<propertyset id="junit.system.properties">
<propertyref prefix="com.mysql.cj.testsuite." />
</propertyset>
<!-- Java compiler arguments to widen warnings detection and fail on warnings. -->
<condition property="javac.compilerarg" value="-Xlint:all,-path,-try -Werror" else="">
<istrue value="${com.mysql.cj.build.failOnWarnings}" />
</condition>
<!-- Path definitions. -->
<path id="com.mysql.cj.extra.libs.classpath" cache="true">
<fileset dir="${com.mysql.cj.extra.libs}">
<include name="**/*.jar" />
<exclude name="**/*-sources.jar" />
<exclude name="**/*-javadoc.jar" />
<exclude name="ant/**" />
<exclude name="jacoco/**" />
<exclude name="src/**" />
</fileset>
</path>
<path id="com.mysql.cj.build.classpath">
<path refid="com.mysql.cj.extra.libs.classpath" />
<pathelement location="${com.mysql.cj.build.dir.driver}" />
</path>
<path id="com.mysql.cj.build.instrumentation.classpath">
<path refid="com.mysql.cj.build.classpath" />
<pathelement location="${com.mysql.cj.build.compiler.output}" />
</path>
<path id="com.mysql.cj.testsuite.build.classpath">
<path refid="com.mysql.cj.extra.libs.classpath" />
<fileset dir="${com.mysql.cj.build.dir.driver}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${com.mysql.cj.testsuite.build.dir}/${com.mysql.cj.build.driver.fullName}" />
</path>
<!-- ************************* -->
<!-- ***** VERIFICATIONS ***** -->
<!-- ************************* -->
<!-- Check required external libraries path. -->
<target name="-extra-libs-check">
<fail message="The property 'com.mysql.cj.extra.libs' must point to a directory that contains the 3rd party libraries required for building tasks.">
<condition>
<not>
<and>
<available file="${com.mysql.cj.extra.libs}" type="dir" />
<available classname="javassist.CtClass" ignoresystemclasses="true">
<classpath refid="com.mysql.cj.extra.libs.classpath" />
</available>
</and>
</not>
</condition>
</fail>
</target>
<!-- Check compiler requirements for compiling the source code. -->
<target name="-compiler-check" depends="-jdk-check" />
<!-- Check required JDK for compiling the source code. -->
<target name="-jdk-check">
<property name="com.mysql.cj.build.jdk.java" value="${com.mysql.cj.build.jdk}/bin/java" />
<property name="com.mysql.cj.build.jdk.javac" value="${com.mysql.cj.build.jdk}/bin/javac" />
<local name="com.mysql.cj.build.jdk.version" />
<exec executable="${com.mysql.cj.build.jdk.java}"
outputproperty="com.mysql.cj.build.jdk.version"
failonerror="false"
failifexecutionfails="false"
resultproperty="com.mysql.cj.build.jdk.exitStatus">
<arg value="-version" />
</exec>
<fail message="Java 8 is required for compiling the source code. Set the path to the JDK home with the property 'com.mysql.cj.build.jdk'. Default: '/usr/lib/jvm/jdk1.8').">
<condition>
<not>
<and>
<equals arg1="${com.mysql.cj.build.jdk.exitStatus}" arg2="0" />
<contains string="${com.mysql.cj.build.jdk.version}" substring="version "1.8" casesensitive="true" />
</and>
</not>
</condition>
</fail>
<exec executable="${com.mysql.cj.build.jdk.javac}"
outputproperty="com.mysql.cj.dist.jdk.compilerVersion"
failonerror="true"
failifexecutionfails="true">
<arg value="-version" />
</exec>
</target>
<!-- Check specified JVM for running tests. -->
<target name="-testsuite-jvm-check">
<property name="com.mysql.cj.testsuite.jvm.java" value="${com.mysql.cj.testsuite.jvm}/bin/java" />
<local name="com.mysql.cj.testsuite.jvm.version" />
<exec executable="${com.mysql.cj.testsuite.jvm.java}"
outputproperty="com.mysql.cj.testsuite.jvm.version"
failonerror="false"
failifexecutionfails="false"
resultproperty="com.mysql.cj.testsuite.jvm.exitStatus">
<arg value="-version" />
</exec>
<fail message="JVM 1.8 or higher is required for running MySQL Connector/J test suite. Set the path to the JVM (JRE or JDK) home with the property 'com.mysql.cj.testsuite.jvm'. Default: '${com.mysql.cj.build.jdk}'.">
<condition>
<not>
<equals arg1="${com.mysql.cj.testsuite.jvm.exitStatus}" arg2="0" />
</not>
</condition>
</fail>
</target>
<!-- *************************************** -->
<!-- ***** INITIALIZATIONS & FILE COPY ***** -->
<!-- *************************************** -->
<!-- Initialize the build directory and check requirements for compiling the driver code. -->
<target name="-init" depends="-extra-libs-check, -compiler-check, -copy-files, -copy-notices-commercial, -copy-notices-gpl, -init-info-files">
<!-- The following is needed as the classpath can't be modified dynamically, and not having this library present causes the build to fail. -->
<available property="com.mysql.cj.c3p0Present" classname="com.mchange.v2.c3p0.QueryConnectionTester" classpathref="com.mysql.cj.build.classpath" />
</target>
<!-- Load revision details either from a git repository or from a revision-info.properties file. -->
<target name="-load-info-properties">
<!-- Run git commands in Windows. -->
<exec dir="."
executable="cmd"
osfamily="windows"
outputproperty="com.mysql.cj.build.git.branchFromCmd"
failonerror="false"
failifexecutionfails="false"
resultproperty="com.mysql.cj.build.git.branchExitStatus">
<arg line="/c git rev-parse --verify --abbrev-ref HEAD" />
</exec>
<exec dir="."
executable="cmd"
osfamily="windows"
outputproperty="com.mysql.cj.build.git.dateFromCmd"
failonerror="false"
failifexecutionfails="false"
resultproperty="com.mysql.cj.build.git.dateExitStatus">
<arg line="/c git show --no-patch --format=%ci HEAD^^{commit}" />
</exec>
<exec dir="."
executable="cmd"
osfamily="windows"
outputproperty="com.mysql.cj.build.git.commitFromCmd"
failonerror="false"
failifexecutionfails="false"
resultproperty="com.mysql.cj.build.git.commitExitStatus">
<arg line="/c git rev-parse --verify HEAD^^{commit}" />
</exec>
<exec dir="."
executable="cmd"
osfamily="windows"
outputproperty="com.mysql.cj.build.git.shortFromCmd"
failonerror="false"
failifexecutionfails="false"
resultproperty="com.mysql.cj.build.git.shortExitStatus">
<arg line="/c git rev-parse --verify --short HEAD^^{commit}" />
</exec>
<!-- Run git commands in *nix. -->
<exec executable="git"
osfamily="unix"
outputproperty="com.mysql.cj.build.git.branchFromCmd"
failonerror="false"
failifexecutionfails="false"
resultproperty="com.mysql.cj.build.git.branchExitStatus">
<arg line="rev-parse --verify --abbrev-ref HEAD" />
</exec>
<exec executable="git"
osfamily="unix"
outputproperty="com.mysql.cj.build.git.dateFromCmd"
failonerror="false"
failifexecutionfails="false"
resultproperty="com.mysql.cj.build.git.dateExitStatus">
<arg line="show --no-patch --format=%ci HEAD^{commit}" />
</exec>
<exec executable="git"
osfamily="unix"
outputproperty="com.mysql.cj.build.git.commitFromCmd"
failonerror="false"
failifexecutionfails="false"
resultproperty="com.mysql.cj.build.git.commitExitStatus">
<arg line="rev-parse --verify HEAD^{commit}" />
</exec>
<exec executable="git"
osfamily="unix"
outputproperty="com.mysql.cj.build.git.shortFromCmd"
failonerror="false"
failifexecutionfails="false"
resultproperty="com.mysql.cj.build.git.shortExitStatus">
<arg line="rev-parse --verify --short HEAD^{commit}" />
</exec>
<!-- The following workaround is needed for the RE build environments, which build from a non-versioned directory, so revision information is provided
from an external revision-info.properties file. -->
<property prefix="revinfo" file="revision-info.properties" />
<condition property="com.mysql.cj.build.git.branch" value="${com.mysql.cj.build.git.branchFromCmd}" else="${revinfo.branch}">
<equals arg1="${com.mysql.cj.build.git.branchExitStatus}" arg2="0" />
</condition>
<condition property="com.mysql.cj.build.git.date" value="${com.mysql.cj.build.git.dateFromCmd}" else="${revinfo.date}">
<equals arg1="${com.mysql.cj.build.git.dateExitStatus}" arg2="0" />
</condition>
<condition property="com.mysql.cj.build.git.commit" value="${com.mysql.cj.build.git.commitFromCmd}" else="${revinfo.commit}">
<equals arg1="${com.mysql.cj.build.git.commitExitStatus}" arg2="0" />
</condition>
<condition property="com.mysql.cj.build.git.short" value="${com.mysql.cj.build.git.shortFromCmd}" else="${revinfo.short}">
<equals arg1="${com.mysql.cj.build.git.shortExitStatus}" arg2="0" />
</condition>
</target>
<!-- Copy source files and fix license headers. -->
<target name="-copy-files" depends="-copy-files-main, -copy-filter-license-build, -copy-no-crypto-build, -replace-license-headers-build" />
<!-- Copy main source files. -->
<target name="-copy-files-main" depends="-clean-build, -load-info-properties">
<mkdir dir="${com.mysql.cj.build.dir.driver}" />
<!-- Compute the RPM release field, adding status, extra and snapshot information if set. -->
<condition property="com.mysql.cj.dist.rpm.release" value="1" else="0.1">
<equals arg1="${com.mysql.cj.build.driver.version.status}${com.mysql.cj.build.driver.version.extra}${com.mysql.cj.build.driver.version.snapshot}"
arg2="" />
</condition>
<condition property="com.mysql.cj.dist.rpm.releaseStatus" value="" else=".${com.mysql.cj.build.driver.version.status}">
<equals arg1="${com.mysql.cj.build.driver.version.status}" arg2="" />
</condition>
<condition property="com.mysql.cj.dist.rpm.releaseExtra" value="" else=".${com.mysql.cj.build.driver.version.extra}">
<equals arg1="${com.mysql.cj.build.driver.version.extra}" arg2="" />
</condition>
<condition property="com.mysql.cj.dist.rpm.releaseSnapshot" value="" else=".${com.mysql.cj.build.driver.version.snapshot}">
<equals arg1="${com.mysql.cj.build.driver.version.snapshot}" arg2="" />
</condition>
<!-- If commercial adds an extra ".1" at the end. -->
<condition property="com.mysql.cj.dist.rpm.releaseCommercial" value=".1" else="">
<istrue value="${com.mysql.cj.build.commercial}" />
</condition>
<!-- Remove "-" prefixes to status, extra and snapshot, in the property ".-". -->
<property name="com.mysql.cj.dist.rpm.releaseFullDirty"
value="${com.mysql.cj.dist.rpm.release}${com.mysql.cj.dist.rpm.releaseStatus}${com.mysql.cj.dist.rpm.releaseExtra}${com.mysql.cj.dist.rpm.releaseSnapshot}${com.mysql.cj.dist.rpm.releaseCommercial}" />
<loadresource property="com.mysql.cj.dist.rpm.releaseFull">
<propertyresource name="com.mysql.cj.dist.rpm.releaseFullDirty" />
<filterchain>
<tokenfilter>
<replacestring from=".-" to="." />
<replacestring from="-" to="_" />
</tokenfilter>
</filterchain>
</loadresource>
<!-- Version replace tokens. -->
<filterset id="versionFilterset">
<filter token="MYSQL_CJ_MAJOR_VERSION" value="${com.mysql.cj.build.driver.version.major}" />
<filter token="MYSQL_CJ_MINOR_VERSION" value="${com.mysql.cj.build.driver.version.minor}" />
<filter token="MYSQL_CJ_SUBMINOR_VERSION" value="${com.mysql.cj.build.driver.version.subminor}" />
<filter token="MYSQL_CJ_VERSION_STATUS" value="${com.mysql.cj.build.driver.version.status}" />
<filter token="MYSQL_CJ_VERSION_NUMERIC" value="${com.mysql.cj.build.driver.version.numeric}" />
<filter token="MYSQL_CJ_VERSION_EXTRA" value="${com.mysql.cj.build.driver.version.extra}" />
<filter token="MYSQL_CJ_VERSION_SNAPSHOT" value="${com.mysql.cj.build.driver.version.snapshot}" />
<filter token="MYSQL_CJ_VERSION" value="${com.mysql.cj.build.driver.version.full}" />
<filter token="MYSQL_CJ_VERSION_SERIES" value="${com.mysql.cj.build.driver.version.series}" />
<filter token="MYSQL_CJ_REVISION" value="${com.mysql.cj.build.git.commit}" />
<filter token="MYSQL_CJ_EXTRA_NAME" value="${com.mysql.cj.build.driver.extraName}" />
<filter token="MYSQL_CJ_EXTENDED_PROD_NAME" value="${com.mysql.cj.build.driver.extendedName}" />
<filter token="MYSQL_CJ_EXTENDED_LEGACY_PROD_NAME" value="${com.mysql.cj.build.driver.extendedLegacyName}" />
<filter token="MYSQL_CJ_FULL_PROD_NAME" value="${com.mysql.cj.build.driver.fullName}" />
<filter token="MYSQL_CJ_DISPLAY_PROD_NAME" value="${com.mysql.cj.build.driver.displayName}" />
<filter token="MYSQL_CJ_RPM_RELEASE_FULL" value="${com.mysql.cj.dist.rpm.releaseFull}" />
<filter token="MYSQL_CJ_RPM_PACKAGE_SUFFIX" value="${com.mysql.cj.dist.packageExtraName}" />
</filterset>
<!-- License replace tokens. -->
<condition property="com.mysql.cj.build.licenseType" value="commercial" else="GPL">
<istrue value="${com.mysql.cj.build.commercial}" />
</condition>
<condition property="com.mysql.cj.build.licenseName"
value="Oracle License Agreement"
else="The GNU General Public License, v2 with Universal FOSS Exception, v1.0">
<istrue value="${com.mysql.cj.build.commercial}" />
</condition>
<filterset id="licenseFilterset">
<filter token="MYSQL_CJ_LICENSE_TYPE" value="${com.mysql.cj.build.licenseType}" />
<filter token="MYSQL_CJ_LICENSE_NAME" value="${com.mysql.cj.build.licenseName}" />
<filter token="MYSQL_CJ_LICENSEURL" value="${com.mysql.cj.dist.licenseUrl}" />
</filterset>
<copy todir="${com.mysql.cj.build.dir.driver}" filtering="true" encoding="UTF-8" outputencoding="UTF-8">
<fileset dir="src/build/java" />
<fileset dir="src/build/misc" />
<fileset dir="src/generated/java" />
<fileset dir="src/main/user-api/java" />
<fileset dir="src/main/user-impl/java" />
<fileset dir="src/main/core-api/java" />
<fileset dir="src/main/core-impl/java" />
<fileset dir="src/main/protocol-impl/java" />
<fileset dir="src/main/resources" />
<fileset dir="src/legacy/java" />
<fileset dir="src/demo/java" />
<filterset refid="versionFilterset" />
<filterset refid="licenseFilterset" />
</copy>
</target>
<!-- Copy test suite source files. -->
<target name="-copy-files-testsuite" depends="-copy-files">
<mkdir dir="${com.mysql.cj.testsuite.build.dir}" />
<copy todir="${com.mysql.cj.testsuite.build.dir}/${com.mysql.cj.build.driver.fullName}" filtering="true" encoding="UTF-8" outputencoding="UTF-8">
<fileset dir="src/test/java" />
<filterset refid="versionFilterset" />
<filterset refid="licenseFilterset" />
</copy>
</target>
<!-- Copy the commercial LicenseConfiguration class (Build). -->
<target name="-copy-filter-license-build" if="${com.mysql.cj.build.filterLicense}">
<copy file="${com.mysql.cj.extra.libs}/src/CommercialLicenseConfiguration.notjava"
tofile="${com.mysql.cj.build.dir.driver}/com/mysql/cj/LicenseConfiguration.java"
overwrite="true" />
</target>
<!-- Copy the no-crypto export control class (Build). -->
<target name="-copy-no-crypto-build" if="${com.mysql.cj.build.noCrypto}">
<copy file="${com.mysql.cj.extra.libs}/src/ExportControlledNoCrypto.notjava"
tofile="${com.mysql.cj.build.dir.driver}/com/mysql/cj/protocol/ExportControlled.java"
overwrite="true" />
</target>
<!-- Replace GPL license headers by commercial license headers (Build). -->
<target name="-replace-license-headers-build" if="${com.mysql.cj.build.commercial}">
<local name="ls" />
<property name="ls" value="${line.separator}" />
<replaceregexp match="([^\r\n]*?)[ \t]*+This program is free software;.*MA 02110-1301 ?USA\r?\n"
replace="\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}"
flags="s">
<fileset dir="${com.mysql.cj.build.dir.driver}" includes="**/*" />
</replaceregexp>
</target>
<!-- Copy the commercial LicenseConfiguration class (Package). -->
<target name="-copy-filter-license-pkg" if="${com.mysql.cj.build.filterLicense}">
<copy file="${com.mysql.cj.extra.libs}/src/CommercialLicenseConfiguration.notjava"
tofile="${com.mysql.cj.dist.dir.package}/src/main/core-impl/java/com/mysql/cj/LicenseConfiguration.java"
overwrite="true" />
</target>
<!-- Copy the no-crypto export control class (Package). -->
<target name="-copy-no-crypto-pkg" if="${com.mysql.cj.build.noCrypto}">
<copy file="${com.mysql.cj.extra.libs}/src/ExportControlledNoCrypto.notjava"
tofile="${com.mysql.cj.dist.dir.package}/src/main/core-impl/java/com/mysql/cj/protocol/ExportControlled.java"
overwrite="true" />
</target>
<!-- Replace GPL license headers by commercial license headers (Package). -->
<target name="-replace-license-headers-pkg" if="${com.mysql.cj.build.commercial}">
<local name="ls" />
<property name="ls" value="${line.separator}" />
<replaceregexp match="([^\r\n]*?)[ \t]*+This program is free software;.*MA 02110-1301 ?USA\r?\n"
replace="\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}\1${ls}"
flags="s">
<fileset dir="${com.mysql.cj.dist.dir.package}" includes="**/*" excludes="README*, LICENSE*, INFO_BIN, INFO_SRC, CHANGES" />
</replaceregexp>
</target>
<!-- Copy GPL LICENSE & README files. -->
<target name="-copy-notices-gpl" unless="${com.mysql.cj.build.commercial}">
<get src="${com.mysql.cj.dist.licenseUrl}" dest="${com.mysql.cj.build.dir.driver}/LICENSE" verbose="true" />
<fixcrlf file="${com.mysql.cj.build.dir.driver}/LICENSE" tab="remove" tablength="8" eol="lf" />
<copy file="${basedir}/README" tofile="${com.mysql.cj.build.dir.driver}/README" overwrite="true" />
</target>
<!-- Copy Commercial LICENSE & README files. -->
<target name="-copy-notices-commercial" if="${com.mysql.cj.build.commercial}">
<fail message="Commercial license book URL required. Set the URL from where to fetch the license book with the property 'com.mysql.cj.dist.licenseUrl'.">
<condition>
<equals arg1="${com.mysql.cj.dist.licenseUrl}" arg2="file:${basedir}/LICENSE" />
</condition>
</fail>
<get src="${com.mysql.cj.dist.licenseUrl}" dest="${com.mysql.cj.build.dir.driver}/LICENSE" verbose="true" />
<fixcrlf file="${com.mysql.cj.build.dir.driver}/LICENSE" tab="remove" tablength="8" eol="lf" />
<copy file="${com.mysql.cj.extra.libs}/README-commercial" tofile="${com.mysql.cj.build.dir.driver}/README" overwrite="true" />
</target>
<!-- Generate info files 'INFO_BIN' and 'INFO_SRC'. -->
<target name="-init-info-files" depends="-load-info-properties">
<tstamp>
<format property="com.mysql.cj.build.time" pattern="yyyy-MM-dd HH:mm:ss Z" />
</tstamp>
<!-- Generate file 'INFO_BIN'. -->
<echo file="${com.mysql.cj.build.dir.driver}/INFO_BIN" append="no" encoding="UTF-8">build-date: ${com.mysql.cj.build.time}${line.separator}</echo>
<echo file="${com.mysql.cj.build.dir.driver}/INFO_BIN" append="yes" encoding="UTF-8">os-info: ${os.name} ${os.arch} ${os.version}${line.separator}</echo>
<echo file="${com.mysql.cj.build.dir.driver}/INFO_BIN" append="yes" encoding="UTF-8">compiler: ${com.mysql.cj.dist.jdk.compilerVersion}${line.separator}</echo>
<echo file="${com.mysql.cj.build.dir.driver}/INFO_BIN" append="yes" encoding="UTF-8">build-tool: ${ant.version}${line.separator}</echo>
<loadfile property="com.mysql.cj.build.infoBinFromFile" srcfile="${com.mysql.cj.build.dir.driver}/INFO_BIN" />
<echo>## INFO_BIN ##${line.separator}${com.mysql.cj.build.infoBinFromFile}</echo>
<!-- Generate file 'INFO_SRC'. -->
<echo file="${com.mysql.cj.build.dir.driver}/INFO_SRC" append="no" encoding="UTF-8">version: ${com.mysql.cj.build.driver.version.full}${line.separator}</echo>
<echo file="${com.mysql.cj.build.dir.driver}/INFO_SRC" append="yes" encoding="UTF-8">branch: ${com.mysql.cj.build.git.branch}${line.separator}</echo>
<echo file="${com.mysql.cj.build.dir.driver}/INFO_SRC" append="yes" encoding="UTF-8">date: ${com.mysql.cj.build.git.date}${line.separator}</echo>
<echo file="${com.mysql.cj.build.dir.driver}/INFO_SRC" append="yes" encoding="UTF-8">commit: ${com.mysql.cj.build.git.commit}${line.separator}</echo>
<echo file="${com.mysql.cj.build.dir.driver}/INFO_SRC" append="yes" encoding="UTF-8">short: ${com.mysql.cj.build.git.short}${line.separator}</echo>
<loadfile property="com.mysql.cj.build.infoSrcFromFile" srcfile="${com.mysql.cj.build.dir.driver}/INFO_SRC" />
<echo>## INFO_SRC ##${line.separator}${com.mysql.cj.build.infoSrcFromFile}</echo>
</target>
<!-- ******************************** -->
<!-- ***** BUILDING & PACKAGING ***** -->
<!-- ******************************** -->
<!-- Build binary files for distribution. -->
<target name="build" description="Compiles the driver code and builds the binary .jar file." depends="-clean-all, -init, compile">
<mkdir dir="${com.mysql.cj.build.dir.driver}/META-INF" />
<property name="com.mysql.cj.build.meta-inf.osgid-version"
value="${com.mysql.cj.build.driver.version.major}.${com.mysql.cj.build.driver.version.minor}.${com.mysql.cj.build.driver.version.subminor}" />
<property name="com.mysql.cj.build.meta-inf.crypto-imports" value="javax.net.ssl;javax.crypto;javax.crypto.spec;resolution:=optional" />
<property name="com.mysql.cj.build.meta-inf.security-imports"
value="javax.security.auth;javax.security.auth.callback;javax.security.auth.login;javax.security.auth.x500;javax.security.sasl;resolution:=optional" />
<property name="com.mysql.cj.build.meta-inf.jdbc4-imports"
value="javax.xml.parsers;javax.xml.stream;javax.xml.transform;javax.xml.transform.dom;javax.xml.transform.sax;javax.xml.transform.stax;javax.xml.transform.stream;org.w3c.dom;org.xml.sax;org.xml.sax.helpers;resolution:=optional" />
<property name="com.mysql.cj.build.meta-inf.jee-imports"
value="javax.sql;javax.naming;javax.naming.directory;javax.naming.ldap;javax.naming.spi;javax.transaction.xa;resolution:=optional" />
<property name="com.mysql.cj.build.meta-inf.jmx-imports" value="javax.management;resolution:=optional" />
<property name="com.mysql.cj.build.meta-inf.integration-imports" value="com.mchange.v2.c3p0;version="[0.9.1.2,1.0.0)";resolution:=optional" />
<property name="com.mysql.cj.build.meta-inf.logging-imports" value="org.slf4j;resolution:=optional" />
<property name="com.mysql.cj.build.meta-inf.xdevapi-imports" value="com.google.protobuf;resolution:=optional" />
<property name="com.mysql.cj.build.meta-inf.driver-exports"
value="com.mysql.cj.jdbc;version="${com.mysql.cj.build.meta-inf.osgid-version}";uses:="javax.management,javax.naming,javax.naming.spi,javax.net.ssl,javax.sql,javax.transaction.xa,javax.xml.parsers,javax.xml.stream,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,org.xml.sax"" />
<property name="com.mysql.cj.build.meta-inf.core-exports"
value="com.mysql.cj;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.protocol;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.protocol.result;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.result;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<property name="com.mysql.cj.build.meta-inf.protocol-exports"
value="com.mysql.cj.protocol.a;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.protocol.a.authentication;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.protocol.a.result;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.protocol.x;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<property name="com.mysql.cj.build.meta-inf.generated-exports"
value="com.mysql.cj.x.protobuf;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<property name="com.mysql.cj.build.meta-inf.logging-exports"
value="com.mysql.cj.log;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<property name="com.mysql.cj.build.meta-inf.util-exports"
value="com.mysql.cj.util;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.jdbc.util;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<property name="com.mysql.cj.build.meta-inf.exceptions-exports"
value="com.mysql.cj.jdbc.exceptions;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.exceptions;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<property name="com.mysql.cj.build.meta-inf.ha-exports" value="com.mysql.cj.jdbc.ha;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<property name="com.mysql.cj.build.meta-inf.interceptors-exports"
value="com.mysql.cj.jdbc.interceptors;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<property name="com.mysql.cj.build.meta-inf.integration-exports"
value="com.mysql.cj.jdbc.integration.c3p0;version="${com.mysql.cj.build.meta-inf.osgid-version}";uses:="com.mchange.v2.c3p0"" />
<property name="com.mysql.cj.build.meta-inf.configs-exports"
value="com.mysql.cj.configurations;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.conf;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.conf.url;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<property name="com.mysql.cj.build.meta-inf.legacy-exports"
value="com.mysql.jdbc;version="${com.mysql.cj.build.meta-inf.osgid-version}";uses:="com.mysql.cj.jdbc"" />
<property name="com.mysql.cj.build.meta-inf.jdbc-exports"
value="com.mysql.cj.jdbc;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.jdbc.jmx;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.jdbc.result;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<property name="com.mysql.cj.build.meta-inf.xdevapi-exports"
value="com.mysql.cj.xdevapi;version="${com.mysql.cj.build.meta-inf.osgid-version}";uses:="com.google.protobuf,javax.security.auth.callback,javax.security.sasl"" />
<property name="com.mysql.cj.build.meta-inf.admin-exports"
value="com.mysql.cj.admin;version="${com.mysql.cj.build.meta-inf.osgid-version}",com.mysql.cj.jdbc.admin;version="${com.mysql.cj.build.meta-inf.osgid-version}"" />
<manifest file="${com.mysql.cj.build.dir.driver}/META-INF/MANIFEST.MF">
<attribute name="Built-By" value="${user.name}" />
<attribute name="Specification-Title" value="JDBC" />
<attribute name="Specification-Version" value="4.2" />
<attribute name="Specification-Vendor" value="Oracle Corporation" />
<attribute name="Implementation-Title" value="${com.mysql.cj.build.driver.displayName}" />
<attribute name="Implementation-Version" value="${com.mysql.cj.build.driver.version.full}" />
<attribute name="Implementation-Vendor-Id" value="com.mysql" />
<attribute name="Implementation-Vendor" value="Oracle" />
<!-- OSGi configurations. -->
<attribute name="Bundle-Vendor" value="Oracle Corporation" />
<attribute name="Bundle-ClassPath" value="." />
<attribute name="Bundle-Version" value="${com.mysql.cj.build.meta-inf.osgid-version}" />
<attribute name="Bundle-Name" value="Oracle Corporation's JDBC and XDevAPI Driver for MySQL" />
<attribute name="Bundle-ManifestVersion" value="2" />
<attribute name="Bundle-SymbolicName" value="com.mysql.cj" />
<attribute name="Export-Package"
value="${com.mysql.cj.build.meta-inf.driver-exports},${com.mysql.cj.build.meta-inf.core-exports},${com.mysql.cj.build.meta-inf.protocol-exports},${com.mysql.cj.build.meta-inf.generated-exports},${com.mysql.cj.build.meta-inf.logging-exports},${com.mysql.cj.build.meta-inf.util-exports},${com.mysql.cj.build.meta-inf.exceptions-exports},${com.mysql.cj.build.meta-inf.ha-exports},${com.mysql.cj.build.meta-inf.interceptors-exports},${com.mysql.cj.build.meta-inf.integration-exports},${com.mysql.cj.build.meta-inf.configs-exports},${com.mysql.cj.build.meta-inf.legacy-exports},${com.mysql.cj.build.meta-inf.jdbc-exports},${com.mysql.cj.build.meta-inf.xdevapi-exports},${com.mysql.cj.build.meta-inf.admin-exports}" />
<attribute name="Import-Package"
value="${com.mysql.cj.build.meta-inf.crypto-imports},${com.mysql.cj.build.meta-inf.security-imports},${com.mysql.cj.build.meta-inf.jdbc4-imports},${com.mysql.cj.build.meta-inf.jee-imports},${com.mysql.cj.build.meta-inf.jmx-imports},${com.mysql.cj.build.meta-inf.integration-imports},${com.mysql.cj.build.meta-inf.logging-imports},${com.mysql.cj.build.meta-inf.xdevapi-imports}" />
</manifest>
<jar jarfile="${com.mysql.cj.build.dir.driver}/${com.mysql.cj.build.driver.fullName}.jar"
manifest="${com.mysql.cj.build.dir.driver}/META-INF/MANIFEST.MF"
index="true">
<fileset dir="${com.mysql.cj.build.compiler.output}"
includes="**/*.class, **/*.properties*"
excludes="demo/**, documentation/**, instrumentation/**, testsuite/**" />
<fileset dir="${com.mysql.cj.build.dir.driver}" includes="INFO_BIN, INFO_SRC, LICENSE, README" />
<metainf dir="${com.mysql.cj.build.dir.driver}/META-INF" />
<service type="java.sql.Driver" provider="com.mysql.cj.jdbc.Driver" />
</jar>
</target>
<!-- Make MySQL Connector/J GPL or commercial licensed binaries packages, that contains sources. -->
<target name="package"
description="Builds the driver, the binary .jar file and creates packages (.zip, .tar.gz) suitable for distribution that do contain sources."
depends="-clean-all, build, -make-packages, -remove-sources, -create-archives" />
<!-- Make MySQL Connector/J GPL or commercial licensed binaries packages, that do not contain sources. -->
<target name="package-no-sources"
description="Builds the driver, the binary .jar file and creates packages (.zip, .tar.gz) suitable for distribution that do not contain sources."
depends="-clean-all, build, -set-no-sources, -make-packages, -remove-sources, -create-archives" />
<!-- Build and install the driver jar into the local maven repository. -->
<target name="install" description="Builds and installs the driver jar into the local maven repository." depends="package">
<exec executable="mvn" osfamily="unix" failonerror="true" failifexecutionfails="true">
<arg line="install:install-file
-Dfile=${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}.jar
-Dsources=${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}-sources.jar
-DpomFile=${com.mysql.cj.build.dir.driver}/pom.xml
-DcreateChecksum=true" />
</exec>
</target>
<!-- Flag to exclude sources from packages. -->
<target name="-set-no-sources">
<property name="com.mysql.cj.dist.noSources" value="yes" />
</target>
<!-- Prepare a distribution package. -->
<target name="-make-packages" depends="-make-packages-init, -copy-filter-license-pkg, -copy-no-crypto-pkg, -replace-license-headers-pkg" />
<!-- Initialize a distribution package. -->
<target name="-make-packages-init" depends="build">
<delete dir="${com.mysql.cj.dist.dir.workspace}" />
<mkdir dir="${com.mysql.cj.dist.dir}" />
<mkdir dir="${com.mysql.cj.dist.dir.workspace}" />
<mkdir dir="${com.mysql.cj.dist.dir.package}" />
<patternset id="exclude.files">
<exclude name="**/*.nb*" />
<exclude name="**/*.bak" />
<exclude name="**/*.*~" />
<exclude name="**/clover/*" />
<exclude name="**/checkstyle/*" />
<exclude name="**/.*" />
</patternset>
<copy todir="${com.mysql.cj.dist.dir.package}">
<fileset dir="${com.mysql.cj.build.dir.driver}" includes="*.jar, INFO_BIN, INFO_SRC, LICENSE, README">
<patternset refid="exclude.files" />
</fileset>
<fileset dir="." includes="src/**, lib/*, build.xml, CHANGES">
<patternset refid="exclude.files" />
</fileset>
</copy>
</target>
<!-- Delete source files from package. -->
<target name="-remove-sources" if="${com.mysql.cj.dist.noSources}">
<echo>Removing sources from '${com.mysql.cj.dist.dir.package}'</echo>
<delete>
<fileset dir="${com.mysql.cj.dist.dir.package}">
<include name="**/*.java" />
<include name="build.xml" />
</fileset>
</delete>
<delete dir="${com.mysql.cj.dist.dir.package}/src" />
</target>
<!-- Create archive files with package. -->
<target name="-create-archives" depends="-create-portable-archives, -create-maven-archive" />
<!-- Create portable archives. -->
<target name="-create-portable-archives" depends="-make-packages, -set-archive-name">
<delete file="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.archiveName}.tar.gz" />
<tar destfile="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.archiveName}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset dir="${com.mysql.cj.dist.dir.workspace}">
<patternset refid="exclude.files" />
</tarfileset>
</tar>
<delete file="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.archiveName}.zip" />
<zip destfile="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.archiveName}.zip">
<fileset dir="${com.mysql.cj.dist.dir.workspace}">
<patternset refid="exclude.files" />
</fileset>
</zip>
</target>
<!-- Create a Maven bundle containing all the files to upload into the central or local repository. -->
<target name="-create-maven-archive"
depends="-make-packages, -create-maven-archive-main, -create-maven-archive-sources, -create-maven-archive-javadoc, -set-archive-name"
unless="${com.mysql.cj.dist.noMaven}">
<delete file="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.archiveName}_maven.tar.gz" />
<tar destfile="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.archiveName}_maven.tar.gz"
basedir="${com.mysql.cj.dist.dir.maven}"
compression="gzip"
longfile="gnu" />
</target>
<!-- Get the jar and other mandatory files to include in the Maven bundle. -->
<target name="-create-maven-archive-main" unless="${com.mysql.cj.dist.noMaven}">
<mkdir dir="${com.mysql.cj.dist.dir.maven}" />
<copy file="${com.mysql.cj.build.dir.driver}/${com.mysql.cj.build.driver.fullName}.jar" todir="${com.mysql.cj.dist.dir.maven}" />
<checksum file="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}.jar" forceoverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}.jar" forceoverwrite="yes" fileext=".sha1" algorithm="SHA-1" />
<copy file="${com.mysql.cj.build.dir.driver}/pom.xml" tofile="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}.pom" />
<checksum file="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}.pom" forceoverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}.pom" forceoverwrite="yes" fileext=".sha1" algorithm="SHA-1" />
</target>
<!-- Create a sources jar to include in the Maven bundle. -->
<target name="-create-maven-archive-sources" depends="-create-maven-archive-sources-check" unless="${com.mysql.cj.dist.noMavenSources}">
<jar jarfile="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}-sources.jar"
basedir="${com.mysql.cj.build.dir.driver}"
includes="**/*.java, **/*.properties*, INFO_BIN, INFO_SRC, LICENSE, README"
excludes="demo/**, documentation/**, instrumentation/**, testsuite/**" />
<checksum file="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}-sources.jar" forceoverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}-sources.jar"
forceoverwrite="yes"
fileext=".sha1"
algorithm="SHA-1" />
</target>
<!-- Create a javadoc jar to include in the Maven bundle. -->
<target name="-create-maven-archive-javadoc" unless="${com.mysql.cj.dist.noMaven}">
<delete dir="${com.mysql.cj.build.dir.javadoc}" />
<mkdir dir="${com.mysql.cj.build.dir.javadoc}" />
<tempfile property="com.mysql.cj.docs.jdk8pkg" prefix="jdk8pkg_" />
<mkdir dir="${com.mysql.cj.docs.jdk8pkg}" />
<get src="https://docs.oracle.com/javase/8/docs/api/package-list" dest="${com.mysql.cj.docs.jdk8pkg}/package-list" verbose="true" />
<javadoc destdir="${com.mysql.cj.build.dir.javadoc}"
packagenames="com.mysql.cj.*"
encoding="UTF-8"
private="yes"
source="8"
failonwarning="yes"
overview="src/main/doc/connector-j-overview.html"
windowtitle="MySQL Connector/J"
header="<b>MySQL Connector/J Reference<br>v${com.mysql.cj.build.driver.version.full}</b>"
bottom="<center>Copyright &copy; 2016, 2024, Oracle and/or its affiliates.</center>"
linkoffline="https://docs.oracle.com/javase/8/docs/api ${com.mysql.cj.docs.jdk8pkg}">
<sourcepath>
<pathelement path="src/main/user-api/java" />
<pathelement path="src/main/core-api/java" />
</sourcepath>
<classpath refid="com.mysql.cj.build.classpath" />
</javadoc>
<copy file="${com.mysql.cj.build.dir.driver}/LICENSE" todir="${com.mysql.cj.build.dir.javadoc}" />
<copy file="${com.mysql.cj.build.dir.driver}/README" todir="${com.mysql.cj.build.dir.javadoc}" />
<copy file="${com.mysql.cj.build.dir.driver}/INFO_BIN" todir="${com.mysql.cj.build.dir.javadoc}" />
<copy file="${com.mysql.cj.build.dir.driver}/INFO_SRC" todir="${com.mysql.cj.build.dir.javadoc}" />
<delete verbose="yes" includeemptydirs="yes">
<fileset dir="${basedir}" includes="jdk8pkg_*/**" />
</delete>
<jar jarfile="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}-javadoc.jar" basedir="${com.mysql.cj.build.dir.javadoc}" />
<checksum file="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}-javadoc.jar" forceoverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${com.mysql.cj.dist.dir.maven}/${com.mysql.cj.build.driver.fullName}-javadoc.jar"
forceoverwrite="yes"
fileext=".sha1"
algorithm="SHA-1" />
</target>
<!-- Check if the maven archive should include sources. -->
<target name="-create-maven-archive-sources-check">
<condition property="com.mysql.cj.dist.noMavenSources">
<or>
<istrue value="${com.mysql.cj.dist.noMaven}" />
<istrue value="${com.mysql.cj.dist.noSources}" />
</or>