File: build.xml

package info (click to toggle)
mysql-connector-java 3.1.7-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,768 kB
  • ctags: 4,199
  • sloc: java: 39,428; xml: 5,261; makefile: 14
file content (830 lines) | stat: -rw-r--r-- 32,085 bytes parent folder | download
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
<?xml version='1.0'?>
<!--
   Copyright (C) 2002-2004 MySQL AB

   This program is free software; you can redistribute it and/or modify
   it under the terms of version 2 of the GNU General Public License as 
   published by the Free Software Foundation.

   There are special exceptions to the terms and conditions of the GPL 
   as it is applied to this software. View the full text of the 
   exception in file EXCEPTIONS-CONNECTOR-J in the directory of this 
   software distribution.

   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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-->

<!-- version $Id: build.xml,v 1.26.4.38 2005/02/05 06:23:59 mmatthew Exp $ -->

<project name="MySQL Connector/J" default="dist" basedir=".">
	<property name="major_version" value="3"/>
	<property name="minor_version" value="1"/>
	<property name="subminor_version" value="7"/>
	<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="extra.version" value=""/>
	<property name="fullProdName" value="${prodName}-${version}${extra.version}"/>

	<property name="buildDir" value="../build-mysql-jdbc"/>
	<property name="distDir" value="../dist-mysql-jdbc"/>
	<property name="junit.results" value="${buildDir}/junit"/>
	<property name="debug.enable" value="on" />

	<!-- 
	
	     The following four properties are needed for building the docs. They're
	     set to the defaults for my development environment, but can be passed
	     on the command line to ant via -D switches. 
	-->

	<property name="com.mysql.jdbc.docs.sourceDir" value="/home/mmatthew/work/docs/mysqldoc/Docs/connector-j-en.xml"/>
	<property name="com.mysql.jdbc.docs.DocBookXSL" value="/usr/local/share/docbook-xsl-1.60.1"/>
	<property name="com.mysql.jdbc.docs.FopPath" value="/usr/java/fop-0.20.5/fop"/>
	<property name="com.mysql.jdbc.docs.LinksPath" value="/usr/bin/links"/>

	<path id="project.build.classpath">
		<fileset dir="lib-nodist">
			<include name="**/*.jar"/>
		</fileset>

		<fileset dir="lib">
			<include name="**/*.jar"/>
		</fileset>

		<pathelement location="${buildDir}/${fullProdName}" />
	</path>

	<target name="init" depends="-initCopy, -initAuthClient, -initNoCrypto">
		<!-- Check that files needed to generate documentation are in place -->

		<available file="${com.mysql.jdbc.docs.sourceDir}" property="com.mysql.jdbc.docs.sourcesPresent"/>
		<available file="${com.mysql.jdbc.docs.DocBookXSL}" property="com.mysql.jdbc.docs.docBookPresent"/>
		<available file="${com.mysql.jdbc.docs.FopPath}" property="com.mysql.jdbc.docs.fopPresent"/>
	</target>

	<target name="-initCopy" depends="clean">
		<tstamp/>

		<filter token="VERSION" value="${version}"/>

		<copy todir="${buildDir}/${fullProdName}" filtering="true">
			<fileset dir="." excludes="**/CVS">
				<patternset id="classjar" >
					<exclude name="**/*.class*"/>
					<exclude name="**/*.jar"/>
				</patternset>
			</fileset>


			<filterset>
				<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="${version}"/>
				<filter token="MYSQL_CJ_FULL_PROD_NAME" value="${fullProdName}"/>
			</filterset>
		</copy>

		<copy todir="${buildDir}/${fullProdName}" filtering="false">
			<fileset dir="." excludes="**/CVS">
				<patternset id="dojar" >
					<include name="**/*.jar*"/>
				</patternset>
			</fileset>
		</copy>
	</target>

	<target name="-initAuthClient" depends="-initCopy" if="com.mysql.jdbc.authClientBuild">
		<copy file="./lib-nodist/CommercialLicenseConfiguration.notjava"
			toFile="${buildDir}/${fullProdName}/com/mysql/jdbc/LicenseConfiguration.java"
			overwrite="true"/>
	</target>

	<target name="-initNoCrypto" depends="-initCopy" if="com.mysql.jdbc.noCryptoBuild">
		<copy file="./lib-nodist/ExportControlledNoCrypto.notjava"
			toFile="${buildDir}/${fullProdName}/com/mysql/jdbc/ExportControlled.java"
			overwrite="true"/>
	</target>

	<!-- 
		This is the target we use to make MySQL AB GPL-licensed and binaries 
		as well as commercially-licensed binaries that include source files.
	-->

	<target name="fullPackage" description="Builds driver, binary .jar file, docs and packages (.zip, .tar.gz) suitable for distribution that _do_ contain sources" 
		depends="fullDist, -makePackages"/>

	<!-- This is the target we use to make MySQL AB Commercially-licensed binaries -->

	<target name="fullPackageNoSources" description="Builds driver, binary .jar file, docs and packages (.zip, .tar.gz) suitable for distribution that do _not_ contain sources"
			depends="fullDist, -removeSources, -makePackages"/>

	<target name="fullDist" description="Builds driver, binary .jar file and docs, basically a distribution 'image'"
		depends="dist, styleDocs"/>

	<target name="package" depends="dist, -makePackages"/>

	<target name="-removeSources">
		<echo>Removing sources from ${buildDir}</echo>
		<delete>
			<fileset dir="${buildDir}">
				<include name="**/*.java"/>
			</fileset>
		</delete>
	</target>

	<target name="-makePackages" depends="dist">
		<delete file="${distDir}/${fullProdName}.tar.gz"/>

		<patternset id="non.test.sources" >
			<exclude name="**/*.nb*"/>
			<exclude name="**/*.bak"/>
			<exclude name="**/*.*~"/>
			<exclude name="**/lib-nodist/*"/>
			<exclude name="**/lib-coverage/*"/>
			<exclude name="**/clover/*"/>
			<exclude name="**/checkstyle/*"/>
			<exclude name="**/.*"/>
		</patternset>

		<tar destfile="${distDir}/${fullProdName}.tar.gz"
			compression="gzip" longfile="gnu">
			<tarfileset dir="${buildDir}">
				<patternset refid="non.test.sources" />
			</tarfileset>
		</tar>

		<checksum file="${distDir}/${fullProdName}.tar.gz" forceOverwrite="yes" fileext=".md5"/>

		<delete file="${distDir}/${fullProdName}.zip"/>

		<jar jarfile="${distDir}/${fullProdName}.zip">
			<fileset dir="${buildDir}">
				<patternset refid="non.test.sources" />
			</fileset>
		</jar>

		<checksum file="${distDir}/${fullProdName}.zip" forceOverwrite="yes" fileext=".md5"/>
	</target>

	<target name="dist" depends="init, compile">

		<delete file="${buildDir}/${fullProdName}-bin.jar"/>
		<delete file="${distDir}/${fullProdName}.jar"/>

		<mkdir dir="${distDir}" />

		<jar jarfile="${buildDir}/${fullProdName}/${fullProdName}-bin.jar"
			basedir="${buildDir}/${fullProdName}"
			includes="**/*.class,**/*.properties*,COPYING,README"
			excludes="testsuite/**"
			index="true"
		/>



	</target>

	<target name="test.all.multi" depends="test.multijvm, test.compliance.multijvm"/>

	<!-- Runs compliance testsuite against multiple JVMs and server configs -->
	
	<target name="test.multijvm" 
			depends="-test.multijvm.1,-test.multijvm.2,
				-test.multijvm.3,-test.multijvm.4,
				-test.multijvm.5,-test.multijvm.6,
				-test.multijvm.6,-test.multijvm.7,
				-test.multijvm.8"/>

	<target name="-test.multijvm.1" if="com.mysql.jdbc.testsuite.jvm.1">
		<antcall target="test.multi">
			<param name="com.mysql.jdbc.test.jvm" value="${com.mysql.jdbc.testsuite.jvm.1}"/>
			<param name="test.jvm.prefix" value="jvm-1-"/>
		</antcall>
	</target>

	<target name="-test.multijvm.2" if="com.mysql.jdbc.testsuite.jvm.2">
		<antcall target="test.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.2}"/>
			<param name="test.jvm.prefix" value="jvm-2-"/>
		</antcall>
	</target>

	<target name="-test.multijvm.3" if="com.mysql.jdbc.testsuite.jvm.3">
		<antcall target="test.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.3}"/>
			<param name="test.jvm.prefix" value="jvm-3-"/>
		</antcall>
	</target>

	<target name="-test.multijvm.4" if="com.mysql.jdbc.testsuite.jvm.4">
		<antcall target="test.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.4}"/>
			<param name="test.jvm.prefix" value="jvm-4-"/>
		</antcall>
	</target>

	<target name="-test.multijvm.5" if="com.mysql.jdbc.testsuite.jvm.5">
		<antcall target="test.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.5}"/>
			<param name="test.jvm.prefix" value="jvm-5-"/>
		</antcall>
	</target>

	<target name="-test.multijvm.6" if="com.mysql.jdbc.testsuite.jvm.6">
		<antcall target="test.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.6}"/>
			<param name="test.jvm.prefix" value="jvm-6-"/>
		</antcall>
	</target>

	<target name="-test.multijvm.7" if="com.mysql.jdbc.testsuite.jvm.7">
		<antcall target="test.compliance.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.7}"/>
			<param name="test.jvm.prefix" value="jvm-7-"/>
		</antcall>
	</target>

	<target name="-test.multijvm.8" if="com.mysql.jdbc.testsuite.jvm.8">
		<antcall target="test.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.8}"/>
			<param name="test.jvm.prefix" value="jvm-8-"/>
		</antcall>
	</target>
	
	<!-- Runs the testsuite against multiple versions of the MySQL server -->
	
	<target name="test.multi" 
		depends="-test.multi.1,-test.multi.2,-test.multi.3,
		-test.multi.3,-test.multi.4,-test.multi.5,
		-test.multi.6,-test.multi.7,-test.multi.8">
	</target>

	<target name="-test.multi.1" if="com.mysql.jdbc.testsuite.url.1">
		<antcall target="test">
			<param name="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url.1}"/>
			<param name="test.result.prefix" value="${test.jvm.prefix}config-1."/>
		</antcall>
	</target>

	<target name="-test.multi.2" if="com.mysql.jdbc.testsuite.url.2">
			<antcall target="test">
				<param name="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url.2}"/>
				<param name="test.result.prefix" value="${test.jvm.prefix}config-2."/>
			</antcall>
		</target>

	<target name="-test.multi.3" if="com.mysql.jdbc.testsuite.url.3">
			<antcall target="test">
				<param name="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url.3}"/>
				<param name="test.result.prefix" value="${test.jvm.prefix}config-3."/>
			</antcall>
		</target>

	<target name="-test.multi.4" if="com.mysql.jdbc.testsuite.url.4">
			<antcall target="test">
				<param name="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url.4}"/>
				<param name="test.result.prefix" value="${test.jvm.prefix}config-4."/>
			</antcall>
		</target>

	<target name="-test.multi.5" if="com.mysql.jdbc.testsuite.url.5">
			<antcall target="test">
				<param name="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url.5}"/>
				<param name="test.result.prefix" value="${test.jvm.prefix}config-5."/>
			</antcall>
		</target>

	<target name="-test.multi.6" if="com.mysql.jdbc.testsuite.url.6">
			<antcall target="test">
				<param name="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url.6}"/>
				<param name="test.result.prefix" value="${test.jvm.prefix}config-6."/>
			</antcall>
		</target>

	<target name="-test.multi.7" if="com.mysql.jdbc.testsuite.url.7">
			<antcall target="test">
				<param name="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url.7}"/>
				<param name="test.result.prefix" value="${test.jvm.prefix}config-7."/>
			</antcall>
		</target>
	
	<target name="-test.multi.8" if="com.mysql.jdbc.testsuite.url.8">
		<antcall target="test">
			<param name="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url.8}"/>
			<param name="test.result.prefix" value="${test.jvm.prefix}config-8."/>
		</antcall>
	</target>

	<target name="-setTestResultPrefix" unless="${test.result.prefix}">
			<property name="test.result.prefix" value=""/>
		</target>

	<target name="test" depends="compile, -setTestResultPrefix">
		<property name="compliance.jvm" value="java"/>

		<echo message="Running compliance tests against ${com.mysql.jdbc.testsuite.url} with result filename prefix ${test.result.prefix}"/>

		<junit printSummary="yes" fork="on" jvm="${compliance.jvm}">
			<jvmarg value="-Xmx256m"/>
			<sysproperty key="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url}"/>
			<classpath>
				<pathelement location="${buildDir}/${fullProdName}" />
				<pathelement location="./lib-nodist/providerutil.jar" />
				<pathelement location="./lib-nodist/fscontext.jar" />
				<pathelement path="${java.class.path}" />
				<pathelement path="/src/clover-0.6b/lib/clover.jar"/>
			</classpath>

			

			<batchtest fork="yes" todir="${junit.results}">
				<fileset dir="${buildDir}/${fullProdName}">
					<include name="**/*Test.java" />
					
					<!-- Don't run base classes, why JUnit test doesn't
					     skip abstract classes is beyond me ... -->
					<exclude name="**/Base*.java" />
				</fileset>
				
				<formatter type="plain" extension="-${test.result.prefix}txt"/>
				<formatter type="xml" extension="-${test.result.prefix}xml"/>
			</batchtest>
		</junit>
	</target>

	<target name="test.with.clover">
		<mkdir dir="${junit.results}"/>
		<junit printSummary="yes">
			<sysproperty key="com.mysql.jdbc.testsuite.url" value="jdbc:mysql:///test"/>
			<classpath>
				<pathelement location="${buildDir}/${fullProdName}" />
				<pathelement location="./lib-nodist/providerutil.jar" />
				<pathelement location="./lib-nodist/fscontext.jar" />
				<pathelement path="${java.class.path}" />
				<pathelement path="/src/clover-0.6b/lib/clover.jar"/>
			</classpath>

			<formatter type="plain" />

			<batchtest fork="no" todir="${junit.results}">
				<fileset dir="${buildDir}/${fullProdName}">
					<include name="**/*Test.java" />
				</fileset>
			</batchtest>
		</junit>
	</target>

	<!-- Runs compliance testsuite against multiple JVMs and server configs -->

	<target name="test.compliance.multijvm" 
		depends="-test.compliance.multijvm.1,-test.compliance.multijvm.2,
			-test.compliance.multijvm.3,-test.compliance.multijvm.4,
			-test.compliance.multijvm.5,-test.compliance.multijvm.6,
			-test.compliance.multijvm.6,-test.compliance.multijvm.7,
			-test.compliance.multijvm.8"/>

	<target name="-test.compliance.multijvm.1" if="com.mysql.jdbc.testsuite.jvm.1">
		<antcall target="test.compliance.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.1}"/>
			<param name="test.jvm.prefix" value="jvm-1-"/>
		</antcall>
	</target>

	<target name="-test.compliance.multijvm.2" if="com.mysql.jdbc.testsuite.jvm.2">
		<antcall target="test.compliance.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.2}"/>
			<param name="test.jvm.prefix" value="jvm-2-"/>
		</antcall>
	</target>

	<target name="-test.compliance.multijvm.3" if="com.mysql.jdbc.testsuite.jvm.3">
		<antcall target="test.compliance.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.3}"/>
			<param name="test.jvm.prefix" value="jvm-3-"/>
		</antcall>
	</target>

	<target name="-test.compliance.multijvm.4" if="com.mysql.jdbc.testsuite.jvm.4">
		<antcall target="test.compliance.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.4}"/>
			<param name="test.jvm.prefix" value="jvm-4-"/>
		</antcall>
	</target>

	<target name="-test.compliance.multijvm.5" if="com.mysql.jdbc.testsuite.jvm.5">
		<antcall target="test.compliance.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.5}"/>
			<param name="test.jvm.prefix" value="jvm-5-"/>
		</antcall>
	</target>

	<target name="-test.compliance.multijvm.6" if="com.mysql.jdbc.testsuite.jvm.6">
		<antcall target="test.compliance.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.6}"/>
			<param name="test.jvm.prefix" value="jvm-6-"/>
		</antcall>
	</target>

	<target name="-test.compliance.multijvm.7" if="com.mysql.jdbc.testsuite.jvm.7">
		<antcall target="test.compliance.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.7}"/>
			<param name="test.jvm.prefix" value="jvm-7-"/>
		</antcall>
	</target>

	<target name="-test.compliance.multijvm.8" if="com.mysql.jdbc.testsuite.jvm.8">
		<antcall target="test.compliance.multi">
			<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.8}"/>
			<param name="test.jvm.prefix" value="jvm-8-"/>
		</antcall>
	</target>

	<!-- Runs compliance testsuite against multiple server configurations -->

	<target name="test.compliance.multi" 
		depends="-test.compliance.multi.1,-test.compliance.multi.2,-test.compliance.multi.3,
		-test.compliance.multi.3,-test.compliance.multi.4,-test.compliance.multi.5,
		-test.compliance.multi.6,-test.compliance.multi.7,-test.compliance.multi.8">
	</target>

	<target name="-test.compliance.multi.1" if="com.mysql.jdbc.compliance.url.1">
		<antcall target="test.compliance">
			<param name="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url.1}"/>
			<param name="test.result.prefix" value="${test.jvm.prefix}config-1."/>
		</antcall>
	</target>

	<target name="-test.compliance.multi.2" if="com.mysql.jdbc.compliance.url.2">
		<antcall target="test.compliance">
			<param name="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url.2}"/>
			<param name="test.result.prefix" value="${test.jvm.prefix}config-2."/>
		</antcall>
	</target>

	<target name="-test.compliance.multi.3" if="com.mysql.jdbc.compliance.url.3">
		<antcall target="test.compliance">
			<param name="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url.3}"/>
			<param name="test.result.prefix" value="${test.jvm.prefix}config-3."/>
		</antcall>
	</target>

	<target name="-test.compliance.multi.4" if="com.mysql.jdbc.compliance.url.4">
		<antcall target="test.compliance">
			<param name="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url.4}"/>
			<param name="test.result.prefix" value="${test.jvm.prefix}config-4."/>
		</antcall>
	</target>

	<target name="-test.compliance.multi.5" if="com.mysql.jdbc.compliance.url.5">
		<antcall target="test.compliance">
			<param name="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url.5}"/>
			<param name="test.result.prefix" value="${test.jvm.prefix}config-5."/>
		</antcall>
	</target>

	<target name="-test.compliance.multi.6" if="com.mysql.jdbc.compliance.url.6">
		<antcall target="test.compliance">
			<param name="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url.6}"/>
			<param name="test.result.prefix" value="${test.jvm.prefix}config-6."/>
		</antcall>
	</target>

	<target name="-test.compliance.multi.7" if="com.mysql.jdbc.compliance.url.7">
		<antcall target="test.compliance">
			<param name="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url.7}"/>
			<param name="test.result.prefix" value="${test.jvm.prefix}config-7."/>
		</antcall>
	</target>

	<target name="-test.compliance.multi.8" if="com.mysql.jdbc.compliance.url.8">
		<antcall target="test.compliance">
			<param name="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url.7}"/>
			<param name="test.result.prefix" value="${test.jvm.prefix}config-8."/>
		</antcall>
	</target>

	<!-- 
	
		Tests for JDBC compliance. The JDBC compliance testsuite
	    is not shipped with MySQL Connector/J as it is not licensible
	    except from Sun.
	     
	    The properties com.mysql.jdbc.compliance.url and
	    jdbc-compliance-location must be set
	    prior to running this test. 
	     
	-->

	<target name="test.compliance" depends="compile">
		<property name="compliance.jvm" value="java"/>

		<echo message="Running compliance tests against ${com.mysql.jdbc.compliance.url} with result filename prefix ${test.result.prefix}"/>
		<mkdir dir="${junit.results}"/>
		<junit printsummary="yes" jvm="${compliance.jvm}">
			<sysproperty key="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url}"/>
			<classpath>
				<pathelement location="${buildDir}/${fullProdName}"/>
				<fileset dir="lib-nodist">
					<include name="**/*.jar"/>
				</fileset>
				<pathelement location="${jdbc-compliance-location}"/>
			</classpath>

			<formatter type="xml"/>

			<test outfile="TEST-${test.result.prefix}BatchUpdateTest" fork="yes" todir="${junit.results}" 
	    		name="com.mysql.jdbc.compliance.tests.BatchUpdateTest"/>

			<test outfile="TEST-${test.result.prefix}ConnectionTest" fork="yes" todir="${junit.results}" 
	    		name="com.mysql.jdbc.compliance.tests.ConnectionTest"/>

			<test outfile="TEST-${test.result.prefix}DatabaseMetaDataTest" fork="yes" todir="${junit.results}" 
	    		name="com.mysql.jdbc.compliance.tests.DatabaseMetaDataTest"/>

			<test outfile="TEST-${test.result.prefix}EscapeSyntaxTest" fork="yes" todir="${junit.results}" 
	    		name="com.mysql.jdbc.compliance.tests.EscapeSyntaxTest"/>

			<test outfile="TEST-${test.result.prefix}PreparedStatementTest" fork="yes" todir="${junit.results}" 
	    		name="com.mysql.jdbc.compliance.tests.PreparedStatementTest"/>

			<test outfile="TEST-${test.result.prefix}ResultSetMetadataTest" fork="yes" todir="${junit.results}" 
	    		name="com.mysql.jdbc.compliance.tests.ResultSetMetadataTest"/>

			<test outfile="TEST-${test.result.prefix}ResultSetTest" fork="yes" todir="${junit.results}" 
	    		name="com.mysql.jdbc.compliance.tests.ResultSetTest"/>

			<test outfile="TEST-${test.result.prefix}StatementTest" fork="yes" todir="${junit.results}" 
	    		name="com.mysql.jdbc.compliance.tests.StatementTest"/>
		</junit>
	</target>


	<target name="compile" depends="init, -commercialLicense, compile-driver, compile-testsuite">
	</target>

	<!-- Compiles the driver itself -->

	<target name="compile-driver" depends="init">
		<javac srcdir="${buildDir}/${fullProdName}" destdir="${buildDir}/${fullProdName}" deprecation="off" debug="${debug.enable}" excludes="testsuite/**">
			<classpath refid="project.build.classpath" />
		</javac>

	</target>

	<!-- Compiles the JUnit testsuite -->

	<target name="compile-testsuite" depends="init, compile-driver">
		<javac srcdir="${buildDir}/${fullProdName}" destdir="${buildDir}/${fullProdName}" deprecation="off" debug="${debug.enable}">
			<classpath refid="project.build.classpath"/>
		</javac>
	</target>


	<target name="realclean">
		<delete dir="${buildDir}"/>
		<delete>
			<fileset dir="${distDir}" 
				includes="${fullProdName}.zip,${fullProdName}.tar.gz"/>
		</delete>
	</target>

	<target name="clean" unless="com.mysql.jdbc.noCleanBetweenCompiles">
		<delete dir="${buildDir}"/>
	</target>


	<target name="styleDocs" depends="init, -copyDocs, -styleDocsHtmlTop, -styleDocsFopTop" if="${com.mysql.jdbc.docs.sourcesPresent}"/>

	<target name="-copyDocs" depends="-copyDocsPathCheck">
		<copy file="${com.mysql.jdbc.docs.sourceDir}"
		  todir="${buildDir}/${fullProdName}/docs/sources"
		  failonerror="false"/>
	</target>

	<target name="-copyDocsPathCheck" unless="com.mysql.jdbc.docs.sourceDir">
		<echo>
Running stylesheets on non-latest documentation sources. 
		
If you want to use up-to-date versions of the documentation, set the property 
&quot;com.mysql.jdbc.docs.sourceDir&quot; to point to the location
of the DocBook sources (i.e. &quot;connector-j-en.xml&quot;).
		</echo>
	</target>

	<target name="-styleDocsHtmlTop" depends="-styleDocsStyleSheetsCheck, -styleDocsHtml"/>

	<target name="-styleDocsStyleSheetsCheck" unless="com.mysql.jdbc.docs.docBookPresent">
		<echo>
Not applying style sheets to documentation, as the DocBook XSL distribution path
has not been set with the &quot;com.mysql.jdbc.docs.DocBookXSL&quot; property.
		</echo>
	</target>

	<target name="-styleDocsFopTop" depends="-styleDocsStyleSheetsCheck, -styleDocsFop" if="com.mysql.jdbc.docs.fopPresent"/>

	<target name="-styleDocsFop" if="com.mysql.jdbc.docs.fopPresent">
		<xslt basedir="${buildDir}/${fullProdName}/docs/sources" destdir="${buildDir}/${fullProdName}/docs"
      		extension=".fop-xml" style="${com.mysql.jdbc.docs.DocBookXSL}/fo/docbook.xsl" includes="connector-j-en.xml">
			<param name="fop.extensions" expression="1"/>
			<param name="ection.autolabel" expression="1"/>
			<param name="section.label.includes.component.label" expression="1"/>
			<param name="page.margin.inner"  expression="1in"/>
			<param name="page.margin.outer" expression="1in"/>
		</xslt>

		<exec dir="${buildDir}/${fullProdName}/docs" executable="${com.mysql.jdbc.docs.FopPath}">
			<arg line="-fo connector-j-en.fop-xml connector-j-en.pdf"/>
		</exec>

		<delete file="${buildDir}/${fullProdName}/docs/connector-j-en.fop-xml"/>
	</target>

	<target name="-styleDocsHtml">
		<xslt
      		out="${buildDir}/${fullProdName}/docs/index.html" style="${com.mysql.jdbc.docs.DocBookXSL}/html/docbook.xsl" in="${buildDir}/${fullProdName}/docs/sources/connector-j-en.xml">
			<param name="section.autolabel" expression="1"/>
			<param name="section.label.includes.component.label" expression="1"/>
		</xslt>

		<!-- Create a plaintext version of the manual using 'links' -->

		<exec dir="${buildDir}/${fullProdName}/docs" 
			executable="${com.mysql.jdbc.docs.LinksPath}"
			output="${buildDir}/${fullProdName}/docs/README.txt">

			<!-- Unfortunately, ant doesn't seem to pass this in a way
			     'links' groks using the new value='', file='' syntax, 
			     so we need to use this depecrated form -->

			<arg line="-dump index.html"/>
		</exec>
	</target>

	<target name="genPropertiesTable" depends="compile-driver">
		<tempfile property="properties-xml" suffix=".xml" />

		<java classname="com.mysql.jdbc.util.PropertiesDocGenerator"
			output="${properties-xml}" classpath="${buildDir}/${fullProdName}"/>
		<style basedir="doc/sources" in="${properties-xml}" style="connPropsToDocbook.xsl"
		       out="${buildDir}/${fullProdName}/docs/sources/connPropsDocBook.xml"/>
		<delete file="${properties-xml}"/>
	</target>

	<target name="genErrorMappingTable" depends="compile-driver">
		<tempfile property="errorsMapping-xml" suffix=".xml" />

		<java classname="com.mysql.jdbc.util.ErrorMappingsDocGenerator"
				output="${errorsMapping-xml}" classpath="${buildDir}/${fullProdName}"/>
		<style basedir="doc/sources" in="${errorsMapping-xml}" style="errorMapToDocbook.xsl"
			       out="${buildDir}/${fullProdName}/docs/sources/errorMappingDocBook.xml"/>
	</target>

	<!-- Replaces copyright/license banner at the top of every source
	     file -->

	<target name="-commercialLicense" depends="init" if="com.mysql.jdbc.commercialBuild">
		<!-- These are the GPL and FLOSS exceptions. They don't get shipped with
		     commercial builds -->

		<delete file="${buildDir}/${fullProdName}/COPYING"/>
		<delete file="${buildDir}/${fullProdName}/EXCEPTIONS-CONNECTOR-J"/>

		<!-- Pull in the commercial license itself -->

		<copy file="lib-nodist/MySQLEULA.txt" toDir="${buildDir}/${fullProdName}"/>

		<loadfile property="commercialLicenseText"
		      srcFile="lib-nodist/commercialLicense.txt"/>
		<replaceregexp 
		                         match="Copyright.*1307.[^replaceregexp]*USA"
		                         replace="${commercialLicenseText}"
		                         flags="s">
			<fileset dir="${buildDir}/${fullProdName}" includes="**/*"/>
		</replaceregexp>
	</target>

	<!-- 
	     Targets below this point are for code coverage and depend on
	     the 'Emma' project which you can download from 
	     http://emma.sourceforge.net/
	-->

	<target name="emma" description="turns on EMMA instrumentation/reporting" >
		<!-- directory that contains emma.jar and emma_ant.jar: -->
		<property name="emma.dir" value="lib-coverage" />

		<path id="emma.lib" >
			<pathelement location="${emma.dir}/emma.jar" />
			<pathelement location="${emma.dir}/emma_ant.jar" />
		</path>

		<taskdef resource="emma_ant.properties" classpathref="emma.lib" />

		<property name="emma.enabled" value="true" />
		<property name="emma.coverage.dir" value="${buildDir}/${fullProdName}-coverage" />
	</target>

	<target name="instrument" depends="init, compile" description="runs the examples" >
		<emma enabled="${emma.enabled}" >
			<instr instrpathref="project.build.classpath"
	             destdir="${buildDir}/${fullProdName}"	
	             metadatafile="${emma.coverage.dir}/metadata.emma"
	             merge="true"
	      		 mode="overwrite">
				<filter excludes="*Test*" />
				<filter excludes="org.junit.*" />
			</instr>
		</emma>
	</target>

	<target name="test-emma-report" depends="test-emma, test-emma-compliance">
		<emma enabled="${emma.enabled}" >
			<report sourcepath="${buildDir}/${fullProdName}" >
				<fileset dir="${emma.coverage.dir}" >
					<include name="*.emma" />
				</fileset>

				<txt outfile="${emma.coverage.dir}/coverage.txt" />
				<html outfile="${emma.coverage.dir}/coverage.html" />
			</report>
		</emma>
	</target>

	<target name="test-emma" depends="instrument">
		<mkdir dir="${junit.results}"/>

		<junit printSummary="yes" fork="on">
			<jvmarg value="-Xmx256m"/>
			<jvmarg value="-Demma.coverage.out.file=${emma.coverage.dir}/coverage.emma" />
			<jvmarg value="-Demma.coverage.out.merge=true" />
			<sysproperty key="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url}"/>
			<classpath>
				<pathelement location="${buildDir}/${fullProdName}" />
				<pathelement location="./lib-nodist/providerutil.jar" />
				<pathelement location="./lib-nodist/fscontext.jar" />
				<pathelement path="${java.class.path}" />
				<pathelement location="${emma.dir}/emma.jar" />
				<pathelement location="${emma.dir}/emma_ant.jar" />
			</classpath>

			<formatter type="plain" />
			<formatter type="xml"/>

			<batchtest fork="yes" todir="${junit.results}">
				<fileset dir="${buildDir}/${fullProdName}">
					<include name="**/*Test.java" />
					<exclude name="**/perf/*.java"/>
				</fileset>
			</batchtest>
		</junit>
	</target>

	<target name="test-emma-compliance" depends="instrument">
		<mkdir dir="${junit.results}"/>
		<junit printsummary="yes">
			<jvmarg value="-Xmx256m"/>
			<jvmarg value="-Demma.coverage.out.file=${emma.coverage.dir}/coverage.emma" />
			<jvmarg value="-Demma.coverage.out.merge=true" />
			<sysproperty key="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url}"/>
			<classpath>
				<pathelement location="${buildDir}/${fullProdName}"/>
				<fileset dir="lib-nodist">
					<include name="**/*.jar"/>
				</fileset>
				<pathelement location="${jdbc-compliance-location}"/>
				<pathelement location="${emma.dir}/emma.jar" />
				<pathelement location="${emma.dir}/emma_ant.jar" />
			</classpath>

			<formatter type="xml"/>

			<test fork="yes" todir="${junit.results}" 
		    		name="com.mysql.jdbc.compliance.tests.BatchUpdateTest"/>
			<test fork="yes" todir="${junit.results}" 
		    		name="com.mysql.jdbc.compliance.tests.ConnectionTest"/>
			<test fork="yes" todir="${junit.results}" 
		    		name="com.mysql.jdbc.compliance.tests.DatabaseMetaDataTest"/>
			<test fork="yes" todir="${junit.results}" 
		    		name="com.mysql.jdbc.compliance.tests.EscapeSyntaxTest"/>
			<test fork="yes" todir="${junit.results}" 
		    		name="com.mysql.jdbc.compliance.tests.PreparedStatementTest"/>
			<test fork="yes" todir="${junit.results}" 
		    		name="com.mysql.jdbc.compliance.tests.ResultSetMetadataTest"/>
			<test fork="yes" todir="${junit.results}" 
		    		name="com.mysql.jdbc.compliance.tests.ResultSetTest"/>
			<test fork="yes" todir="${junit.results}" 
		    		name="com.mysql.jdbc.compliance.tests.StatementTest"/>
		</junit>
	</target>
</project>