forked from mysql/mysql-connector-j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
1769 lines (1452 loc) · 89.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'?>
<!--
Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
The MySQL Connector/J is licensed under the terms of the GPLv2
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most MySQL Connectors.
There are special exceptions to the terms and conditions of the GPLv2 as it is applied to
this software, see the FOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation; version 2
of the License.
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 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=".">
<description>
Compiling Connector/J
=====================
Connector/J 5.1 supports both JDBC 3 and JDBC 4+ with a single code base. This requires JDBC 3 classes to be compiled with Java 5 and JDBC 4+ to be compiled
with Java 8.
The variables 'com.mysql.jdbc.jdk5' and 'com.mysql.jdbc.jdk8' are used to find the respective compilers when building the driver. Side by side
with these, the variable 'com.mysql.jdbc.extra.libs' must point to the location of third-party libraries that we don't distribute and are required for
compiling.
Compiling all JDBC 4+ code with Java 8 alone produces some warnings since JDBC 4.0 and JDBC 4.1 classes don't require a compliler higher than Java 6. To get
more precise results and avoid warnings use the property 'com.mysql.jdbc.jre6.rtjar' to point to the Java 6 'rt.jar' library (usually in 'jre/lib/rt.jar').
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 5.1 ships with an extensive test suite that can be run simply by providing a MySQL JDBC URL in the variable 'com.mysql.jdbc.testsuite.url' and by
calling the target "test". If nothing more is set, these tests run with the JVMs referred in the variables 'com.mysql.jdbc.jdk5' and 'com.mysql.jdbc.jdk8' for
JDBC 3 and JDBC 4+ related tests respectively. Alternatively, all tests can be run with a single JVM, provided that it is pointed out in the variable
'com.mysql.jdbc.testsuite.jvm'.
Running the full test suite with different JVMs and different MySQL servers at once is also possible. The variables 'com.mysql.jdbc.testsuite.jvm' and
'com.mysql.jdbc.testsuite.url' can be suffixed with an index ".1" to ".9" to indicate the multiple alternatives which results in the matrix of all possible
combinations. The target "test-multijvm" must be called in this case.
Running only one test set is possible by setting the variable 'test' with the class' fully qualified name. If also a comma separated list of test names is
provided in the variable 'methods', then only these will be executed.
Targets: "test", "test-multijvm"
Compliance
==========
This file ships with targets for these matters. Further details can be found in the respective targets.
Coverage and instrumentation
============================
This file ships with target "test-coverage" for collecting coverage results and "report-coverage" for creating the HTML coverage report.
The JCov library needed to run these targets can be found at http://hg.openjdk.java.net/code-tools/jcov, it's JARs should be placed
into ${com.mysql.jdbc.extra.libs}/jcov directory.
The "test-coverage" target instruments classes using JCov, runs tests collecting coverage info into result file set as
${com.mysql.jdbc.coverage.result.dir}/${com.mysql.jdbc.coverage.result.name}.
The "report-coverage" target first merges coverage result files which full paths are passed via 'com.mysql.jdbc.coverage.merge.files'
property into file which path is passed via 'com.mysql.jdbc.coverage.merge.result' property, then builds the HTML report from
'com.mysql.jdbc.coverage.merge.result' file into the directory passed via 'com.mysql.jdbc.coverage.report.dir' property.
If some properties are not passed to ANT script then default values are used:
com.mysql.jdbc.coverage.result.dir - "${buildDir}/coverage"
com.mysql.jdbc.coverage.result.name - "result.xml"
com.mysql.jdbc.coverage.merge.files - none, merge step is skipped
com.mysql.jdbc.coverage.merge.result - ${com.mysql.jdbc.coverage.result.dir}/result.xml
com.mysql.jdbc.coverage.report.dir - ${com.mysql.jdbc.coverage.result.dir}/report
Targets: "test-coverage", "report-coverage"
MySQL Fabric support and testing
================================
Support for MySQL Fabric connections is seamlessly included in Connector/J, so when the driver is compiled it already includes all the required classes for it.
Testing MySQL Fabric support can be done by setting specific variables and running the respective targets. Further details can be found in the last targets in
this file.
Sample 'build.properties' that can be used to compile, build, test and test with multi JVMs
===========================================================================================
~~~start cut here~~~
# Basic settings for 'compile', 'test', 'test-multijvm' 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.jdbc.extra.libs=<full_path_to_connector-j-jardeps>
# JDKs needed for compiling:
# - Must point to JDK home directories.
# - Also used for testing if 'com.mysql.jdbc.testsuite.jvm' is not provided.
# - Mandatory.
com.mysql.jdbc.jdk5=<full_path_to_jdk1.5>
com.mysql.jdbc.jdk8=<full_path_to_jdk1.8>
# Java 6 runtime libraries for compiling JDBC 4.0 and JDBC 4.1 classes:
# - Must point to the library 'jre/lib/rt.jar'.
# - Optional. If not provided, Java 8 runtime is used in its place.
com.mysql.jdbc.jre6.rtjar=<full_path_to_jre1.6/lib/rt.jar>
# Single JVM/MySQL tests:
# - Must point to JDK or JRE home directories.
# - If not provided, JDBC 3 tests are run with 'com.mysql.jdbc.jdk5'.
# - If not provided or pointing to a Java5 JVM, JDBC 4+(<4.2) tests are run with 'com.mysql.jdbc.jdk8'.
# - If not provided or pointing to a JVM lower than 8, JDBC 4.2 tests are run with 'com.mysql.jdbc.jdk8'.
# - Optional.
com.mysql.jdbc.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.jdbc.testsuite.url=jdbc:mysql://<host>:<port>/<testDB>?user=<user>&password=<pwd>
# Multiple JVM/MySQL tests:
# - Must point to JDK or JRE home directories.
# - If pointing to a Java5 JVM, JDBC 4+(<4.2) tests are run with 'com.mysql.jdbc.jdk8' instead.
# - If pointing to a JVM lower than 8, JDBC 4.2 tests are run with 'com.mysql.jdbc.jdk8'.
# - Mandatory (at least one, at most eight) for 'test-multijdk' target.
com.mysql.jdbc.testsuite.jvm.1=<full_path_to_a_jdk_or_jre>
com.mysql.jdbc.testsuite.jvm.2=<full_path_to_a_jdk_or_jre>
com.mysql.jdbc.testsuite.jvm.3=<full_path_to_a_jdk_or_jre>
# - URL to the test database(s).
# - Any of the current MySQL versions.
# - Mandatory (at least one, at most eight) for 'test-multijdk' target.
com.mysql.jdbc.testsuite.url.1=jdbc:mysql://<host1>:<port1>/<testDB1>?user=<user1>&password=<pwd1>
com.mysql.jdbc.testsuite.url.2=jdbc:mysql://<host2>:<port2>/<testDB2>?user=<user2>&password=<pwd2>
# Cancels re-compiling between successive test executions.
# - Implicit in multiple JVM/MySQL in between iterations.
# - Comment variable if not needed.
# - Optional.
com.mysql.jdbc.noCleanBetweenCompiles=yes
# Other targets may require specific settings. Check 'build.xml' for details.
~~~end cut here~~~
</description>
<!-- ******************** -->
<!-- ***** SETTINGS ***** -->
<!-- ******************** -->
<!-- If build.properties exists, import it. -->
<property file="build.properties" />
<property name="major_version" value="5" />
<property name="minor_version" value="1" />
<property name="subminor_version" value="42" />
<property name="version_status" value="" />
<property name="version" value="${major_version}.${minor_version}.${subminor_version}${version_status}" />
<property name="prodName" value="mysql-connector-java" />
<property name="prodDisplayName" value="MySQL Connector Java" />
<property name="snapshot.version" value="-SNAPSHOT" />
<property name="extra.version" value="" />
<property name="full.version" value="${version}${extra.version}${snapshot.version}" />
<property name="extra.product.name" value="" />
<property name="fullProdName" value="${prodName}${extra.product.name}-${full.version}" />
<property name="sourceDir" value="./src" />
<property name="buildDir" value="./build" />
<property name="distDir" value="./dist" />
<property name="junit.results" value="${buildDir}/junit" />
<property name="debug.enable" value="on" />
<property name="toPackage" value="${distDir}/toArchive" />
<property name="packageDest" value="${toPackage}/${fullProdName}" />
<!-- Send class files to correct location if running in eclipse. -->
<condition property="compiler.output" value="bin" else="${buildDir}/${fullProdName}">
<or>
<isset property="eclipse.running" />
<isset property="eclipse.pdebuild.home" />
<contains string="${ant.home}" substring="plugins" />
</or>
</condition>
<!-- The following properties are needed for finding JDK5 and JDK8 needed for compile and can be passed on the command line to ant via -D switches. -->
<property name="com.mysql.jdbc.jdk5" value="/usr/lib/jvm/jdk1.5" />
<property name="com.mysql.jdbc.jdk8" value="/usr/lib/jvm/jdk1.8" />
<!-- The following property allows to point the location of third-party libraries we don't distribute. Default value points to src/lib so user could either
put these jars there or pass different location via ant -D switch. -->
<property name="com.mysql.jdbc.extra.libs" value="${sourceDir}/lib" />
<!-- The following property is needed for finding a JVM to execute the tests and can be passed on the command line to ant via -D switch. -->
<property name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.jdk5}" />
<!-- The following property is needed for building the docs and must be passed on the command line to ant via -D switch. -->
<property name="com.mysql.jdbc.docs.sourceDir" value="/tmp/connectorj/docs/prebuilt" />
<!-- The following propertyset is used to forward tests setup configurations as system variables to JUnit tasks. -->
<propertyset id="junit.system.properties">
<propertyref prefix="com.mysql.jdbc.test." />
<!-- Exclude 'testsuite' properties ending with '.url', '.url.N', '.jvm' or '.jvm.N'. -->
<propertyref regex="^com\.mysql\.jdbc\.testsuite\..*(?<!(?:url|jvm)(?:\.\d)?)$" />
</propertyset>
<!-- Java compiler arguments to widen warnings detection and fail on warnings. -->
<condition property="javac.compilerarg" value="-Xlint:all -Werror" else="">
<isset property="com.mysql.jdbc.failOnWarnings" />
</condition>
<!-- Classpaths settings. -->
<path id="built.driver.only.classpath">
<pathelement location="${buildDir}/${fullProdName}" />
</path>
<path id="project.build.classpath">
<fileset dir="${com.mysql.jdbc.extra.libs}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${buildDir}/${fullProdName}/lib">
<include name="**/*.jar" />
</fileset>
<pathelement location="${buildDir}/${fullProdName}" />
</path>
<!-- ************************* -->
<!-- ***** VERIFICATIONS ***** -->
<!-- ************************* -->
<!-- Check for required external libraries. -->
<target name="-extra-libs-check">
<fail message="The property 'com.mysql.jdbc.extra.libs' must point to a directory that contains the libraries required for build tasks.">
<condition>
<not>
<available file="${com.mysql.jdbc.extra.libs}" type="dir" />
</not>
</condition>
</fail>
<fail message="Hibernate libraries, required for build tasks, must be in the directory '${com.mysql.jdbc.extra.libs}/hibernate4'.">
<condition>
<not>
<available file="${com.mysql.jdbc.extra.libs}/hibernate4" type="dir" />
</not>
</condition>
</fail>
</target>
<!-- Check for required JDKs for compilation. -->
<target name="-compiler-check" depends="-jdk5-check, -jdk8-check, -jre6-rtjar-check" />
<!-- Check for required JDK5 for compilation of JDBC 3 implementation. -->
<target name="-jdk5-check">
<property name="com.mysql.jdbc.jdk5.java" value="${com.mysql.jdbc.jdk5}/bin/java" />
<property name="com.mysql.jdbc.jdk5.javac" value="${com.mysql.jdbc.jdk5}/bin/javac" />
<local name="com.mysql.jdbc.jdk5.version" />
<exec executable="${com.mysql.jdbc.jdk5.java}"
outputproperty="com.mysql.jdbc.jdk5.version"
failonerror="false"
failifexecutionfails="false"
resultproperty="jdk5checkexitstatus">
<arg value="-version" />
</exec>
<fail message="Java 5 is required. Set the full path to this JDK home with the property 'com.mysql.jdbc.jdk5'. Default: '/usr/lib/jvm/jdk1.5').
Java 8 (for JDBC 4+ implementation) is also required. Set the full path to this JDK home with the property 'com.mysql.jdbc.jdk8'. Default: '/usr/lib/jvm/jdk1.8'.">
<condition>
<not>
<and>
<equals arg1="${jdk5checkexitstatus}" arg2="0" />
<contains string="${com.mysql.jdbc.jdk5.version}" substring="java version "1.5" casesensitive="true" />
</and>
</not>
</condition>
</fail>
</target>
<!-- Check for required JDK8 for compilation of JDBC 4+ implementation. -->
<target name="-jdk8-check">
<property name="com.mysql.jdbc.jdk8.java" value="${com.mysql.jdbc.jdk8}/bin/java" />
<property name="com.mysql.jdbc.jdk8.javac" value="${com.mysql.jdbc.jdk8}/bin/javac" />
<local name="com.mysql.jdbc.jdk8.version" />
<exec executable="${com.mysql.jdbc.jdk8.java}"
outputproperty="com.mysql.jdbc.jdk8.version"
failonerror="false"
failifexecutionfails="false"
resultproperty="jdk8checkexitstatus">
<arg value="-version" />
</exec>
<fail message="Java 8 (for JDBC 4+ implementation) is required. Set the full path to this JDK home with the property 'com.mysql.jdbc.jdk8'. Default: '/usr/lib/jvm/jdk1.8'.">
<condition>
<not>
<and>
<equals arg1="${jdk8checkexitstatus}" arg2="0" />
<contains string="${com.mysql.jdbc.jdk8.version}" substring="java version "1.8" casesensitive="true" />
</and>
</not>
</condition>
</fail>
</target>
<!-- Check for Java 6 runtime libraries for compilation of JDBC 4.0 and JDBC 4.1 implementations. Ignored if property is undefined. -->
<target name="-jre6-rtjar-check">
<fail message="Invalid or missing Java 6 runtime library pointed by 'com.mysql.jdbc.jre6.rtjar'. ">
<condition>
<and>
<isset property="com.mysql.jdbc.jre6.rtjar" />
<not>
<available file="${com.mysql.jdbc.jre6.rtjar}" />
</not>
</and>
</condition>
</fail>
</target>
<!-- Check provided URL for running unit tests. -->
<target name="-testsuite-url-check">
<condition property="com.mysql.jdbc.testsuite.url.final" value="${com.mysql.jdbc.testsuite.url.internal}" else="${com.mysql.jdbc.testsuite.url}">
<isset property="com.mysql.jdbc.testsuite.url.internal" />
</condition>
<fail message="Set the MySQL database connection string for the test suite in one of the properties, 'com.mysql.jdbc.testsuite.url' or 'com.mysql.jdbc.testsuite.url.N', according to desired target.">
<condition>
<not>
<or>
<isset property="com.mysql.jdbc.testsuite.url.internal" />
<isset property="com.mysql.jdbc.testsuite.url" />
</or>
</not>
</condition>
</fail>
</target>
<!-- Check provided URL for running compliance tests. -->
<target name="-compliance-url-check">
<condition property="com.mysql.jdbc.compliance.url.final" value="${com.mysql.jdbc.compliance.url.internal}" else="${com.mysql.jdbc.compliance.url}">
<isset property="com.mysql.jdbc.compliance.url.internal" />
</condition>
<fail message="Set the MySQL database connection string for the compliance tests in one of the properties, 'com.mysql.jdbc.compliance.url' or 'com.mysql.jdbc.compliance.url.N', according to desired target.">
<condition>
<not>
<or>
<isset property="com.mysql.jdbc.compliance.url.internal" />
<isset property="com.mysql.jdbc.compliance.url" />
</or>
</not>
</condition>
</fail>
</target>
<!-- Check provided JVM for running tests. -->
<target name="-testsuite-jvm-check" depends="-jdk8-check">
<condition property="com.mysql.jdbc3.testsuite.jvm.java"
value="${com.mysql.jdbc.testsuite.jvm.internal}/bin/java"
else="${com.mysql.jdbc.testsuite.jvm}/bin/java">
<isset property="com.mysql.jdbc.testsuite.jvm.internal" />
</condition>
<local name="com.mysql.jdbc.testsuite.jvm.version" />
<exec executable="${com.mysql.jdbc3.testsuite.jvm.java}"
outputproperty="com.mysql.jdbc.testsuite.jvm.version"
failonerror="false"
failifexecutionfails="false"
resultproperty="jvmcheckexitstatus">
<arg value="-version" />
</exec>
<fail message="Testing Connector/J requires a JVM 1.5 or higher. Set the path to this JVM (JRE or JDK) home with the property 'com.mysql.jdbc.testsuite.jvm'. Default: '${com.mysql.jdbc.jdk5}'.">
<condition>
<not>
<equals arg1="${jvmcheckexitstatus}" arg2="0" />
</not>
</condition>
</fail>
<!-- Run JDBC 4+(<4.2) tests with ${com.mysql.jdbc.jdk8.java} if chosen JVM for tests is JVM5 -->
<condition property="com.mysql.jdbc4.testsuite.jvm.java" value="${com.mysql.jdbc.jdk8.java}" else="${com.mysql.jdbc3.testsuite.jvm.java}">
<contains string="${com.mysql.jdbc.testsuite.jvm.version}" substring="java version "1.5" casesensitive="true" />
</condition>
<!-- Run JDBC 4.2 tests with ${com.mysql.jdbc.jdk8.java} if chosen JVM for tests is JVM5 or JVM6 or JVM7 -->
<condition property="com.mysql.jdbc42.testsuite.jvm.java" value="${com.mysql.jdbc.jdk8.java}" else="${com.mysql.jdbc3.testsuite.jvm.java}">
<or>
<contains string="${com.mysql.jdbc.testsuite.jvm.version}" substring="java version "1.5" casesensitive="true" />
<contains string="${com.mysql.jdbc.testsuite.jvm.version}" substring="java version "1.6" casesensitive="true" />
<contains string="${com.mysql.jdbc.testsuite.jvm.version}" substring="java version "1.7" casesensitive="true" />
</or>
</condition>
</target>
<!-- ************************************** -->
<!-- ***** INITIALIZATION & FILE COPY ***** -->
<!-- ************************************** -->
<!-- Prepares files and settings for compiling driver. -->
<target name="init" depends="-compiler-check, -init-copy, -init-filter-license, -init-no-crypto">
<!-- 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 file="${com.mysql.jdbc.docs.sourceDir}" property="com.mysql.jdbc.docs.sourcesPresent" />
<available classname="com.mchange.v2.c3p0.QueryConnectionTester" classpathref="project.build.classpath" property="com.mysql.jdbc.c3p0Present" />
<available classname="org.apache.log4j.Logger" classpathref="project.build.classpath" property="com.mysql.jdbc.log4jPresent" />
<available classname="org.jboss.resource.adapter.jdbc.ValidConnectionChecker"
classpathref="project.build.classpath"
property="com.mysql.jdbc.jbossPresent" />
</target>
<!-- Copy source files and fix licensing header in source files. -->
<target name="-init-copy" depends="-init-copy-common, -replace-headers-commercial" />
<!-- Copy source files. -->
<target name="-init-copy-common" depends="clean">
<tstamp />
<mkdir dir="${buildDir}" />
<exec dir="."
executable="cmd"
osfamily="windows"
outputproperty="git_revision_from_cmd"
failonerror="false"
failifexecutionfails="false"
resultproperty="gitcheckexitstatus">
<arg line="/c git rev-parse --verify HEAD^^{commit}" />
</exec>
<exec executable="git"
osfamily="unix"
outputproperty="git_revision_from_cmd"
failonerror="false"
failifexecutionfails="false"
resultproperty="gitcheckexitstatus">
<arg line="rev-parse --verify 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="git_revision" value="${git_revision_from_cmd}" else="${revinfo.commit}">
<equals arg1="${gitcheckexitstatus}" arg2="0" />
</condition>
<filterset id="versionFilterset">
<filter token="MYSQL_CJ_MAJOR_VERSION" value="${major_version}" />
<filter token="MYSQL_CJ_MINOR_VERSION" value="${minor_version}" />
<filter token="MYSQL_CJ_SUBMINOR_VERSION" value="${subminor_version}" />
<filter token="MYSQL_CJ_VERSION_STATUS" value="${version_status}" />
<filter token="MYSQL_CJ_VERSION" value="${full.version}" />
<filter token="MYSQL_CJ_REVISION" value="${git_revision}" />
<filter token="MYSQL_CJ_FULL_PROD_NAME" value="${fullProdName}" />
<filter token="MYSQL_CJ_DISPLAY_PROD_NAME" value="${prodDisplayName}" />
</filterset>
<condition property="licensetype" value="commercial" else="GPL">
<isset property="com.mysql.jdbc.commercialBuild" />
</condition>
<filterset id="licenseFilterset">
<filter token="MYSQL_CJ_LICENSE_TYPE" value="${licensetype}" />
</filterset>
<copy todir="${buildDir}/${fullProdName}" filtering="true">
<fileset dir="${sourceDir}/" excludes="**/CVS">
<patternset id="classjar">
<exclude name="**/*.class*" />
<exclude name="**/*.jar" />
</patternset>
</fileset>
<filterset refid="versionFilterset" />
<filterset refid="licenseFilterset" />
</copy>
<copy todir="${buildDir}/${fullProdName}" filtering="false">
<fileset dir="${sourceDir}" excludes="**/CVS">
<patternset id="dojar">
<include name="**/*.jar*" />
</patternset>
</fileset>
</copy>
</target>
<!-- Fix licensing header in source files. -->
<target name="-replace-headers-commercial" if="com.mysql.jdbc.commercialBuild">
<replaceregexp match=" *The MySQL Connector.*1301 ?USA"
replace="${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}"
flags="s">
<fileset dir="${buildDir}/${fullProdName}" includes="**/*" />
</replaceregexp>
</target>
<!-- Add commercial license configuration class (Build). -->
<target name="-init-filter-license" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.filterLicense">
<copy file="${com.mysql.jdbc.extra.libs}/CommercialLicenseConfiguration.notjava"
toFile="${buildDir}/${fullProdName}/com/mysql/jdbc/LicenseConfiguration.java"
overwrite="true" />
</target>
<!-- Add no-crypto export control class (Build). -->
<target name="-init-no-crypto" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.noCryptoBuild">
<copy file="${com.mysql.jdbc.extra.libs}/ExportControlledNoCrypto.notjava"
toFile="${buildDir}/${fullProdName}/com/mysql/jdbc/ExportControlled.java"
overwrite="true" />
</target>
<!-- Copy commercial license configuration class (Package). -->
<target name="-copy-filter-license" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.filterLicense">
<copy file="${com.mysql.jdbc.extra.libs}/CommercialLicenseConfiguration.notjava"
toFile="${packageDest}/src/com/mysql/jdbc/LicenseConfiguration.java"
overwrite="true" />
</target>
<!-- Copy no-crypto export control class (Package). -->
<target name="-copy-no-crypto" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.noCryptoBuild">
<copy file="${com.mysql.jdbc.extra.libs}/ExportControlledNoCrypto.notjava"
toFile="${packageDest}/src/com/mysql/jdbc/ExportControlled.java"
overwrite="true" />
</target>
<!-- Copy README-commercial info (Package). -->
<target name="-copy-readme-commercial" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.commercialBuild">
<copy file="${com.mysql.jdbc.extra.libs}/README-commercial" tofile="${packageDest}/README.txt" filtering="true">
<filterset refid="versionFilterset" />
<filterset refid="licenseFilterset" />
</copy>
<copy file="${packageDest}/README.txt" tofile="${packageDest}/README" overwrite="true" />
</target>
<!-- Copy README info (Package). -->
<target name="-copy-readme-noncommercial" depends="-init-copy" unless="com.mysql.jdbc.commercialBuild">
<copy file="${basedir}/README" tofile="${packageDest}/README.txt" filtering="true">
<filterset refid="versionFilterset" />
</copy>
<copy file="${packageDest}/README.txt" tofile="${packageDest}/README" overwrite="true" />
</target>
<!-- Copy LICENCE.mysql and replace license commercial headers (Package). -->
<target name="-replace-license-commercial" depends="-extra-libs-check, -init-copy" if="com.mysql.jdbc.commercialBuild">
<delete file="${packageDest}/COPYING" />
<copy file="${com.mysql.jdbc.extra.libs}/LICENSE.mysql" toDir="${packageDest}" />
<!-- For safety. -->
<replaceregexp match=" *The MySQL Connector.*1301 ?USA"
replace="${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}${line.separator}"
flags="s">
<fileset dir="${packageDest}" includes="**/*" />
</replaceregexp>
</target>
<!-- ************************************ -->
<!-- ***** DISTRIBUTION & PACKAGING ***** -->
<!-- ************************************ -->
<!-- Make MySQL GPL-licensed or commercially-licensed binaries package, that contain sources and docs. -->
<target name="full-package"
description="Builds driver, binary .jar file, docs and packages (.zip, .tar.gz) suitable for distribution that _do_ contain sources and docs."
depends="full-dist, -make-packages, -create-archives" />
<!-- Make MySQL GPL-licensed or commercially-licensed binaries package, that doesn't contain sources but contain docs. -->
<target name="full-package-no-sources"
description="Builds driver, binary .jar file, docs and packages (.zip, .tar.gz) suitable for distribution that do _not_ contain sources but contain docs."
depends="full-dist, -make-packages, -remove-sources, -create-archives" />
<!-- Make MySQL GPL-licensed or commercially-licensed binaries package, that contain sources but no docs. -->
<target name="package"
description="Builds driver, binary .jar file, docs and packages (.zip, .tar.gz) suitable for distribution that _do_ contain sources but no docs."
depends="dist, -make-packages, -create-archives" />
<!-- Build a distribution 'image' that include docs. -->
<target name="full-dist" description="Builds driver, binary .jar file and docs, basically a distribution 'image'." depends="dist, -bundle-docs" />
<!-- 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=${mavenUploadDir}/${fullProdName}.jar
-Dsources=${mavenUploadDir}/${fullProdName}-sources.jar
-DpomFile=${buildDir}/${fullProdName}/doc/sources/pom.xml
-DcreateChecksum=true" />
</exec>
</target>
<!-- Build a distribution 'image' that doesn't include docs. -->
<target name="dist" description="Builds driver and binary .jar file, basically a distribution 'image' without docs." depends="init, compile">
<delete file="${buildDir}/${fullProdName}-bin.jar" />
<mkdir dir="${buildDir}/META-INF" />
<!-- JDBC 4+ support of service provider mechanism. -->
<mkdir dir="${buildDir}/${fullProdName}/META-INF/services/" />
<echo file="${buildDir}/${fullProdName}/META-INF/services/java.sql.Driver"
message="com.mysql.jdbc.Driver${line.separator}com.mysql.fabric.jdbc.FabricMySQLDriver" />
<property name="osgid-version" value="${major_version}.${minor_version}.${subminor_version}" />
<property name="crypto-imports" value="javax.net.ssl;javax.crypto;resolution:=optional" />
<property name="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="jee-imports" value="javax.sql;javax.naming;javax.naming.spi;javax.transaction.xa;resolution:=optional" />
<property name="jmx-imports" value="javax.management;resolution:=optional" />
<property name="integration-imports"
value="com.mchange.v2.c3p0;version="[0.9.1.2,1.0.0)";resolution:=optional,org.jboss.resource.adapter.jdbc;org.jboss.resource.adapter.jdbc.vendor;resolution:=optional" />
<property name="logging-imports" value="org.slf4j;resolution:=optional" />
<property name="fabric-imports"
value="javax.xml.datatype;org.hibernate;org.hibernate.cfg;org.hibernate.service;org.hibernate.service.jdbc.connections.spi;resolution:=optional" />
<property name="driver-exports"
value="com.mysql.jdbc;version="${osgid-version}";uses:="com.mysql.jdbc.log,javax.management,javax.naming,javax.net.ssl,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="jee-exports"
value="com.mysql.jdbc.jdbc2.optional;version="${osgid-version}";uses:="com.mysql.jdbc,com.mysql.jdbc.log,javax.sql,javax.naming,javax.naming.spi,javax.transaction.xa"" />
<property name="logging-exports" value="com.mysql.jdbc.log;version="${osgid-version}"" />
<property name="profiling-exports" value="com.mysql.jdbc.profiler;version="${osgid-version}"" />
<property name="util-exports" value="com.mysql.jdbc.util;version="${osgid-version}"" />
<property name="exceptions-exports" value="com.mysql.jdbc.exceptions;version="${osgid-version}"" />
<property name="jdbc4-exceptions-exports" value="com.mysql.jdbc.exceptions.jdbc4;version="${osgid-version}"" />
<property name="interceptors-exports" value="com.mysql.jdbc.interceptors;version="${osgid-version}"" />
<property name="integration-exports"
value="com.mysql.jdbc.integration.c3p0;version="${osgid-version}";uses:="com.mchange.v2.c3p0",com.mysql.jdbc.integration.jboss;version="${osgid-version}";uses:="org.jboss.resource.adapter.jdbc,org.jboss.resource.adapter.jdbc.vendor"" />
<property name="configs-exports" value="com.mysql.jdbc.configs;version="${osgid-version}"" />
<property name="legacy-exports" value="org.gjt.mm.mysql;version="${osgid-version}";uses:="com.mysql.jdbc"" />
<property name="fabric-exports"
value="com.mysql.fabric;com.mysql.fabric.hibernate;com.mysql.fabric.jdbc;version="${osgid-version}";uses:="com.mysql.jdbc,javax.xml.datatype;org.hibernate;org.hibernate.cfg;org.hibernate.service;org.hibernate.service.jdbc.connections.spi"" />
<manifest file="${buildDir}/${fullProdName}/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="${prodDisplayName}" />
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Implementation-Vendor-Id" value="com.mysql" />
<attribute name="Implementation-Vendor" value="Oracle" />
<!-- OSGi -->
<attribute name="Bundle-Vendor" value="Oracle Corporation" />
<attribute name="Bundle-ClassPath" value="." />
<attribute name="Bundle-Version" value="${osgid-version}" />
<attribute name="Bundle-Name" value="Oracle Corporation's JDBC Driver for MySQL" />
<attribute name="Bundle-ManifestVersion" value="2" />
<attribute name="Bundle-SymbolicName" value="com.mysql.jdbc" />
<attribute name="Export-Package"
value="${driver-exports},${jee-exports},${logging-exports},${profiling-exports},${util-exports},${exceptions-exports},${jdbc4-exceptions-exports},${interceptors-exports},${integration-exports},${configs-exports},${legacy-exports},${fabric-exports}" />
<attribute name="Import-Package"
value="${crypto-imports},${jdbc4-imports},${jee-imports},${jmx-imports},${integration-imports},${logging-imports},${fabric-imports}" />
</manifest>
<jar jarfile="${buildDir}/${fullProdName}/${fullProdName}-bin.jar"
basedir="${compiler.output}"
includes="**/*.class,**/*.properties*,META-INF/**"
excludes="testsuite/**,demo/**"
index="true"
manifest="${buildDir}/${fullProdName}/META-INF/MANIFEST.MF" />
</target>
<!-- Prepare a package for archiving. -->
<target name="-make-packages"
depends="-make-packages-init, -copy-filter-license, -copy-no-crypto, -copy-readme-commercial, -copy-readme-noncommercial, -replace-license-commercial">
<!-- Fix CRLF for various platforms. -->
<!-- For Windows-y platforms. -->
<fixcrlf srcdir="${packageDest}" tab="remove" tablength="8" eol="crlf" includes="**/README.txt" />
<!-- For Unix-y platforms. -->
<fixcrlf srcdir="${packageDest}" tab="remove" tablength="8" eol="lf" includes="**/README" />
</target>
<!-- Prepare a package for archiving (initialize). -->
<target name="-make-packages-init" depends="dist">
<mkdir dir="${distDir}" />
<mkdir dir="${toPackage}" />
<mkdir dir="${packageDest}" />
<delete dir="${toPackage}" />
<patternset id="non.test.sources">
<exclude name="**/*.nb*" />
<exclude name="**/*.bak" />
<exclude name="**/*.*~" />
<exclude name="**/clover/*" />
<exclude name="**/checkstyle/*" />
<exclude name="**/.*" />
</patternset>
<copy todir="${packageDest}">
<fileset dir="${buildDir}/${fullProdName}" includes="debug/*, docs/**, *.jar" excludes="docs/sources">
<patternset refid="non.test.sources" />
</fileset>
<fileset dir="." includes="src/com/**, src/doc/**, src/lib/*, src/org/**, src/testsuite/**, src/demo/**, build.xml, CHANGES, COPYING">
<patternset refid="non.test.sources" />
</fileset>
</copy>
</target>
<!-- Delete source files from package. -->
<target name="-remove-sources">
<echo>Removing sources from '${toPackage}'</echo>
<delete>
<fileset dir="${packageDest}">
<include name="**/*.java" />
<include name="build.xml" />
</fileset>
</delete>
<delete dir="${packageDest}/src" />
<property name="com.mysql.jdbc.noSources" value="yes" />
</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">
<delete file="${distDir}/${fullProdName}.tar.gz" />
<tar destfile="${distDir}/${fullProdName}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset dir="${toPackage}">
<patternset refid="non.test.sources" />
</tarfileset>
</tar>
<checksum file="${distDir}/${fullProdName}.tar.gz" forceOverwrite="yes" fileext=".md5" algorithm="MD5" />
<delete file="${distDir}/${fullProdName}.zip" />
<zip destfile="${distDir}/${fullProdName}.zip">
<fileset dir="${toPackage}">
<patternset refid="non.test.sources" />
</fileset>
</zip>
<checksum file="${distDir}/${fullProdName}.zip" forceOverwrite="yes" fileext=".md5" algorithm="MD5" />
</target>
<!-- Create a Maven bundle for upload to their repository. -->
<target name="-create-maven-archive"
depends="-make-packages, -create-maven-archive-common, -create-maven-archive-sources"
unless="com.mysql.jdbc.commercialBuild">
<delete file="${distDir}/${fullProdName}.maven.tar.gz" />
<tar destfile="${distDir}/${fullProdName}.maven.tar.gz" basedir="${mavenUploadDir}" compression="gzip" longfile="gnu" />
</target>
<!-- Create a Maven bundle for upload to their repository (common files to all packaging modes). -->
<target name="-create-maven-archive-common">
<tempfile destdir="${buildDir}" prefix="maven-bundle-" property="mavenUploadDir" />
<mkdir dir="${mavenUploadDir}" />
<jar jarfile="${mavenUploadDir}/${fullProdName}.jar"
basedir="${compiler.output}"
includes="**/*.class,**/*.properties*,COPYING,README,META-INF/**"
excludes="testsuite/**,demo/**"
index="true"
manifest="${buildDir}/${fullProdName}/META-INF/MANIFEST.MF" />
<checksum file="${mavenUploadDir}/${fullProdName}.jar" forceOverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${mavenUploadDir}/${fullProdName}.jar" forceOverwrite="yes" fileext=".sha1" algorithm="SHA-1" />
<copy file="${buildDir}/${fullProdName}/doc/sources/pom.xml" toFile="${mavenUploadDir}/${fullProdName}.pom" filtering="true" />
<checksum file="${mavenUploadDir}/${fullProdName}.pom" forceOverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${mavenUploadDir}/${fullProdName}.pom" forceOverwrite="yes" fileext=".sha1" algorithm="SHA-1" />
<copy file="./COPYING" toDir="${mavenUploadDir}" />
<checksum file="${mavenUploadDir}/COPYING" forceOverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${mavenUploadDir}/COPYING" forceOverwrite="yes" fileext=".sha1" algorithm="SHA-1" />
</target>
<!-- Create a Maven bundle for upload to their repository (include sources). -->
<target name="-create-maven-archive-sources" depends="-create-maven-archive-common" unless="com.mysql.jdbc.noSources">
<jar jarfile="${mavenUploadDir}/${fullProdName}-sources.jar"
basedir="${compiler.output}"
includes="**/*.java,**/*.properties*,COPYING,README,README.txt"
excludes="testsuite/**,demo/**,doc/**" />
<checksum file="${mavenUploadDir}/${fullProdName}-sources.jar" forceOverwrite="yes" fileext=".md5" algorithm="MD5" />
<checksum file="${mavenUploadDir}/${fullProdName}-sources.jar" forceOverwrite="yes" fileext=".sha1" algorithm="SHA-1" />
</target>
<!-- Prepare docs to include in a distribution. -->
<target name="-bundle-docs" depends="init" if="com.mysql.jdbc.docs.sourcesPresent">
<copy file="${com.mysql.jdbc.docs.sourceDir}/en/html/connector-j.html" todir="${buildDir}/${fullProdName}/docs" failonerror="false" />
<copy file="${com.mysql.jdbc.docs.sourceDir}/en/pdf/connector-j.pdf" todir="${buildDir}/${fullProdName}/docs" failonerror="false" />
<copy file="${com.mysql.jdbc.docs.sourceDir}/en/txt/connector-j.txt" tofile="${buildDir}/${fullProdName}/docs/README.txt" failonerror="false" />
</target>
<!-- ********************* -->
<!-- ***** COMPILING ***** -->
<!-- ********************* -->
<!-- Compile the driver including JDBC 3 and JDBC 4+ implementations, JUnit test suite and 'helpers' for third-party software. -->
<target name="compile"
description="Compiles driver including JDBC 3 and JDBC 4+ implementations, JUnit test suite and integration 'helpers' for third-party software."
depends="init, compile-driver, compile-testsuite, compile-integration" />
<!-- Compile the driver including JDBC 3 and JDBC 4+ implementations only. -->
<target name="compile-driver"
description="Compiles driver including JDBC 3 and JDBC 4+ implementations only."
depends="-compile-driver-jdbc3, -compile-driver-jdbc4" />
<!-- Compile JDBC 3 implementation. -->
<target name="-compile-driver-jdbc3" depends="init, -clean-output">
<echo>Compiling MySQL Connector/J JDBC 3 implementation with '${com.mysql.jdbc.jdk5}' to '${compiler.output}'</echo>
<javac sourcepath=""
srcdir="${buildDir}/${fullProdName}"
destdir="${compiler.output}"
deprecation="off"
debug="${debug.enable}"
fork="yes"
executable="${com.mysql.jdbc.jdk5.javac}"
compiler="modern"
includeantruntime="false"
source="1.5"
target="1.5">
<include name="**/*.java" />
<exclude name="testsuite/**" />
<exclude name="com/mysql/jdbc/integration/**" />
<exclude name="com/mysql/jdbc/log/Log4JLogger.java" />
<exclude name="**/JDBC4*.java" />
<exclude name="**/FabricMultiTenantConnectionProvider.java" />
<exclude name="**/HibernateFabric.java" />
<exclude name="com/mysql/jdbc/exceptions/jdbc4/*" />
<classpath refid="project.build.classpath" />
<compilerarg line="${javac.compilerarg}" />
</javac>
</target>
<!-- Compile JDBC 4+ implementation. -->
<target name="-compile-driver-jdbc4" depends="-compile-driver-jdbc3">
<echo>Compiling MySQL Connector/J JDBC 4+ implementation with '${com.mysql.jdbc.jdk8}' to '${compiler.output}'</echo>
<javac sourcepath=""
srcdir="${buildDir}/${fullProdName}"
destdir="${compiler.output}"
deprecation="off"
debug="${debug.enable}"
fork="yes"
executable="${com.mysql.jdbc.jdk8.javac}"
compiler="modern"
includeantruntime="false"
bootclasspath="${com.mysql.jdbc.jre6.rtjar}"
source="1.6"
target="1.6">
<include name="**/FabricMultiTenantConnectionProvider.java" />
<include name="**/HibernateFabric.java" />
<include name="**/JDBC4*.java" />
<exclude name="**/JDBC42*.java" />
<include name="com/mysql/jdbc/exceptions/jdbc4/*" />
<classpath refid="project.build.classpath" />
<compilerarg line="${javac.compilerarg}" />
</javac>
<javac sourcepath=""
srcdir="${buildDir}/${fullProdName}"
destdir="${compiler.output}"
deprecation="off"
debug="${debug.enable}"
fork="yes"
executable="${com.mysql.jdbc.jdk8.javac}"
compiler="modern"
includeantruntime="false"
source="1.8"
target="1.8">
<include name="**/JDBC42*.java" />
<classpath refid="project.build.classpath" />
<compilerarg line="${javac.compilerarg}" />
</javac>
</target>
<!-- Compile the driver including JDBC 3 and JDBC 4+ implementations and JUnit test suite. -->
<target name="compile-testsuite"
description="Compiles driver including JDBC 3 and JDBC 4+ implementations and JUnit test suite."
depends="init, compile-driver">
<echo>Compiling MySQL Connector/J testsuite with '${com.mysql.jdbc.jdk5}' to '${compiler.output}'</echo>
<javac sourcepath=""
srcdir="${buildDir}/${fullProdName}"
destdir="${compiler.output}"
deprecation="off"
debug="${debug.enable}"
fork="yes"
executable="${com.mysql.jdbc.jdk5.javac}"
compiler="modern"
includeantruntime="false"
source="1.5"
target="1.5">
<include name="testsuite/**" />
<exclude name="testsuite/requiresNonRedists/**" />
<exclude name="testsuite/**/jdbc4*/**" />
<classpath refid="project.build.classpath" />
<compilerarg line="${javac.compilerarg}" />
</javac>
<javac sourcepath=""
srcdir="${buildDir}/${fullProdName}"
destdir="${compiler.output}"
deprecation="off"
debug="${debug.enable}"
fork="yes"
executable="${com.mysql.jdbc.jdk8.javac}"
compiler="modern"
includeantruntime="false"
bootclasspath="${com.mysql.jdbc.jre6.rtjar}"
source="1.6"
target="1.6">
<include name="testsuite/**/jdbc4/**" />
<classpath refid="project.build.classpath" />
<compilerarg line="${javac.compilerarg}" />
</javac>
<javac sourcepath=""
srcdir="${buildDir}/${fullProdName}"
destdir="${compiler.output}"
deprecation="off"
debug="${debug.enable}"
fork="yes"
executable="${com.mysql.jdbc.jdk8.javac}"
compiler="modern"
includeantruntime="false"
source="1.8"
target="1.8">
<include name="testsuite/**/jdbc42/**" />
<classpath refid="project.build.classpath" />
<compilerarg line="${javac.compilerarg}" />
</javac>
</target>
<!-- Compile the driver including JDBC 3 and JDBC 4+ implementations and integration 'helpers' for third-party software. -->
<target name="compile-integration"
description="Compiles driver including JDBC 3 and JDBC 4+ implementations and integration 'helpers' for third-party software."
depends="compile-driver, -compile-integration-c3p0, -compile-integration-jboss, -compile-integration-log4j" />
<!-- Compile c3p0 integration. -->
<target name="-compile-integration-c3p0" depends="compile-driver" if="com.mysql.jdbc.c3p0Present">
<echo>Compiling MySQL Connector/J-c3p0 integration with '${com.mysql.jdbc.jdk5}' to '${compiler.output}'</echo>
<javac sourcepath=""
srcdir="${buildDir}/${fullProdName}"
destdir="${compiler.output}"
deprecation="off"
debug="${debug.enable}"
fork="yes"
executable="${com.mysql.jdbc.jdk5.javac}"
compiler="modern"
includeantruntime="false"
source="1.5"
target="1.5">
<include name="com/mysql/jdbc/integration/c3p0/**" />
<classpath refid="project.build.classpath" />