forked from mysql/mysql-connector-j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
1610 lines (1314 loc) · 88.3 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, 2022, 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 also distributed with certain software (including but not
limited to OpenSSL) 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 included with MySQL.
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="dist" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
<description>
Compiling Connector/J
=====================
Connector/J 8.0 supports JDBC4.2 and implements the X DevAPI. This requires JDBC classes to be compiled with Java 8.
The variable 'com.mysql.cj.build.jdk' is used to find the compiler when building the driver. Side by side with these, the variable 'com.mysql.cj.extra.libs'
must point to the location of third-party libraries that we don't distribute and are required for compiling. Further details can be found in
http://dev.mysql.com/doc/connector-j/en/connector-j-installing-source.html.
Targets: "dist", "full-dist", "package", "full-package", "full-package-no-sources", "compile", "install"
Testing Connector/J
===================
Connector/J 8.0 ships with an extensive test suite that can be run simply by providing a MySQL JDBC URL in the variable 'com.mysql.cj.testsuite.url' and by
calling the target "test". If nothing more is set, these tests run 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 these 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 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 - should the driver be compiled with debugging info: [${com.mysql.cj.build.addDebugInfo}]
com.mysql.cj.build.noCleanBetweenCompiles - don't clean artifacts from previous build: [_unset_]
com.mysql.cj.build.failOnWarnings - fail the build when any warning is found: [_unset_]
com.mysql.cj.build.verbose - log the extended build info: [_unset_]
com.mysql.cj.build.commercial - build commercial variant of the driver: [_unset_]
com.mysql.cj.build.filterLicense - build ISV variant of the driver: [_unset_]
com.mysql.cj.build.noCrypto - build the driver without SSL support: [_unset_]
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 - standard version string (includes version status): [${com.mysql.cj.build.driver.version.numeric}${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.major}.${com.mysql.cj.build.driver.version.minor}]
com.mysql.cj.build.driver.version.numeric - numeric version, i.e. x.y.z: [${com.mysql.cj.build.driver.version.series}.${com.mysql.cj.build.driver.version.subminor}}
com.mysql.cj.build.driver.version.extra - optional version information appended to the full 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}${com.mysql.cj.build.driver.version.extra}${com.mysql.cj.build.driver.version.snapshot}]
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.name}${com.mysql.cj.build.driver.extraName}]
com.mysql.cj.build.driver.fullName - full product name (includes version): [${com.mysql.cj.build.driver.extendedName}-${com.mysql.cj.build.driver.version.full}]
com.mysql.cj.build.dir - root directory for driver build: [${com.mysql.cj.build.dir}]
com.mysql.cj.build.dir.driver - driver build dir: [${com.mysql.cj.build.dir}/${com.mysql.cj.build.driver.fullName}]
com.mysql.cj.dist.packageName - final package name: [${com.mysql.cj.build.driver.extendedName}[${com.mysql.cj.dist.packageWithSourcesSuffix}|${com.mysql.cj.dist.packageNoSourcesSuffix}|_none_]-${com.mysql.cj.build.driver.version.full}]
com.mysql.cj.dist.packageSuffix - suffix added to package name (depends on package type): [${com.mysql.cj.dist.packageWithSourcesSuffix}|${com.mysql.cj.dist.packageNoSourcesSuffix}|_unset_]
com.mysql.cj.dist.packageWithSourcesSuffix - suffix for packages containing sources if not by default: [${com.mysql.cj.dist.packageWithSourcesSuffix}]
com.mysql.cj.dist.packageNoSourcesSuffix - suffix for packages not containing sources if not by default: [${com.mysql.cj.dist.packageNoSourcesSuffix}]
com.mysql.cj.dist.noSources - don't include sources into dist packages: [_unset]
com.mysql.cj.dist.noMavenSources - don't include sources into Maven package: [_unset_]
com.mysql.cj.dist.licenseUrl - license book location: [${com.mysql.cj.dist.licenseUrl}]
com.mysql.cj.dist.dir - root directory for driver packaging: [${com.mysql.cj.dist.dir}]
com.mysql.cj.dist.dir.prepare - directory for preparing packages: [${com.mysql.cj.dist.dir.prepare}]
com.mysql.cj.dist.dir.package - directory for preparing packages for given package name: [${com.mysql.cj.dist.dir.prepare}/${com.mysql.cj.build.driver.extendedName}[${com.mysql.cj.dist.packageWithSourcesSuffix}|${com.mysql.cj.dist.packageNoSourcesSuffix}|_none_]-${com.mysql.cj.build.driver.version.full}]
com.mysql.cj.dist.dir.maven - directory for preparing Maven packages: [${com.mysql.cj.dist.dir.prepare}/${com.mysql.cj.build.driver.extendedName}[${com.mysql.cj.dist.packageWithSourcesSuffix}|${com.mysql.cj.dist.packageNoSourcesSuffix}|_none_]-${com.mysql.cj.build.driver.version.full}-maven-bundle]
com.mysql.cj.dist.dir.prebuilt.docs - where to take prebuilt documentation files for adding them to packages: [${com.mysql.cj.dist.dir.prebuilt.docs}]
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.: [docs]
Available test properties
=========================
com.mysql.cj.testsuite.build.dir - root directory for building testsuite, default '${com.mysql.cj.testsuite.build.dir}'
com.mysql.cj.testsuite.junit.results - where to put junit reports, default '${com.mysql.cj.testsuite.junit.results}'
com.mysql.cj.testsuite.jvm - run testsuite under this one JVM, default '${com.mysql.cj.testsuite.jvm}'
com.mysql.cj.testsuite.url - connection string to the main test server, default _unset_
com.mysql.cj.testsuite.mysqlx.url - connection string to the test server with xplugin, default _unset_
com.mysql.cj.testsuite.test.class - testcase class name to run, default _unset_
com.mysql.cj.testsuite.test.methods - a comma separated list of test names existing in class defined by 'com.mysql.cj.testsuite.test.class', default _unset_
com.mysql.cj.testsuite.unavailable.host - a host:port pair used for tests checking socket connection timeout
See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test options.
</description>
<!-- ******************** -->
<!-- ***** SETTINGS ***** -->
<!-- ******************** -->
<!-- If build.properties exists, import it. -->
<property file="build.properties" />
<property name="com.mysql.cj.build.driver.version.major" value="8" />
<property name="com.mysql.cj.build.driver.version.minor" value="0" />
<property name="com.mysql.cj.build.driver.version.subminor" value="28" />
<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.displayName" value="MySQL Connector/J" />
<property name="com.mysql.cj.build.driver.name" 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.fullName" value="${com.mysql.cj.build.driver.extendedName}-${com.mysql.cj.build.driver.version.full}" />
<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.dist.licenseUrl" value="file:./LICENSE" />
<property name="com.mysql.cj.dist.packageWithSourcesSuffix" value="-src" />
<property name="com.mysql.cj.dist.packageNoSourcesSuffix" value="-no_src" />
<property name="com.mysql.cj.dist.dir" value="dist" />
<property name="com.mysql.cj.dist.dir.prepare" value="${com.mysql.cj.dist.dir}/toArchive" />
<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.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>
<!-- The JDK used to compile the code. -->
<property name="com.mysql.cj.build.jdk" value="/usr/lib/jvm/jdk1.8" />
<!-- Generate debugging info in compiled code. -->
<property name="com.mysql.cj.build.addDebugInfo" value="yes" />
<!-- Location of third-party libraries we don't distribute and extra source files. -->
<property name="com.mysql.cj.extra.libs" value="lib" />
<!-- JVM used to execute the tests. -->
<property name="com.mysql.cj.testsuite.jvm" value="${com.mysql.cj.build.jdk}" />
<!-- Include the prebuilt docs into packages. -->
<property name="com.mysql.cj.dist.dir.prebuilt.docs" value="/tmp/connectorj/docs/prebuilt" />
<!-- This propertyset is used to forward tests setup configurations as system variables to JUnit tasks. -->
<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 -Werror" else="">
<istrue value="${com.mysql.cj.build.failOnWarnings}" />
</condition>
<!-- Path settings. -->
<path id="com.mysql.cj.extra.libs.class.path" cache="true">
<fileset dir="${com.mysql.cj.extra.libs}">
<include name="**/*.jar" />
<exclude name="ant/**" />
<exclude name="jacoco/**" />
<exclude name="src/**" />
</fileset>
</path>
<path id="com.mysql.cj.build.class.path">
<path refid="com.mysql.cj.extra.libs.class.path" />
<pathelement location="${com.mysql.cj.build.dir.driver}" />
</path>
<path id="com.mysql.cj.build.instrumentation.class.path">
<path refid="com.mysql.cj.build.class.path" />
<pathelement location="${com.mysql.cj.build.compiler.output}" />
</path>
<path id="com.mysql.cj.testsuite.build.classpath">
<path refid="com.mysql.cj.extra.libs.class.path" />
<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 for required external libraries. -->
<target name="-extra-libs-check">
<fail message="The property 'com.mysql.cj.extra.libs' must point to a directory that contains the libraries required for build 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.class.path" />
</available>
</and>
</not>
</condition>
</fail>
</target>
<!-- Check for required JDKs for compilation. -->
<target name="-compiler-check" depends="-jdk-check" />
<!-- Check for required JDK for compilation of JDBC implementation. -->
<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. Set the full path to this 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 provided 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="Testing Connector/J requires a JVM 1.8 or higher. Set the path to this 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>
<!-- ************************************** -->
<!-- ***** INITIALIZATION & FILE COPY ***** -->
<!-- ************************************** -->
<!-- Prepares files and settings for compiling driver. -->
<target name="init" depends="-extra-libs-check, -compiler-check, -init-copy, -init-notices-commercial, -init-notices-gpl, -init-info-files">
<!-- The following is needed for source distributions as the classpath can't be dynamically altered, and not having this directory present causes the
build to fail. -->
<available property="com.mysql.cj.prebuiltDocsPresent" file="${com.mysql.cj.dist.dir.prebuilt.docs}" />
<available property="com.mysql.cj.c3p0Present" classname="com.mchange.v2.c3p0.QueryConnectionTester" classpathref="com.mysql.cj.build.class.path" />
</target>
<!-- Load revision details either from 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 builds environment, 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 licensing header in source files. -->
<target name="-init-copy" depends="-init-copy-common, -init-filter-license, -init-no-crypto, -init-license-headers" />
<!-- Copy source files. -->
<target name="-init-copy-common" depends="clean, -load-info-properties">
<mkdir dir="${com.mysql.cj.build.dir}" />
<!-- Calculate the RPM release field, adding status, extra and snapshoot 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 snapshoot, 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>
<!-- Common filterset. -->
<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_RPM_RELEASE_FULL" value="${com.mysql.cj.dist.rpm.releaseFull}" />
<filter token="MYSQL_CJ_REVISION" value="${com.mysql.cj.build.git.commit}" />
<filter token="MYSQL_CJ_PROD_NAME" value="${com.mysql.cj.build.driver.name}" />
<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_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_LICENSEURL" value="${com.mysql.cj.dist.licenseUrl}" />
</filterset>
<condition property="com.mysql.cj.build.licenseType" value="commercial" else="GPL">
<istrue value="${com.mysql.cj.build.commercial}" />
</condition>
<filterset id="licenseFilterset">
<filter token="MYSQL_CJ_LICENSE_TYPE" value="${com.mysql.cj.build.licenseType}" />
</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 source files. -->
<target name="-init-copy-test" depends="-init-copy">
<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>
<!-- Fix license headers in source files (Build). -->
<target name="-init-license-headers" 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}\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>
<!-- Add commercial license configuration class (Build). -->
<target name="-init-filter-license" 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>
<!-- Add no-crypto export control class (Build). -->
<target name="-init-no-crypto" 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>
<!-- Copy commercial license configuration class (Package). -->
<target name="-copy-filter-license" 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 no-crypto export control class (Package). -->
<target name="-copy-no-crypto" 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 commercial license headers (Package). -->
<target name="-replace-license-headers" 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}\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="-init-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="-init-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:./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>
<!-- ************************************ -->
<!-- ***** DISTRIBUTION & PACKAGING ***** -->
<!-- ************************************ -->
<!-- Make MySQL GPL-licensed or commercially-licensed binaries package, that contain sources and documentation. -->
<target name="full-package"
description="Builds driver, binary .jar file, documentation and packages (.zip, .tar.gz) suitable for distribution that _do_ contain sources and documentation."
depends="real-clean, full-dist, -make-packages, -remove-sources, -create-archives" />
<!-- Make MySQL GPL-licensed or commercially-licensed binaries package, that doesn't contain sources but contain documentation. -->
<target name="full-package-no-sources"
description="Builds driver, binary .jar file, documentation and packages (.zip, .tar.gz) suitable for distribution that do _not_ contain sources but contains documentation."
depends="-set-no-sources, full-package" />
<!-- Make MySQL GPL-licensed or commercially-licensed binaries package, that contain sources but no documentation. -->
<target name="package"
description="Builds driver, binary .jar file and packages (.zip, .tar.gz) suitable for distribution that _do_ contain sources but no documentation."
depends="real-clean, dist, -make-packages, -create-archives" />
<!-- Build a distribution 'image' that include documentation. -->
<target name="full-dist"
description="Builds driver, binary .jar file and documentation, basically a distribution 'image'."
depends="real-clean, dist, -bundle-documentation" />
<!-- Build a distribution 'image' that doesn't include documentation. -->
<target name="dist" description="Builds driver and binary .jar file, basically a distribution 'image' without documentation." depends="init, compile">
<delete file="${com.mysql.cj.build.dir.driver}/${com.mysql.cj.build.driver.fullName}.jar" />
<!-- JDBC 4+ support of service provider mechanism. -->
<mkdir dir="${com.mysql.cj.build.dir.driver}/META-INF/services/" />
<echo file="${com.mysql.cj.build.dir.driver}/META-INF/services/java.sql.Driver" message="com.mysql.cj.jdbc.Driver" />
<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>
<!-- Add legal notices and INFO files to META-INF -->
<copy todir="${com.mysql.cj.build.dir.driver}/META-INF">
<filelist dir="${com.mysql.cj.build.dir.driver}">
<file name="INFO_BIN" />
<file name="INFO_SRC" />
<file name="LICENSE" />
<file name="README" />
</filelist>
</copy>
<jar jarfile="${com.mysql.cj.build.dir.driver}/${com.mysql.cj.build.driver.fullName}.jar"
basedir="${com.mysql.cj.build.compiler.output}"
includes="**/*.class, **/*.properties*, META-INF/**"
excludes="demo/**, documentation/**, instrumentation/**, testsuite/**"
index="true"
manifest="${com.mysql.cj.build.dir.driver}/META-INF/MANIFEST.MF" />
</target>
<!-- 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="full-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 package for archiving. -->
<target name="-make-packages" depends="-make-packages-init, -copy-filter-license, -copy-no-crypto, -replace-license-headers" />
<!-- Prepare a package for archiving (initialize). -->
<target name="-make-packages-init" depends="-set-package-name, dist">
<delete dir="${com.mysql.cj.dist.dir.prepare}" />
<property name="com.mysql.cj.dist.dir.package" value="${com.mysql.cj.dist.dir.prepare}/${com.mysql.cj.dist.packageName}" />
<mkdir dir="${com.mysql.cj.dist.dir}" />
<mkdir dir="${com.mysql.cj.dist.dir.prepare}" />
<mkdir dir="${com.mysql.cj.dist.dir.package}" />
<patternset id="non.test.sources">
<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="docs/**, *.jar, INFO_BIN, INFO_SRC, LICENSE, README" excludes="docs/sources">
<patternset refid="non.test.sources" />
</fileset>
<fileset dir="." includes="src/**, lib/*, build.xml, CHANGES">
<patternset refid="non.test.sources" />
</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.prepare}'</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-common-archives, -create-maven-archive" />
<!-- Create common archives. -->
<target name="-create-common-archives" depends="-make-packages, -set-package-name">
<delete file="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.packageName}.tar.gz" />
<tar destfile="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.packageName}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset dir="${com.mysql.cj.dist.dir.prepare}">
<patternset refid="non.test.sources" />
</tarfileset>
</tar>
<checksum file="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.packageName}.tar.gz" forceoverwrite="yes" fileext=".md5" algorithm="MD5" />
<delete file="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.packageName}.zip" />
<zip destfile="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.packageName}.zip">
<fileset dir="${com.mysql.cj.dist.dir.prepare}">
<patternset refid="non.test.sources" />
</fileset>
</zip>
<checksum file="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.packageName}.zip" forceoverwrite="yes" fileext=".md5" algorithm="MD5" />
</target>
<!-- Create a Maven bundle with all the files to upload to central repository. -->
<target name="-create-maven-archive"
depends="-make-packages, -create-maven-archive-common, -create-maven-archive-sources, -set-package-name"
unless="${com.mysql.cj.build.commercial}">
<delete file="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.packageName}.maven.tar.gz" />
<tar destfile="${com.mysql.cj.dist.dir}/${com.mysql.cj.dist.packageName}.maven.tar.gz"
basedir="${com.mysql.cj.dist.dir.maven}"
compression="gzip"
longfile="gnu" />
</target>
<!-- Create the jar and collect common files to include in the Maven bundle. -->
<target name="-create-maven-archive-common" depends="-set-package-name" unless="${com.mysql.cj.build.commercial}">
<property name="com.mysql.cj.dist.dir.maven" value="${com.mysql.cj.dist.dir.prepare}/${com.mysql.cj.dist.packageName}-maven-bundle" />
<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" />
<copy file="${com.mysql.cj.build.dir.driver}/LICENSE" todir="${com.mysql.cj.dist.dir.maven}" />
<checksum file="${com.mysql.cj.dist.dir.maven}/LICENSE" forceoverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${com.mysql.cj.dist.dir.maven}/LICENSE" forceoverwrite="yes" fileext=".sha1" algorithm="SHA-1" />
<copy file="${com.mysql.cj.build.dir.driver}/README" todir="${com.mysql.cj.dist.dir.maven}" />
<checksum file="${com.mysql.cj.dist.dir.maven}/README" forceoverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${com.mysql.cj.dist.dir.maven}/README" forceoverwrite="yes" fileext=".sha1" algorithm="SHA-1" />
<copy file="${com.mysql.cj.build.dir.driver}/INFO_BIN" todir="${com.mysql.cj.dist.dir.maven}" />
<checksum file="${com.mysql.cj.dist.dir.maven}/INFO_BIN" forceoverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${com.mysql.cj.dist.dir.maven}/INFO_BIN" forceoverwrite="yes" fileext=".sha1" algorithm="SHA-1" />
<copy file="${com.mysql.cj.build.dir.driver}/INFO_SRC" todir="${com.mysql.cj.dist.dir.maven}" />
<checksum file="${com.mysql.cj.dist.dir.maven}/INFO_SRC" forceoverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${com.mysql.cj.dist.dir.maven}/INFO_SRC" 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, -create-maven-archive-common"
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.compiler.output}"
includes="**/*.java, **/*.properties*, META-INF/**"
excludes="demo/**, documentation/**, instrumentation/**, testsuite/**, META-INF/services/**, META-INF/MANIFEST.MF" />
<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>
<!-- Check if a maven archive with sources must be prepared. -->
<target name="-create-maven-archive-sources-check">
<condition property="com.mysql.cj.dist.noMavenSources">
<or>
<istrue value="${com.mysql.cj.dist.noSources}" />
<istrue value="${com.mysql.cj.build.commercial}" />
</or>
</condition>
</target>
<!-- Prepare documentation to include in a distribution. -->
<target name="-bundle-documentation" depends="init" if="${com.mysql.cj.prebuiltDocsPresent}">
<copy file="${com.mysql.cj.dist.dir.prebuilt.docs}/en/html/connector-j.html" todir="${com.mysql.cj.build.dir.driver}/docs" failonerror="false" />
<copy file="${com.mysql.cj.dist.dir.prebuilt.docs}/en/pdf/connector-j.pdf" todir="${com.mysql.cj.build.dir.driver}/docs" failonerror="false" />
<copy file="${com.mysql.cj.dist.dir.prebuilt.docs}/en/txt/connector-j.txt"