forked from apache/derby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
3307 lines (2774 loc) · 132 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"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project default="buildsource" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
<!-- Set Properties -->
<!-- User settings -->
<property environment="env"/>
<property file="local.properties"/>
<property file="${user.home}/ant.properties"/>
<!-- Set property lib dir -->
<property name="properties.dir" value="${basedir}/tools/ant/properties"/>
<!-- Significant dirs -->
<property file="${properties.dir}/dirs.properties"/>
<!-- Compiler settings -->
<property file="${properties.dir}/sane${sanity}.properties"/>
<!-- These properties are used by the Release build process. -->
<condition property="isWindows">
<os family="windows"/>
</condition>
<condition property="isUnix">
<not>
<os family="windows"/>
</not>
</condition>
<!-- Targets -->
<target
name="buildsource"
depends="checkCompilerLevel,init,prebuild,setCompilerProperties,felixStubs,engine,storeless,tools,drda,client,optional,build,versioninfo,localeinfo,binscripts"
description="Compile the product source (does not build the tests)."
/>
<target
name="all"
depends="buildsource,demo,testing,pptesting,runmessagecheck"
description="Compile all of the source, including tests as well as production code."
/>
<!-- ==================================================================== -->
<!-- Initialize targets -->
<!-- ==================================================================== -->
<target name="init" unless="init.done" depends="install_junit,setCompilerProperties">
<tstamp/>
<mkdir dir="${out.dir}"/>
<antcall target="make-generated-dirs"/>
<antcall target="make-release-dirs"/>
<!-- Create the emtpy dir that we put in the boot classpath to
prevent the default Java runtime libraries from being loaded.
-->
<mkdir dir="${empty}"/>
<!-- generate sanity state.properties if one does not exist -->
<available property="state.available" file="${state.file}"/>
<antcall target="ensuresanitystate"/>
<property file="${state.file}"/>
<property file="${properties.dir}/sane${sanity}.properties"/>
<antcall target="setissane"/>
<property name="init.done" value="true"/>
</target>
<target name="make-generated-dirs">
<mkdir dir="${generated.dir}"/>
<mkdir dir="${generated.bin.dir}"/>
<mkdir dir="${generated.src.dir}"/>
<mkdir dir="${generated.sanity.dir}"/>
<mkdir dir="${generated.ij.dir}"/>
<mkdir dir="${generated.sql.dir}"/>
<mkdir dir="${generated.engine.locale.dir}"/>
<mkdir dir="${generated.cache.dir}"/>
<mkdir dir="${generated.toursdb.dir}"/>
</target>
<target name="make-release-dirs">
<mkdir dir="${release.base}"/>
<mkdir dir="${release.dir}"/>
<mkdir dir="${snapshot.dir}"/>
</target>
<target name="setissane">
<condition property="is.sane">
<equals arg1="${sanity}" arg2="true"/>
</condition>
</target>
<target name="ensuresanitystate" unless="state.available">
<antcall target="evaluate.sane"/>
</target>
<target name="evaluate.sane">
<condition property="generate.sane">
<or>
<equals arg1="${sane}" arg2="true"/>
<not>
<isset property="sane"/>
</not>
</or>
</condition>
<antcall target="ensuresanitystate.sane"/>
<antcall target="ensuresanitystate.insane"/>
</target>
<target name="ensuresanitystate.sane" if="generate.sane">
<antcall target="sane"/>
</target>
<target name="ensuresanitystate.insane" unless="generate.sane">
<antcall target="insane"/>
</target>
<target name="showenv" depends="init" unless="showenv.done">
<echo level="info" message=""/>
<echo level="info" message="Ant environment:"/>
<echo level="info" message=" Base Directory: ${basedir}"/>
<echo level="info" message=" Build output: ${out.dir}"/>
<echo level="info" message=" Compiler: ${build.compiler}"/>
<echo level="info" message=" Sane = ${sane}"/>
<echo level="info" message=" Proceed = ${proceed}"/>
<echo level="info" message=""/>
<property name="showenv.done" value="true"/>
</target>
<!-- Make sure compiler level is Java 6 level or higher -->
<target name="checkCompilerLevel">
<available property="compilerAtCorrectLevel" classname="java.sql.SQLType"/>
<fail unless="compilerAtCorrectLevel" message="Compiler level must be Java 8 or later."/>
<antcall target="checkVMLevel"/>
</target>
<!-- checkVMLevel:
This target determines to some degree the JVM version used to run ant.
The resulting properties will indicate the VM level, and may for instance
be checked before running junit tests requiring a certain JVM version.
-->
<target name="checkVMLevel">
<available classname="java.sql.SQLType" property="vmLevelIsAtLeast1.8" value="true"/>
<available classname="java.sql.ShardingKey" property="vmLevelIsAtLeast1.9" value="true"/>
</target>
<!-- ==================================================================== -->
<!-- Download junit 3.8.2 -->
<!-- ==================================================================== -->
<!-- You can override this property in local.properties to fetch from an alternative location -->
<property name="junit.url" value="http://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2.jar"/>
<target name="junit_check">
<!-- check if junit is set, if set, if junit.jar is really there, if not, error out -->
<fail message="junit property is set to ${junit}, but there is no junit.jar there.">
<condition>
<and>
<isset property="junit"/>
<not>
<available file="${junit}"/>
</not>
</and>
</condition>
</fail>
<condition property="junitfile" value="${junit}">
<and>
<isset property="junit"/>
</and>
</condition>
<condition property="junitfile" value="${basedir}/tools/java/junit.jar">
<not>
<isset property="junit"/>
</not>
</condition>
<available file="${junitfile}" property="junit.exists"/>
</target>
<target name="install_junit" depends="junit_check" unless="junit.exists" description="installs junit.jar into derby">
<get src="${junit.url}" dest="${basedir}/tools/java/junit.jar" verbose="true" ignoreerrors="true"/>
</target>
<!-- ==================================================================== -->
<!-- Build version info files -->
<!-- ==================================================================== -->
<target name="versioninfo" depends="ckversioninfo,writeversioninfo"/>
<target name="ckversioninfo">
<condition property="versioninfo.available">
<and>
<available file="${out.dir}/org/apache/derby/info/DBMS.properties"/>
<available file="${out.dir}/org/apache/derby/info/tools.properties"/>
<available file="${out.dir}/org/apache/derby/info/net.properties"/>
<available file="${out.dir}/org/apache/derby/info/dnc.properties"/>
</and>
</condition>
</target>
<target name="writeversioninfo" unless="versioninfo.available">
<mkdir dir="${out.dir}/org/apache/derby/info/"/>
<antcall target="infowriter">
<param name="info.buildnumber" value="1"/>
<param name="info.iname" value="Apache Derby Embedded Engine"/>
<param name="info.ename" value="Apache Derby"/>
<param name="info.productfile" value="codeline"/>
<param name="info.file" value="${out.dir}/org/apache/derby/info/DBMS.properties"/>
</antcall>
<antcall target="infowriter">
<param name="info.buildnumber" value="1"/>
<param name="info.iname" value="Apache Derby Tools"/>
<param name="info.ename" value="Apache Derby"/>
<param name="info.productfile" value="codeline"/>
<param name="info.file" value="${out.dir}/org/apache/derby/info/tools.properties"/>
</antcall>
<antcall target="infowriter">
<param name="info.buildnumber" value="1"/>
<param name="info.iname" value="Apache Derby Network Server"/>
<param name="info.ename" value="Apache Derby"/>
<param name="info.productfile" value="codeline"/>
<param name="info.file" value="${out.dir}/org/apache/derby/info/net.properties"/>
</antcall>
<antcall target="infowriter">
<param name="info.buildnumber" value="1"/>
<param name="info.iname" value="Apache Derby Network Client"/>
<param name="info.ename" value="Apache Derby"/>
<param name="info.productfile" value="codeline"/>
<param name="info.file" value="${out.dir}/org/apache/derby/info/dnc.properties"/>
</antcall>
</target>
<target name="cleanversion">
<delete file="${out.dir}/org/apache/derby/info/DBMS.properties"/>
<delete file="${out.dir}/org/apache/derby/info/tools.properties"/>
<delete file="${out.dir}/org/apache/derby/info/net.properties"/>
<delete file="${out.dir}/org/apache/derby/info/dnc.properties"/>
<delete file="${out.dir}/org/apache/derby/info/tsting.properties"/>
</target>
<!-- Set the ant variables which identify the compiler classpaths. -->
<target name="setCompilerProperties" unless="compilerPropsAlreadySet" depends="prebuild">
<property file="${properties.dir}/defaultcompiler.properties"/>
<property file="${properties.dir}/${build.compiler}.properties"/>
<!-- Compile-time classpath`< properties files -->
<property file="${properties.dir}/extrapath.properties"/>
<property file="${properties.dir}/compilepath.properties"/>
<!-- Release and version info -->
<property file="${properties.dir}/release.properties"/>
<property name="compilerPropsAlreadySet" value="true"/>
</target>
<!-- ==================================================================== -->
<!-- Info writer build target -->
<!-- ==================================================================== -->
<target name="infowriter">
<propertyfile file="${info.file}" comment="${copyright.comment}">
<entry key="derby.version.major" value="${major}"/>
<entry key="derby.version.minor" value="${minor}"/>
<entry key="derby.version.maint" value="${maint}"/>
<entry key="derby.version.drdamaint" value="${drdamaint}"/>
<entry key="derby.build.number" value="${info.buildnumber}"/>
<entry key="derby.product.technology.name" value="${info.iname}"/>
<entry key="derby.product.external.name" value="${info.ename}"/>
<entry key="derby.product.external.version" value="${eversion}"/>
<entry key="derby.version.beta" value="${beta}"/>
<entry key="derby.product.vendor" value="${vendor}"/>
<entry key="derby.product.file" value="${info.productfile}"/>
</propertyfile>
</target>
<!--
Create the release properties file and check it in
Args:
bumpID true or false, depending on whether you want to increment the last digit of the release id (defaults to false)
-->
<target name="writeAndCheckinReleaseProperties" depends="writeRelProps,promptforsvncredentials">
<!-- Check in the new release id. -->
<antcall target="checkinfile">
<param name="checkinComment" value="Derby release ID set to: ${derby.release.id.new}"/>
<param name="fileName" value="${releasePropertyFile}"/>
</antcall>
</target>
<!--
Create the release properties file.
Args:
bumpID true or false, depending on whether you want to increment the last digit of the release id (defaults to false)
-->
<target name="writeRelProps" depends="init,prebuild,promptforreleaseid">
<taskdef
name="writeAndCheckinReleaseProperties"
classname="org.apache.derbyPreBuild.ReleaseProperties"
classpath="${out.dir}"
/>
<property name="releasePropertyFile" value="${properties.dir}/release.properties"/>
<property name="bumpID" value="false"/>
<writeAndCheckinReleaseProperties
releaseID="${derby.release.id}"
releasePropertiesFileName="${releasePropertyFile}"
bump="${bumpID}"
/>
<!--
If we were asked to bump the release id, then the actual release id
will be different from the original id passed into this target.
-->
<echo message="Derby release ID set to: ${derby.release.id.new}"/>
</target>
<!-- ==================================================================== -->
<!-- Locale info writer build target -->
<!-- ==================================================================== -->
<target name="buildlocaleinfo">
<antcall target="localeinfowriter">
<param name="info.buildnumber" value="1"/>
<param name="info.iname" value="_${locale.iname}"/>
<param name="info.ename" value="${locale.ename}"/>
<param name="info.file" value="${out.dir}/org/apache/derby/info/locale_${locale.iname}.properties"/>
</antcall>
</target>
<target name="localeinfowriter">
<propertyfile file="${info.file}" comment="${copyright.comment}">
<entry key="derby.locale.version.major" value="${major}"/>
<entry key="derby.locale.version.minor" value="${minor}"/>
<entry key="derby.locale.version.maint" value="${maint}"/>
<entry key="derby.locale.build.number" value="${info.buildnumber}"/>
<entry key="derby.locale.technology.name" value="${info.iname}"/>
<entry key="derby.locale.external.name" value="${info.ename}"/>
<entry key="derby.version.beta" value="${beta}"/>
<entry key="derby.locale.vendor" value="${vendor}"/>
<entry key="derby.product.file" value="${info.productfile}"/>
</propertyfile>
</target>
<!-- ==================================================================== -->
<!-- Build Locale info -->
<!-- ==================================================================== -->
<target name="localeinfo"
depends="checklocaleinfo,checkmessages"
unless="localeinfo.available">
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="cs"/>
<param name="locale.ename" value="Czech/International [cs]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="de_DE"/>
<param name="locale.ename" value="German/Germany [de_DE]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="es"/>
<param name="locale.ename" value="Spanish/International [es]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="fr"/>
<param name="locale.ename" value="French/International [fr]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="hu"/>
<param name="locale.ename" value="Hungarian/International [hu]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="it"/>
<param name="locale.ename" value="Italian/International [it]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="ja_JP"/>
<param name="locale.ename" value="Japanese/Japan [ja_JP]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="ko_KR"/>
<param name="locale.ename" value="Korean/Korea [ko_KR]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="pl"/>
<param name="locale.ename" value="Polish/International [pl]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="pt_BR"/>
<param name="locale.ename" value="Portuguese/Brazil [pt_BR]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="ru"/>
<param name="locale.ename" value="Russian/International [ru]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="zh_CN"/>
<param name="locale.ename" value="Simplified_Chinese/PR_China [zh_CN]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
<antcall target="buildlocaleinfo">
<param name="locale.iname" value="zh_TW"/>
<param name="locale.ename" value="Chinese/Taiwan_Traditional [zh_TW]"/>
<param name="info.buildnumber" value="1"/>
<param name="info.productfile" value="codeline"/>
</antcall>
</target>
<target name="checklocaleinfo">
<condition property="localeinfo.available">
<and>
<available file="${out.dir}/org/apache/derby/info/locale_cs.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_de_DE.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_es.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_fr.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_hu.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_it.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_ja_JP.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_ko_KR.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_pl.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_pt_BR.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_ru.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_zh_CN.properties"/>
<available file="${out.dir}/org/apache/derby/info/locale_zh_TW.properties"/>
</and>
</condition>
</target>
<target name="cleanlocale">
<delete file="${out.dir}/org/apache/derby/info/locale_cs.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_de_DE.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_es.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_fr.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_hu.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_it.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_ja_JP.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_ko_KR.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_pl.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_pt_BR.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_ru.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_zh_CN.properties"/>
<delete file="${out.dir}/org/apache/derby/info/locale_zh_TW.properties"/>
</target>
<target name="checkmessages" depends="checkmessages-done"
unless="checkmessages.done">
<java classname="org.apache.derbyBuild.MessageVetter"
classpath="${out.dir}"
failonerror="true">
<arg file="${out.dir}/org/apache/derby/loc"/>
<arg file="${out.dir}/org/apache/derby/loc/drda"/>
</java>
<touch file="${generated.dir}/checkmessages.done"/>
</target>
<target name="checkmessages-done">
<uptodate property="checkmessages.done"
targetfile="${generated.dir}/checkmessages.done">
<srcresources>
<fileset dir="${out.dir}/org/apache/derby/loc"
includes="*.properties"/>
<fileset dir="${out.dir}/org/apache/derby/loc/drda"
includes="*.properties"/>
</srcresources>
</uptodate>
</target>
<!-- ==================================================================== -->
<!-- Derby Engine build target -->
<!-- ==================================================================== -->
<target name="engine" depends="shared,state">
<ant dir="${derby.engine.src.dir}"/>
<antcall target="build"/>
<ant dir="${derby.engine.dir}/loc"/>
<antcall target="class_size_catalog"/>
</target>
<target name="engine_169_opt" depends="engine">
<ant dir="${derby.engine.src.dir}" target="engine_169_opt"/>
</target>
<target name="tools" depends="engine">
<ant dir="${derby.tools.src.dir}"/>
</target>
<target name="optional" depends="engine">
<ant dir="${derby.optional.src.dir}"/>
</target>
<target name="storeless" depends="engine">
<ant dir="${derby.storeless.src.dir}"/>
</target>
<target name="shared" depends="init,state">
<ant dir="${derby.shared.src.dir}"/>
</target>
<target name="drda" depends="engine">
<ant dir="${derby.drda.src.dir}"/>
<ant dir="${derby.tools.src.dir}" target="tools_run"/>
</target>
<target name="client" depends="engine,shared">
<ant dir="${derby.client.src.dir}"/>
</target>
<target name="prebuild">
<mkdir dir="${out.dir}"/>
<ant dir="${derby.build.src.dir}/org/apache/derbyPreBuild"/>
</target>
<target name="build">
<ant dir="${derby.build.src.dir}"/>
</target>
<target name="demo" depends="buildsource,vti-demo">
<ant dir="${derby.demo.src.dir}"/>
</target>
<target name="vti-demo" depends="buildsource">
<ant dir="${derby.demo.src.dir}" target="compile-vtidemo"/>
</target>
<target name="testing" depends="buildsource,demo,buildtestinginfo">
<ant dir="${derby.testing.src.dir}"/>
</target>
<target name="build-test-jars" description="Build jar files used in tests." depends="buildsource" >
<ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/lang" target="build-test-jars" />
</target>
<!-- Build the package private tests -->
<target name="pptesting" depends="testing">
<ant dir="${derby.testing.src.dir}/org/apache/derby"/>
</target>
<!-- Run the MessageBundleTest -->
<target name="runmessagecheck">
<java fork="true"
classname="org.apache.derbyBuild.MessageBundleTest"
failonerror="true"
classpath="${out.dir}"
/>
</target>
<!-- Run the RefreshJarDriftTest -->
<target name="refreshjardriftcheck"
description="Fix discrepancies between the actual and expected contents of the Derby jar files.">
<java
fork="true"
classname="org.apache.derbyBuild.JarDriftTest"
failonerror="true"
classpath="${out.dir}">
<arg value="refresh"/>
</java>
</target>
<!-- Run the JarDriftTest -->
<target name="jardriftcheck"
description="Report discrepancies between the actual and expected contents of the Derby jar files.">
<java
fork="true"
classname="org.apache.derbyBuild.JarDriftTest"
failonerror="true"
classpath="${out.dir}"
/>
</target>
<!-- ==================================================================== -->
<!-- Build SanityState.java -->
<!-- ==================================================================== -->
<target name="getstate">
<condition property="needstate">
<or>
<not>
<equals arg1="${sane}" arg2="${sanity}"/>
</not>
<not>
<available file="${generated.sanity.dir}/SanityState.java"/>
</not>
</or>
</condition>
</target>
<property name="state.file" value="${generated.sanity.dir}/state.properties"/>
<property file="${state.file}"/>
<!-- Build SanityState.java -->
<target name="state" if="needstate" depends="showenv,getstate">
<echo level="info" message=" Generating SanityState.java..."/>
<property name="sane" value="true"/>
<filter token="SANE" value="${sane}"/>
<copy file="${sanity.dir}/SanityState.tmpl"
tofile="${generated.sanity.dir}/SanityState.java"
overwrite="yes" filtering="on"/>
<property name="header" value="Generated file - do not modify!"/>
<propertyfile file="${state.file}" comment="${header}">
<entry key="sanity" value="${sane}" type="string"/>
</propertyfile>
<delete dir="${sanity.out.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Remove SanityState.java file -->
<!-- =================================================================== -->
<target name="cleanstate">
<delete dir="${generated.sanity.dir}"/>
<delete dir="${sanity.out.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Remove all built objects (except jars) -->
<!-- =================================================================== -->
<target
name="clobber"
depends="clean,cleangenerated,cleanstate,cleanreleasefiles"
description="Remove all build artifacts."
>
<delete file="${out.base}/changenumber.properties"/>
</target>
<!-- =================================================================== -->
<!-- Remove the tree of generated intermediate sources -->
<!-- =================================================================== -->
<target name="cleangenerated">
<delete dir="${generated.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Remove output tree -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="${out.dir}"/>
<delete dir="${generated.dir}"/>
<delete dir="${out.storeless.dir}"/>
<delete dir="${out.pptesting.dir}"/>
</target>
<!-- ==================================================================== -->
<!-- Build parsers -->
<!-- ==================================================================== -->
<!-- Top level target for building both of the javacc parsers -->
<target name="parsers">
<ant dir="${derby.tools.dir}/impl/tools" target="parser"/>
<ant dir="${derby.engine.dir}/impl/sql" target="parser"/>
</target>
<target name="genParser" depends="chkparser" unless="parser.done">
<echo level="info" message=" ${msg}"/>
<delete>
<fileset dir="${generated.src.dir}/${directory}" includes="${rmfiles}"/>
</delete>
<java classname="javacc"
classpath="${javacc}"
dir="${derbysrc.dir}/${srcroot}/${directory}"
fork="yes"
failonerror="true">
<arg value="-OUTPUT_DIRECTORY=${generated.src.dir}/${directory}"/>
<arg value="${jjfile}"/>
</java>
<!-- Qualify reference to tokenImage to fix issue with inheritence -->
<!-- IBM JDK 1.3.1. See DERBY-1078 -->
<replaceregexp file="${generated.src.dir}/${directory}/${chkfile}" match="tokenImage"
replace="${constantsfile}.tokenImage"/>
</target>
<target name="chkparser">
<uptodate property="parser.done"
targetfile="${generated.src.dir}/${directory}/${chkfile}" >
<srcfiles dir="${derbysrc.dir}/${srcroot}/${directory}" includes="${jjfile}" />
</uptodate>
</target>
<!-- =================================================================== -->
<!-- Build the stub FELIX (OSGI) implementation -->
<!-- =================================================================== -->
<target name="felixStubs">
<mkdir dir="${out.stubs.dir}"/>
<mkdir dir="${out.felix.dir}"/>
<javac
source="${min.version}"
target="${min.version}"
nowarn="on"
debug="${debug}"
depend="${depend}"
deprecation="${deprecation}"
optimize="${optimize}"
proceed="${proceed}"
verbose="${verbose}"
srcdir="${derby.felix.src.dir}"
destdir="${out.felix.dir}">
<compilerarg value="-Xlint:unchecked"/>
</javac>
</target>
<!-- =================================================================== -->
<!-- Build the Unix shell scripts under bin -->
<!-- =================================================================== -->
<target name="binscripts" depends="check-binscripts" unless="binscripts.done">
<antcall target="makebinscript">
<param name="script" value="dblook"/>
</antcall>
<antcall target="makebinscript">
<param name="script" value="ij"/>
</antcall>
<antcall target="makebinscript">
<param name="script" value="sysinfo"/>
</antcall>
<antcall target="makebinscript">
<param name="script" value="NetworkServerControl"/>
</antcall>
<antcall target="makebinscript">
<param name="script" value="startNetworkServer"/>
</antcall>
<antcall target="makebinscript">
<param name="script" value="stopNetworkServer"/>
</antcall>
<!-- All the scripts should be executable. -->
<chmod perm="+x" dir="${generated.bin.dir}" includes="*"/>
</target>
<target name="makebinscript">
<concat destfile="${generated.bin.dir}/${script}">
<fileset file="bin/templates/derby_common.sh"/>
<fileset file="bin/templates/${script}"/>
</concat>
</target>
<target name="check-binscripts">
<dependset>
<srcfileset file="bin/templates/derby_common.sh"/>
<targetfileset dir="${generated.bin.dir}"/>
</dependset>
<uptodate property="binscripts.done">
<srcfiles dir="bin/templates" excludes="derby_common.sh"/>
<globmapper from="*" to="${generated.bin.dir}/*"/>
</uptodate>
</target>
<!-- =================================================================== -->
<!-- Remove generated message files -->
<!-- =================================================================== -->
<target name="cleanmessages">
<delete>
<fileset dir="${generated.engine.locale.dir}" includes="messages_en.properties"/>
</delete>
</target>
<!-- =================================================================== -->
<!-- Class Size Catalog build -->
<!-- =================================================================== -->
<!--
Create the class size catalog, a java file
Note that checking the up-to-date status of the files scanned by
ClassSizeCrawler will not always result in the ClassSizeCatalogImpl
being updated properly. We would have to be able to scan the full
dependency tree. This does prevent recompilation in most cases,
and requires it in the most obvious. If there is concern that
the ClassSizeCatalogImpl may have changed significantly since the
last build, run clobber and rebuild to regenerate it.
-->
<target name="class_size_catalog" depends="cscuptodate" unless="csc.uptodate">
<java classname="org.apache.derbyBuild.ClassSizeCrawler"
fork="yes"
failonerror="yes">
<classpath>
<pathelement path="${out.dir}"/>
</classpath>
<jvmarg value="-DWS=${workspace}"/>
<jvmarg value="-DclassDir=${out.dir}"/>
<jvmarg value="-Dout=${generated.cache.dir}/ClassSizeCatalogImpl.java"/>
<jvmarg value="-Dprefix.1=org.apache.derby.iapi.types"/>
<jvmarg value="-Dprefix.2=org.apache.derby.impl"/>
<arg value="org.apache.derby.iapi.types.DataValueDescriptor"/>
<arg value="org.apache.derby.impl.store.raw.data.RecordId"/>
<arg value="org.apache.derby.iapi.store.raw.ContainerKey"/>
<arg value="org.apache.derby.iapi.services.cache.SizedCacheable"/>
<arg value="java.lang.ref.WeakReference"/>
<arg value="java.math.BigDecimal"/>
<arg value="java.util.ArrayList"/>
<arg value="java.util.GregorianCalendar"/>
<arg value="java.util.Vector"/>
</java>
<javac
source="${min.version}"
target="${min.version}"
nowarn="on"
debug="${debug}"
depend="${depend}"
deprecation="${deprecation}"
optimize="${optimize}"
proceed="${proceed}"
verbose="${verbose}"
srcdir="${generated.src.dir}"
destdir="${out.dir}">
<include name="${derby.dir}/iapi/services/cache/ClassSizeCatalogImpl.java"/>
</javac>
</target>
<target name="cscuptodate">
<condition property="csc.uptodate">
<and>
<uptodate srcfile="${derby.engine.dir}/iapi/types/DataValueDescriptor.java"
targetfile="${out.dir}/org/apache/derby/iapi/types/DataValueDescriptor.class"/>
<uptodate srcfile="${derby.engine.dir}/impl/store/raw/data/RecordId.java"
targetfile="${out.dir}/org/apache/derby/impl/store/raw/data/RecordId.class"/>
<uptodate srcfile="${derby.engine.dir}/iapi/store/raw/ContainerKey.java"
targetfile="${out.dir}/org/apache/derby/iapi/store/raw/ContainerKey.class"/>
<uptodate srcfile="${derby.engine.dir}/iapi/services/cache/SizedCacheable.java"
targetfile="${out.dir}/org/apache/derby/iapi/services/cache/SizedCacheable.class"/>
<available file="${generated.src.dir}/${derby.dir}/iapi/services/cache/ClassSizeCatalogImpl.java"/>
</and>
</condition>
</target>
<!-- =================================================================== -->
<!-- Generate sanity.properties -->
<!-- =================================================================== -->
<target name="sane" depends="make-generated-dirs">
<propertyfile file="${state.file}" comment="${header}">
<entry key="sanity" value="true" type="string"/>
</propertyfile>
<delete dir="${sanity.out.dir}"/>
</target>
<target name="insane" depends="make-generated-dirs">
<propertyfile file="${state.file}" comment="${header}">
<entry key="sanity" value="false" type="string"/>
</propertyfile>
<delete dir="${sanity.out.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Javadoc targets -->
<!-- =================================================================== -->
<!-- javadoc specific properties -->
<property name="public.api.dir" value="${out.javadoc.dir}/publishedapi"/>
<property name="javadoc.temp.dir" value="${out.javadoc.dir}/temp"/>
<property name="javadoc.exclusions" value="${javadoc.temp.dir}/javadoc_exclusions"/>
<property name="javadoc.inclusions" value="${javadoc.temp.dir}/javadoc_inclusions"/>
<!-- Helper target to build the JavaDocs and zip them up.
Introduced to achieve a higher degree of platform independence when
pulling JavaDocs from continuous integration systems and build systems.
-->
<target name="javadoc-with-bundle" depends="javadoc">
<property name="javadoc.bundle" value="${out.javadoc.dir}/javadocs.zip"/>
<delete file="${javadoc.bundle}" quiet="true"/>
<zip destfile="${javadoc.bundle}"
basedir="${out.javadoc.dir}"/>
</target>
<target
name="javadoc"
depends="init,initjars,publishedapi,derbydocs,toolsdocs,grammardocs,testingdocs"
description="Build all of the javadoc, including the public api, the production javadoc, and the testing javadoc."
/>
<target name="publishedapi" depends="initjars">
<tstamp>
<format
property="javadoc.ts"
pattern="EEE yyyy-MM-dd HH:mm:ssZ"
locale="en, us"/>
</tstamp>
<property
name="javadoc.Footer"
value="Built on ${javadoc.ts}, from revision ${changenumber}"/>
<delete dir="${public.api.dir}"/>
<mkdir dir="${public.api.dir}"/>
<antcall target="publishedapi-workhorse">
<param name="extraApi" value="publishedapi_jdbc.ant"/>
</antcall>
</target>
<!-- ==================================================================== -->
<!-- Download Java SE and J2EE's "package-list"s -->
<!-- ==================================================================== -->
<!-- You can override this property in local.properties to fetch from an alternative location -->
<property name="javasedoc.url" value="http://docs.oracle.com/javase/8/docs/api"/>
<property name="j2eedoc.url" value="http://docs.oracle.com/javaee/7/api"/>
<property name="javasedoc.local" value="packageListLoc-se-8"/>
<property name="j2eedoc.local" value="packageListLoc-j2ee-7"/>
<target name="packagelist_check">
<condition property="javadoc_local.exists">
<and>
<available file="${javasedoc.local}/package-list" property="javasedoc.exists"/>
<available file="${j2eedoc.local}/package-list" property="j2eedoc.exists"/>
</and>
</condition>
</target>
<target name="install_packagelists" depends="packagelist_check" unless="javadoc_local.exists" description="downloads Java SE and J2EE package lists to local cache">
<mkdir dir="${javasedoc.local}"/>
<mkdir dir="${j2eedoc.local}"/>
<get src="${javasedoc.url}/package-list" dest="${javasedoc.local}/" verbose="true" ignoreerrors="false"/>
<get src="${j2eedoc.url}/package-list" dest="${j2eedoc.local}/" verbose="true" ignoreerrors="false"/>
</target>
<!--
This target used to be called twice, once to build the JDBC3 public api
and then a second time to build the JDBC4 api. Now it is only called once,
for the single JDBC4+ api.
bootClasspath Sensitive to JDBC level.
extraApi Extra files to include in the public api.
If behind a firewall, the links to Java SE and J2EE javadocs may
fail. You can manually download the package-list files into the
folders ./packageListLoc-se-8 and ./packageListLoc-j2ee-7 instead
to get a correct build.
-->
<target name="publishedapi-workhorse" depends="initjars,set-doclint,install_packagelists">
<!-- Only include the files we want customers to see. -->
<mkdir dir="${javadoc.temp.dir}"/>
<antcall target="include-in-javadoc">
<param name="more_inclusions" value="publishedapi.ant"/>
</antcall>
<antcall target="include-in-javadoc">