forked from pentaho/mondrian
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
2046 lines (1848 loc) · 75.5 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!--
== This software is subject to the terms of the Eclipse Public License v1.0
== Agreement, available at the following URL:
== http://www.eclipse.org/legal/epl-v10.html.
== You must accept the terms of that agreement to use this software.
==
== Copyright (C) 2001-2005 Julian Hyde
== Copyright (C) 2005-2012 Pentaho and others
== All Rights Reserved.
-->
<project name="mondrian" default="all" xmlns:ivy="antlib:org.apache.ivy.ant">
<property environment="env"/>
<property name="project.location" location="${basedir}"/>
<property name="lib.location" location="${project.location}/lib"/>
<property file="${project.location}/build.properties"/>
<property file="${project.location}/test.properties"/>
<property file="${project.location}/mondrian.properties"/>
<property name="project.build.debug" value="on"/>
<property name="testsrc.dir" value="${basedir}/testsrc" />
<!--
===================================================================
Set the properties related to paths
===================================================================
-->
<!--
Set src.dir to an absolute path when building with CruiseControl.
Otherwise, set it to a relative path.
-->
<condition property="src.dir" value="${basedir}/src">
<isset property="cruisecontrol" />
</condition>
<condition property="src.dir" value="src">
<not>
<isset property="cruisecontrol" />
</not>
</condition>
<import file="subfloor.xml" />
<property name="testsrc.dir" value="testsrc"/>
<property name="testsrc.dir.relative" value="testsrc"/>
<property name="java.dir" value="${src.dir}/main"/>
<property name="javatest.dir" value="${testsrc.dir}/main"/>
<property name="etc.dir" value="${src.dir}/etc"/>
<property name="lib.dir" value="lib"/>
<property name="wb.plugins.dir" value="workbench/plugins"/>
<property name="doc.dir" value="doc"/>
<property name="resource.location" location="resource"/>
<property name="javadoc.dir" value="${doc.dir}/api"/>
<property name="classes.dir" value="classes"/>
<property name="testclasses.dir" value="testclasses"/>
<property name="testclasses-jdk14.dir" value="testclasses-jdk14"/>
<property name="build.dir" value="build"/>
<property name="dist.name" value="${name}-${project.revision}"/>
<property name="embedded.dist.name" value="${name}-${project.revision}-embedded"/>
<property name="dist.base" value="distribution"/>
<property name="dist.dir" value="dist"/>
<property name="demo.dir" value="demo"/>
<property name="webapp.dir" value="webapp"/>
<property name="dist.src.file" value="${dist.dir}/${dist.name}-src.zip"/>
<property name="dist.bin.file" value="${dist.dir}/${dist.name}.zip"/>
<property name="dist.bin.derby.file" value="${dist.dir}/${dist.name}-derby.zip"/>
<property name="dist.doc.file" value="${dist.dir}/doc.tar.gz"/>
<property name="jar.file" value="${lib.dir}/${name}.jar"/>
<property name="jar-jdk14.file" value="${lib.dir}/${name}-jdk14.jar" />
<property name="workbench.jar.file" value="${lib.dir}/workbench.jar"/>
<property name="workbench.dist.name" value="workbench-${project.revision}"/>
<property name="workbench.zip-dist.file" value="${workbench.dist.name}.zip"/>
<property name="workbench.main.class" value="mondrian.gui.Workbench"/>
<property name="resource.jar.file" value="${lib.dir}/eigenbase-resgen.jar"/>
<property name="xom.jar.file" value="${lib.dir}/eigenbase-xom.jar"/>
<property name="war.file" value="${lib.dir}/${name}.war"/>
<property name="war.embeddedDb.file" value="${lib.dir}/${name}-embedded.war"/>
<property name="jdk.home" value="${env.JAVA_HOME}"/>
<property name="log4j.configuration" value="log4j.properties" />
<property name="mondrian.webapp.deploy" value="${env.JBOSS_HOME}/server/default/deploy"/>
<property name="mondrian.retroweave" value="false"
description="Tells mondrian to use retroweaver even if the JDK is later than 1.4"/>
<property name="unix.script" value="${basedir}/buildOnJdk.sh"/>
<!--
Set properties that are needed for the retroweaver tasks
to run correctly under CruiseControl.
-->
<property name="jar.file.location" location="${lib.dir}/${name}.jar"/>
<property name="jar-jdk14.file.location" location="${lib.dir}/${name}-jdk14.jar" />
<condition property="in.jar.file" value="${jar.file.location}">
<isset property="cruisecontrol" />
</condition>
<condition property="in.jar.file" value="${jar.file}">
<not>
<isset property="cruisecontrol" />
</not>
</condition>
<condition property="out.jar.file" value="${jar-jdk14.file.location}">
<isset property="cruisecontrol" />
</condition>
<condition property="out.jar.file" value="${jar-jdk14.file}">
<not>
<isset property="cruisecontrol" />
</not>
</condition>
<condition property="olap4j.in.jar.file" value="${lib.location}/olap4j.jar">
<isset property="cruisecontrol" />
</condition>
<condition property="olap4j.in.jar.file" value="${lib.dir}/olap4j.jar">
<not>
<isset property="cruisecontrol" />
</not>
</condition>
<condition property="olap4j.out.jar.file" value="${lib.location}/olap4j-jdk14.jar">
<isset property="cruisecontrol" />
</condition>
<condition property="olap4j.out.jar.file" value="${lib.dir}/olap4j-jdk14.jar">
<not>
<isset property="cruisecontrol" />
</not>
</condition>
<property name="generated.java.files" value="
${java.dir}/mondrian/olap/Parser.java,
${java.dir}/mondrian/olap/ParserSym.java,
${java.dir}/mondrian/parser/MdxParserImpl.java,
${java.dir}/mondrian/parser/MdxParserImplTokenManager.java,
${java.dir}/mondrian/parser/ParseException.java,
${java.dir}/mondrian/parser/SimpleCharStream.java,
${java.dir}/mondrian/parser/Token.java,
${java.dir}/mondrian/parser/TokenMgrError.java,
${java.dir}/mondrian/olap/MondrianDef.java,
${java.dir}/mondrian/olap/Mondrian3Def.java,
${java.dir}/mondrian/olap/MondrianProperties.java,
${java.dir}/mondrian/gui/MondrianGuiDef.java,
${java.dir}/mondrian/resource/MondrianResource*.java,
${java.dir}/mondrian/xmla/DataSourcesConfig*.java,
${java.dir}/mondrian/server/MondrianServerVersion.java
${etc.dir}/mondrian/web/jsp/**/*.java"/>
<property name="generated.lib.files" value="
${lib.dir}/mondrian.jar,
${lib.dir}/workbench.jar,
${jar-jdk14.file},
${lib.dir}/olap4j-jdk14.jar,
${lib.dir}/mondrian.war,
${lib.dir}/mondrian.xml,
${lib.dir}/mondrian-embedded.war,
${lib.dir}/web.xml,
${lib.dir}/index.jsp,
${lib.dir}/*.dtd,
VERSION.txt,
${doc.dir}/properties.html,
mondrian.properties.template,
demo/FoodMartCreateData.sql,
demo/access/MondrianFoodMart.mdb"/>
<path id="project.classpath">
<pathelement location="${lib.dir}/servlet-api.jar"/>
<pathelement location="${lib.dir}/jsp-api.jar"/>
<pathelement location="${lib.dir}/commons-dbcp.jar"/>
<pathelement location="${lib.dir}/commons-collections.jar"/>
<pathelement location="${lib.dir}/commons-io.jar"/>
<pathelement location="${lib.dir}/commons-logging.jar"/>
<pathelement location="${lib.dir}/commons-math.jar"/>
<pathelement location="${lib.dir}/commons-pool.jar"/>
<pathelement location="${lib.dir}/commons-vfs.jar"/>
<pathelement location="${lib.dir}/eigenbase-properties.jar"/>
<pathelement location="${lib.dir}/eigenbase-resgen.jar"/>
<pathelement location="${lib.dir}/eigenbase-xom.jar"/>
<pathelement location="${lib.dir}/javacup.jar"/>
<pathelement location="${lib.dir}/log4j.jar"/>
<pathelement location="${lib.dir}/olap4j.jar"/>
<pathelement location="${lib.dir}/xalan.jar"/>
<pathelement location="${lib.dir}/xercesImpl.jar"/>
<pathelement location="${lib.dir}/validation-api.jar"/>
<pathelement path="${env.CLASSPATH}"/>
<pathelement location="${ant.home}/lib/ant.jar"/>
<pathelement location="${ant.home}/lib/optional.jar"/>
<pathelement location="${wb.plugins.dir}/kettle-dbdialog.jar"/>
<pathelement location="${wb.plugins.dir}/kettle-core.jar"/>
<pathelement location="${wb.plugins.dir}/pentaho-xul-core.jar"/>
<pathelement location="${wb.plugins.dir}/pentaho-xul-swing.jar"/>
</path>
<path id="project.build.classpath">
<pathelement location="${classes.dir}"/>
<path refid="project.classpath"/>
</path>
<path id="project.build.test.classpath-jdk15">
<pathelement location="${classes.dir}"/>
<path refid="project.classpath"/>
<pathelement location="${testclasses.dir}"/>
<fileset dir="${lib.dir}">
<include name="olap4j-tck.jar"/>
<include name="olap4j-xmla.jar"/>
<include name="derby.jar"/>
<include name="xmlunit.jar"/>
<include name="junit.jar"/>
<include name="mockito-all.jar"/>
</fileset>
<!-- this picks up the default log4j.properties -->
<pathelement path="${basedir}"/>
</path>
<path id="project.build.test.classpath-jdk14">
<pathelement location="${jar-jdk14.file}"/>
<pathelement location="${lib.dir}/olap4j-jdk14.jar"/>
<path refid="project.classpath"/>
<pathelement location="${testclasses-jdk14.dir}"/>
<fileset dir="${lib.dir}">
<include name="olap4j-tck.jar"/>
<include name="olap4j-xmla.jar"/>
<include name="derby.jar"/>
<include name="xmlunit.jar"/>
<include name="junit.jar"/>
<include name="xml-apis.jar"/>
</fileset>
<pathelement location="${lib.dir}/retroweaver-rt.jar" />
<pathelement location="${lib.dir}/backport-util-concurrent.jar" />
<!-- this picks up the default log4j.properties -->
<pathelement path="${basedir}"/>
</path>
<condition property="jdk" id="jdk" value="jdk14">
<or>
<contains string="${java.version}" substring="1.4." />
<equals arg1="${mondrian.retroweave}" arg2="true" />
</or>
</condition>
<condition property="jdk" id="jdk" value="jdk15">
<not>
<or>
<contains string="${java.version}" substring="1.4." />
<equals arg1="${mondrian.retroweave}" arg2="true" />
</or>
</not>
</condition>
<condition property="jdk15.present">
<contains string="${java.version}" substring="1.5." />
</condition>
<condition property="jdk15.not.present">
<not>
<contains string="${java.version}" substring="1.5." />
</not>
</condition>
<condition property="jdk16.present">
<contains string="${java.version}" substring="1.6." />
</condition>
<condition property="jdk16.not.present">
<not>
<contains string="${java.version}" substring="1.6." />
</not>
</condition>
<condition property="jdk17.present">
<contains string="${java.version}" substring="1.7." />
</condition>
<condition property="jdk17.not.present">
<not>
<contains string="${java.version}" substring="1.7." />
</not>
</condition>
<condition property="java.version.matches.requested">
<or>
<not>
<isset property="requested.java.version"/>
</not>
<matches pattern="^${requested.java.version}.*" string="jdk${java.runtime.version}" />
</or>
</condition>
<path id="project.build.test.classpath" refid="project.build.test.classpath-${jdk}"/>
<path id="project.test.classpath">
<path refid="project.build.test.classpath"/>
<pathelement path="${driver.classpath}"/>
</path>
<target name="define-tasks" depends="prepare">
<taskdef name="javacup" classname="java_cup.JavaCUPTask">
<classpath refid="project.classpath"/>
</taskdef>
<taskdef name="xomgen" classname="org.eigenbase.xom.XOMGenTask">
<classpath refid="project.classpath"/>
</taskdef>
<taskdef name="resgen" classname="org.eigenbase.resgen.ResourceGenTask">
<classpath refid="project.build.classpath"/>
</taskdef>
</target>
<!--
===================================================================
Properties for running the FoodMart test. (Override them by
editing test.properties)
===================================================================
-->
<!-- Comma-separated list of jdbc drivers. Override in test.properties. -->
<property name="mondrian.jdbcDrivers" value="sun.jdbc.odbc.JdbcOdbcDriver"/>
<!-- Connect string to the database. Override in test.properties. -->
<property name="mondrian.foodmart.jdbcURL" value="jdbc:odbc:MondrianFoodMart"/>
<!-- Classpath for JDBC drivers. Override in your test.properties. -->
<property name="driver.classpath" value=""/>
<!-- URL of the catalog definition. -->
<property name="mondrian.foodmart.catalogURL"
value="file:${project.location}/${demo.dir}/FoodMart.xml"/>
<!-- Test class name. -->
<property name="mondrian.test.Class" value=""/>
<!-- Test pattern. -->
<property name="mondrian.test.Name" value=""/>
<!-- Arguments to the java process spawned by the junit task. -->
<property name="junit.jvmargs" value="-ea -esa -Xmx1024m"/>
<target name="help">
<echo>
You must specify a specific project target when using the ANT build.
Targets are one of the following:
- all
Cleans, compiles all classes, and runs a simple test.
- compile
Compiles functional classes only.
- clean
Deletes build output.
- test
Runs a simple test.
- info
shows configuration info
</echo>
</target>
<target name="info">
<echo>==============================================================</echo>
<echo>| Mondrian configuration info |</echo>
<echo>==============================================================</echo>
<echo>project.location = ${project.location}</echo>
<echo>jdk.home = ${env.JAVA_HOME}</echo>
<echo>log4j.configuration = ${log4j.configuration}</echo>
<echo>mondrian.foodmart.catalogURL = ${mondrian.foodmart.catalogURL}</echo>
<echo>mondrian.foodmart.jdbcURL = ${mondrian.foodmart.jdbcURL}</echo>
<echo>mondrian.jdbcDrivers = ${mondrian.jdbcDrivers}</echo>
<echo>driver.classpath (additions) = ${driver.classpath}</echo>
<echo>==============================================================</echo>
</target>
<target name="clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${lib.dir}" includes="*" excludes="mondrian.xsd,xml-apis.jar"/>
<fileset dir="${classes.dir}" includes="**/*.class,**/*.properties"/>
<fileset dir="${testclasses.dir}" includes="**/*.class,**/*.properties"/>
<fileset dir="." includes="${generated.java.files},${generated.lib.files},VERSION.txt"/>
<fileset dir="demo/derby/foodmart"/>
<fileset dir="${javadoc.dir}" />
<fileset dir="${build.dir}" />
<fileset dir="${testclasses-jdk14.dir}" />
<fileset dir="${testsrc.dir}" includes="**/*.log.xml"/>
<fileset dir="${testsrc.dir}" includes="**/*JUnit.java"/>
<fileset dir="${wb.plugins.dir}" includes="*.jar"/>
</delete>
</target>
<target name="clean-deep">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${lib.dir}" includes="*.jar,*.war" excludes="xml-apis.jar"/>
<fileset dir="${classes.dir}"/>
<fileset dir="${testclasses.dir}"/>
<fileset dir="${dist.dir}"/>
</delete>
<antcall target="clean"/>
</target>
<target name="prepare" depends="install-ivy,resolve">
<mkdir dir="${classes.dir}"/>
<mkdir dir="${testclasses.dir}"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${devlib.dir}"/>
<mkdir dir="${testlib.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="resolve" unless="skip.download" >
<!-- Use symbolic links, rather than copying, on unix. -->
<condition property="symlink" value="true">
<os family="unix"/>
</condition>
<echo message="symlink=${symlink}"/>
<!-- Mondrian dependencies. -->
<ivy:resolve file="ivy.xml"/>
<ivy:retrieve symlink="${symlink}" type="jar,war"
pattern="${lib.dir}/[module].[ext]"/>
<ivy:retrieve symlink="${symlink}" type="source,javadoc"
pattern="${lib.dir}/[module]-[type].[ext]"/>
</target>
<target name="resolve-for-workbench" depends="prepare" unless="skip.download">
<!-- Use symbolic links, rather than copying, on unix. -->
<condition property="symlink" value="true">
<os family="unix"/>
</condition>
<echo message="symlink=${symlink}"/>
<!-- Workbench dependencies to workbench/plugins -->
<ivy:resolve file="workbench/ivy.xml"/>
<ivy:retrieve symlink="${symlink}" type="jar"
pattern="${wb.plugins.dir}/[module].[ext]"/>
<ivy:retrieve symlink="${symlink}" type="source,javadoc"
pattern="${wb.plugins.dir}/[module]-[type].[ext]"/>
</target>
<target name="resolve-workbench-runtime-deps" depends="prepare"
unless="skip.download"
description="Resolves runtime dependencies not required for compilation.">
<ivy:resolve file="workbench/assembly_ivy.xml"/>
<ivy:retrieve symlink="${symlink}" type="jar"
pattern="${wb.plugins.dir}/[module].[ext]"/>
<ivy:retrieve symlink="${symlink}" type="source,javadoc"
pattern="${wb.plugins.dir}/[module]-[type].[ext]"/>
</target>
<target name="cmdrunner" depends="jar">
<property name="crtmp.dir" location="${build.dir}/tmpcmdrunner"/>
<mkdir dir="${crtmp.dir}"/>
<unjar src="${lib.dir}/commons-dbcp.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/commons-collections.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/commons-logging.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/commons-pool.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/commons-vfs.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/eigenbase-properties.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/eigenbase-resgen.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/eigenbase-xom.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/javacup.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/log4j.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/mondrian.jar" dest="${crtmp.dir}"/>
<unjar src="${lib.dir}/servlet-api.jar" dest="${crtmp.dir}"/>
<unjar dest="${crtmp.dir}">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
<exclude name="**/junit.zip"/>
</fileset>
</unjar>
<copy file="./log4j.properties" todir="${crtmp.dir}"/>
<jar destfile="${lib.dir}/cmdrunner.jar" >
<fileset dir="${crtmp.dir}" >
<include name="**/*.xml"/>
<include name="**/*.class"/>
<include name="**/*.properties"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="mondrian.tui.CmdRunner"/>
<attribute name="Built-By" value="${user.name}"/>
<!--
<attribute name="Class-Path" value="${jar.classpath}"/>
<section name="${jar.package}">
<attribute name="Specification-Title" value="${component.title}"/>
<attribute name="Specification-Version" value="${component.version}"/>
<attribute name="Specification-Vendor" value="${company.name}"/>
<attribute name="Implementation-Title" value="${component.title}"/>
<attribute name="Implementation-Version" value="${component.build}"/>
<attribute name="Implementation-Vendor" value="${company.name}"/>
</section>
-->
</manifest>
</jar>
<delete dir="${crtmp.dir}" quiet="true"/>
</target>
<target name="cmdrunner-run" depends="jar,compile.tests">
<java fork="yes" classpathref="project.test.classpath" classname="mondrian.tui.CmdRunner">
<sysproperty key="log4j.configuration" value="${log4j.configuration}"/>
<!-- <arg value="-d"/> -->
</java>
</target>
<target name="all" depends="
compile,
compile.tests,
unzip-databases"/>
<target name="unzip-databases" depends="
unzip-FoodMartCreateData,
unzip-FoodMartAccessDB,
unzip-FoodMartDerbyDB"/>
<target name="compile" depends="
version,
prepare,
parser,
generate.resources,
generate.properties,
def,
compileJdk15,
compileJdk16,
compileJdk17"/>
<target name="generate.resources" depends="define-tasks">
<!-- Compile MondrianException first, so that resgen can use
reflection on it. -->
<javac
srcdir="${java.dir}"
destdir="${classes.dir}"
debug="${project.build.debug}"
classpathref="project.build.classpath"
includeantruntime="false"
source="1.5"
target="1.5">
<include name="mondrian/olap/MondrianException.java" />
<include name="mondrian/olap/ResultLimitExceededException.java" />
<include name="mondrian/olap/InvalidHierarchyException.java" />
<include name="mondrian/olap/ResourceLimitExceededException.java" />
<include name="mondrian/olap/NativeEvaluationUnsupportedException.java" />
<include name="mondrian/olap/QueryCanceledException.java" />
<include name="mondrian/olap/QueryTimeoutException.java" />
</javac>
<resgen
srcdir="${java.dir}"
resdir="${classes.dir}"
style="functor"
locales="en_US,de_DE,de,es_ES">
<include name="mondrian/resource/MondrianResource.xml"/>
</resgen>
</target>
<target name="generate.properties">
<!-- Generate MondrianProperties.java,
mondrian.properties.template, property.html. -->
<javac
srcdir="${java.dir}"
destdir="${classes.dir}"
debug="${project.build.debug}"
classpathref="project.build.classpath"
includeantruntime="false"
source="1.5"
target="1.5">
<include name="mondrian/util/PropertyUtil.java" />
</javac>
<java classpathref="project.build.classpath"
classname="mondrian.util.PropertyUtil"
fork="no"/>
</target>
<target name="apologise" unless="java.version.matches.requested">
<echo>Actual JVM Version (${java.runtime.version}) does not match
requested (${requested.java.version}); skipping compile for this JDK.
If you wish to build for this JDK, modify ${unix.script}.
</echo>
</target>
<target name="compile.java" depends="apologise" if="java.version.matches.requested">
<echo>Compiling on JVM Version: ${java.runtime.version}</echo>
<condition property="include.gui">
<and>
<isset property="include.workbench" />
<!-- workbench kettle dependencies are incompatible with jdk1.5 -->
<not>
<isset property="jdk15.present" />
</not>
</and>
</condition>
<echo>include.gui=${include.gui}</echo>
<javac
srcdir="${java.dir}"
destdir="${classes.dir}"
debug="${project.build.debug}"
classpathref="project.build.classpath"
includeantruntime="false">
<include name="mondrian/**/*.java"/>
<exclude name="mondrian/olap4j/FactoryJdbc3Impl.java" if="jdk15.not.present"/>
<exclude name="mondrian/olap4j/FactoryJdbc4Impl.java" if="jdk16.not.present"/>
<exclude name="mondrian/olap4j/FactoryJdbc4Plus.java" if="jdk16.not.present"/>
<exclude name="mondrian/olap4j/FactoryJdbc41Impl.java" if="jdk17.not.present"/>
<exclude name="mondrian/util/UtilCompatibleJdk16.java" if="jdk15.present"/>
<exclude name="mondrian/gui/**/*.java" unless="include.gui" />
</javac>
<copy file="src/main/mondrian/rolap/aggmatcher/DefaultRules.xml"
todir="${classes.dir}"/>
<copy file="VERSION.txt"
todir="${classes.dir}"/>
<copy file="src/main/mondrian/rolap/aggmatcher/DefaultRulesSchema.xml"
todir="${classes.dir}"/>
<copy todir="${classes.dir}">
<fileset
dir="${java.dir}"
includes="
META-INF/**"/>
</copy>
</target>
<target name="compile.tests" depends="info">
<pathconvert property="test.classpath.formatted" pathsep="${line.separator} " refid="test.classpath" />
<echo message="Test Classpath: ${test.classpath.formatted}" />
<javac
srcdir="${javatest.dir}"
destdir="${testclasses.dir}"
debug="${project.build.debug}"
classpathref="project.build.test.classpath"
includeantruntime="false"
source="1.5"
target="1.5">
<include name="mondrian/**/*.java"/>
</javac>
</target>
<target name="parser" depends="define-tasks">
<!-- Old parser. -->
<javacup
srcdir="${java.dir}"
input="${java.dir}/mondrian/olap/Parser.cup"
expect="63"
interface="true"/>
<!-- New parser. -->
<javacc
target="${java.dir}/mondrian/parser/MdxParser.jj"
javacchome="${lib.dir}"/>
</target>
<target name="def" depends="define-tasks">
<xomgen
model="${java.dir}/mondrian/olap/Mondrian.xml"
destdir="${java.dir}"
classname="mondrian.olap.MondrianDef"
dtdname="mondrian.dtd"/>
<copy file="${java.dir}/mondrian/olap/mondrian.dtd"
todir="${lib.dir}"/>
<!-- Workbench needs a different model. See Mondrian_SW.xml for details. -->
<xomgen
model="${java.dir}/mondrian/olap/Mondrian_SW.xml"
destdir="${java.dir}"
classname="mondrian.gui.MondrianGuiDef"
dtdname="mondrian_SW.dtd"
/>
<xomgen
model="${java.dir}/mondrian/rolap/aggmatcher/DefaultRulesSchema.xml"
destdir="${java.dir}"
classname="mondrian.rolap.aggmatcher.DefaultDef"
dtdname="aggregates.dtd"/>
<copy file="${java.dir}/mondrian/rolap/aggmatcher/aggregates.dtd"
todir="${lib.dir}"/>
<xomgen
model="${java.dir}/mondrian/xmla/DataSourcesConfig.xml"
destdir="${java.dir}"
classname="mondrian.xmla.DataSourcesConfig"
dtdname="datasourcesconfig.dtd"/>
<copy file="${java.dir}/mondrian/xmla/datasourcesconfig.dtd"
todir="${lib.dir}"/>
</target>
<!-- Before you run it, you will need to set the
"mondrian.jdbcDrivers", "mondrian.foodmart.jdbcURL", and
"mondrian.foodmart.catalogURL" properties. The easiest way to
do this is to edit the file "test.properties". -->
<target name="set.connectString">
<!-- Ensure that the JdbcUser parameter is only added to the connect string
if the mondrian.foodmart.jdbcUser property is set. Likewise
JdbcPassword. -->
<condition property="jdbcUser"
value=";JdbcUser='${mondrian.foodmart.jdbcUser}'">
<isset property="mondrian.foodmart.jdbcUser"/>
</condition>
<condition property="jdbcUser" value="">
<not>
<isset property="mondrian.foodmart.jdbcUser"/>
</not>
</condition>
<condition property="jdbcPassword"
value=";JdbcPassword='${mondrian.foodmart.jdbcPassword}'">
<isset property="mondrian.foodmart.jdbcPassword"/>
</condition>
<condition property="jdbcPassword" value="">
<not>
<isset property="mondrian.foodmart.jdbcPassword"/>
</not>
</condition>
<property name="mondrian.test.connectString"
value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}'${jdbcUser}${jdbcPassword};Catalog='${mondrian.foodmart.catalogURL}'"/>
</target>
<target name="FoodMartTest"
description="Runs a few queries using the FoodMart schema."
depends="set.connectString">
<java classpathref="project.classpath" classname="mondrian.test.Main"
fork="yes" maxmemory="768m">
<sysproperty key="mondrian.jdbcDrivers"
value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.test.foodmart.catalogURL"
value="${mondrian.foodmart.catalogURL}"/>
<!-- mondrian.test.connectString is the mondrian connect-string.
Provider must be 'mondrian'. -->
<sysproperty key="mondrian.test.connectString"
value="${mondrian.test.connectString}"/>
</java>
</target>
<target name="test"
description="Runs all JUnit tests."
depends="compile,compile.tests,unzip-databases,set.connectString"
unless="tests.skip">
<antcall target="test-nobuild"/>
</target>
<target name="cobertura" unless="tests.skip">
<antcall target="subfloor.cobertura"/>
</target>
<target name="cobertura.test-instrumented" unless="tests.skip">
<antcall target="subfloor.cobertura.test-instrumented"/>
</target>
<condition property="tests.skip" value="true">
<isset property="mondrian.tests.skip"/>
</condition>
<target name="test-list">
<property name="test.args" value="-l"/>
<antcall target="test-only"/>
</target>
<target name="test-nobuild">
<property name="test.args" value=""/>
<antcall target="test-only"/>
</target>
<target name="test-only"
depends="set.connectString"
description="
Runs all JUnit tests, using the given database connection
in {mondrian.foodmart.jdbcURL}."
unless="tests.skip">
<echo>Connecting to ${mondrian.foodmart.jdbcURL}</echo>
<echo>Connect String: ${mondrian.test.connectString}</echo>
<delete quiet="true">
<fileset dir="${testsrc.dir}" includes="**/*.log.xml"/>
</delete>
<java
classpathref="project.test.classpath"
classname="mondrian.test.Main"
fork="yes"
maxmemory="768m">
<arg value="${test.args}"/>
<!--<jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8787" />-->
<jvmarg line="${junit.jvmargs}"/>
<sysproperty key="log4j.configuration"
value="${log4j.configuration}"/>
<sysproperty key="mondrian.jdbcDrivers"
value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.foodmart.jdbcURL"
value="${mondrian.foodmart.jdbcURL}"/>
<sysproperty key="mondrian.test.foodmart.catalogURL"
value="${mondrian.foodmart.catalogURL}"/>
<sysproperty key="mondrian.test.connectString"
value="${mondrian.test.connectString}"/>
<sysproperty key="mondrian.test.Class"
value="${mondrian.test.Class}"/>
<sysproperty key="mondrian.test.Name"
value="${mondrian.test.Name}"/>
<!-- tests require en_US locale -->
<sysproperty key="user.language" value="en"/>
<sysproperty key="user.region" value="US"/>
</java>
</target>
<target name="junit-main" depends="compile,compile.tests,set.connectString" unless="tests.skip">
<mkdir dir="junit-results"/>
<junit printsummary="yes" fork="yes" haltonfailure="no" haltonerror="no">
<classpath>
<path refid="project.test.classpath"/>
</classpath>
<jvmarg line="${junit.jvmargs}"/>
<sysproperty key="log4j.configuration"
value="${log4j.configuration}"/>
<sysproperty key="mondrian.jdbcDrivers"
value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.foodmart.jdbcURL"
value="${mondrian.foodmart.jdbcURL}"/>
<sysproperty key="mondrian.test.foodmart.catalogURL"
value="${mondrian.foodmart.catalogURL}"/>
<sysproperty key="mondrian.test.connectString"
value="${mondrian.test.connectString}"/>
<sysproperty key="mondrian.test.Class"
value="${mondrian.test.Class}"/>
<sysproperty key="mondrian.test.Name"
value="${mondrian.test.Name}"/>
<!-- tests require en_US locale -->
<sysproperty key="user.language" value="en"/>
<sysproperty key="user.region" value="US"/>
<formatter type="xml" />
<batchtest fork="yes" todir="junit-results">
<fileset dir="${testclasses.dir}">
<include name="mondrian/test/Main.class" />
</fileset>
</batchtest>
</junit>
<junitreport todir="junit-results">
<fileset dir="junit-results">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="junit-results/html"/>
</junitreport>
</target>
<target name="junit-cachehit" depends="compile,compile.tests,set.connectString" unless="tests.skip">
<junit printsummary="yes" fork="yes" haltonfailure="no" haltonerror="no" showoutput="yes">
<classpath>
<path refid="project.test.classpath"/>
</classpath>
<sysproperty key="log4j.configuration"
value="${log4j.configuration}"/>
<sysproperty key="mondrian.jdbcDrivers"
value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.test.connectString"
value="${mondrian.test.connectString}"/>
<sysproperty key="mondrian.test.foodmart.catalogURL"
value="${mondrian.foodmart.catalogURL}"/>
<formatter type="xml" />
<batchtest fork="yes">
<fileset dir="${testclasses.dir}">
<include name="mondrian/test/CacheHitTest.class" />
</fileset>
</batchtest>
</junit>
</target>
<target name="junit-cvconcurrent" depends="compile,compile.tests,set.connectString" unless="tests.skip">
<junit printsummary="yes" fork="yes" haltonfailure="no" haltonerror="no" showoutput="yes">
<classpath>
<path refid="project.test.classpath"/>
</classpath>
<sysproperty key="log4j.configuration"
value="${log4j.configuration}"/>
<sysproperty key="mondrian.jdbcDrivers"
value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.test.connectString"
value="${mondrian.test.connectString}"/>
<sysproperty key="mondrian.test.foodmart.catalogURL"
value="${mondrian.foodmart.catalogURL}"/>
<formatter type="xml" />
<batchtest fork="yes">
<fileset dir="${testclasses.dir}">
<include name="mondrian/test/CVConcurrentMdxTest.class" />
</fileset>
</batchtest>
</junit>
</target>
<macrodef name="genJUnit">
<attribute name="path"/>
<attribute name="packagename"/>
<attribute name="testname"/>
<sequential>
<xslt style="${testsrc.dir}/xsl/generateDiffRepositoryJUnit.xsl"
in="@{path}@{testname}.ref.xml"
out="@{path}@{testname}JUnit.java">
<param name="reffile"
expression="${testsrc.dir}/main/mondrian/test/clearview/@{testname}.ref.xml"/>
<param name="packagename"
expression="@{packagename}"/>
<param name="classname"
expression="@{testname}JUnit"/>
</xslt>
</sequential>
</macrodef>
<target name="generateDiffRepositoryJUnit"
description="Generates explicit Java testcases from .ref.xml files">
<!-- generate clearview junit code files -->
<property name="path" value="${testsrc.dir}/main/mondrian/test/clearview/"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="CVBasicTest"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="MetricFilterTest"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="MiscTest"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="PredicateFilterTest"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="SummaryTest"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="SummaryMetricPercentTest"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="TopBottomTest"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="GrandTotalTest"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="SubTotalTest"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="BatchedFillTest"/>
<genJUnit path="${path}" packagename="mondrian.test.clearview" testname="HangerDimensionTest"/>
</target>
<target name="etags">
<exec dir="${project.location}" executable="find" output="javaFiles">
<arg line=". -name "*.java" -print"/>
</exec>
<exec dir="${project.location}" executable="ctags">
<arg line="-e"/>
<arg line="-L javaFiles"/>
</exec>
<delete file="${project.location}/javaFiles" quiet="true"/>
</target>
<target name="version">
<echo file="VERSION.txt">Title: ${name}
Version: ${project.revision}
VersionMajor: ${project.revision.major}
VersionMinor: ${project.revision.minor}
Vendor: ${vendor}
</echo>
<echo file="${java.dir}/mondrian/olap4j/MondrianOlap4jDriverVersion.java">/*
* Project version information. Generated - do not modify.
*/
package mondrian.olap4j;
/**
* Version information for the Mondrian olap4j driver. (Generated.)
*/
class MondrianOlap4jDriverVersion {
static final String NAME = "${driver.name}";
static final String VERSION = "${driver.version}";
static final int MAJOR_VERSION = ${driver.version.major};
static final int MINOR_VERSION = ${driver.version.minor};
}
// End MondrianOlap4jDriverVersion.java</echo>
<echo file="${java.dir}/mondrian/server/MondrianServerVersion.java">/*
* Project version information. Generated - do not modify.
*/
package mondrian.server;
/**
* Version information for Mondrian. (Generated by build)
*/
class MondrianServerVersion {
static final String VENDOR = "${vendor}";
static final String NAME = "${name}";
static final String VERSION = "${project.revision}";
static final int MAJOR_VERSION = ${project.revision.major};
static final int MINOR_VERSION = ${project.revision.minor};
}
// End MondrianServerVersion.java</echo>
</target>
<target name="srczip" depends="version">
<mkdir dir="${dist.dir}" />
<delete file="${dist.src.file}"/>
<zip
zipfile="${dist.src.file}"
update="true">
<zipfileset
dir="."
prefix="${dist.name}"
includes="
${java.dir}/**/*.properties,
${java.dir}/META-INF/**,
${java.dir}/mondrian/resource/MondrianResource.xml,
${java.dir}/mondrian/olap/Mondrian.xml,
${java.dir}/mondrian/olap/Mondrian_SW.xml,
${java.dir}/mondrian/olap/MondrianProperties.xml,
${java.dir}/mondrian/rolap/aggmatcher/DefaultRules.xml,
${java.dir}/mondrian/rolap/aggmatcher/DefaultRulesSchema.xml,
${java.dir}/mondrian/xmla/DataSourcesConfig.xml,
${java.dir}/**/*.java,
${java.dir}/**/*.cup,
${java.dir}/**/*.jj,
${java.dir}/**/*.gif,
${java.dir}/**/*.png,
${java.dir}/**/*.html,
${lib.dir}/mondrian.xsd,
${testsrc.dir.relative}/queryFiles/**/*.xml,
${testsrc.dir.relative}/**/*.csv,