-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
1030 lines (922 loc) · 45.6 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<!--
Rapla builds are based on the ANT-tool from apache.org.
Ant is a build tool written in java that uses a build-file, like this one.
Ant does all the nasty work like compiling,building and testing the different distributions.
For more information visit "http://jakarata.apache.org".
The rapla-source distribution comes with a copy of ANT located in the lib directory:
ant.jar,optional.jar
You will also find junit.jar
junit.jar is a testing-framework for automated testing used for most of our tests
(currently there are'nt many).
Building instructions
(shamelessly taken from the Apache Cocoon-build-file and replaced cocoon with rapla)
=====================
Ok, let's build the baby. First, make sure your current working directory is
where this very file is located. Then type
./build.sh (unix)
.\build.bat (win32)
if everything is right and all the required packages are visible, this action
will generate a file called "rapla.jar" in the "./build" directory.
Note, that if you do further development, compilation time is reduced since
Ant is able of detecting which files have changed and to recompile them at need.
Also, you'll note that reusing a single JVM instance for each task, increases
tremendously the performance of the whole build system, compared to other
tools (i.e. make or shell scripts) where a new JVM is started for each task.
Building on another directory
=============================
Sometimes you might want to build on an external directory to keep the
distribution clean: no worries, this is just an environment property away.
Suppose you want to use the "../build" directory instead, you simply tipe
[unix] ./build.sh -Dbuild.dir=../build
[win32] .\build.bat -Dbuild.dir=..\build
By using the -Dxxx=yyy argument, you are setting environments in the JVM: Ant
is designed to give higher priority to system environments to allow you to
modify _any_ <property> that you can find in the building instructions below,
so it's just a matter of understanding what property you want to change
and you don't have to touch this file (which you shouldn't need to do).
Build targets
=============
The build system is not only responsible of compiling Rapla into a jar file,
but is also responsible for creating the HTML documentation, javadocs,
distributions and web site. In fact, the file you have here is _exactly_ what
is used by rapla maintainers to take care of everything in the Rapla
project, no less and no more.
To know more about the available targets take a look at this file, which is
pretty self-explanatory or type
[unix] ./build.sh -projecthelp
[win32] .\build.bat -projecthelp
and concentrate on the target descriptions that start with a star '*': these
are the one you should call, the others are internal targets that are called
by the main ones.
Many thanks to the cocoon team
-->
<!-- Rapla build-file
Copyright (C) 2001-2013 Christopher Kohlhaas
This programm is free software; you can redistribute it and/or modify
it under the terns of the GNU General Public License as published by the
Free Software Foundation. A copy of the license has been included with
these distribution in the COPYING file, if not go to www.fsf.org .
As a special exception, you are granted the permission to link this
program with every library, of wich license fullfills the Open Source
Definition as published by the Open Source Initiative (OSI).
-->
<project name="Rapla" default="choose-target" basedir=".">
<!-- This is for the crlf-fix -->
<patternset id="text-files">
<include name="**/*.java" />
<include name="contexts/rapla.xml" />
<include name="build.xml" />
<include name="build.properties.template" />
<include name="buildplugin.xml" />
<include name="**/*.txt" />
<include name="**/*.properties" />
</patternset>
<property name="main.dir" value="${basedir}" />
<target name="properties" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" />
</target>
<target name="init" depends="properties">
<!-- Create the time stamp -->
<tstamp />
<tstamp>
<format property="BUILD_TIME" pattern="yyyy-MM-dd HH:mm" locale="en" />
</tstamp>
<property name="doc.properties" value="doc.properties" />
<property name="build.properties" value="build.properties" />
<available file="${main.dir}/${build.properties}" property="build.properties.present" />
<copy todir="${main.dir}">
<fileset dir="${main.dir}">
<include name="build.properties.template" unless="build.properties.present" />
</fileset>
<mapper type="glob" from="*.template" to="*" />
</copy>
<property file="${main.dir}/${build.properties}" />
<property file="${main.dir}/${doc.properties}" />
<property name="plugin.base" value="${main.dir}/.." />
<property name="plugin.includes" value="*_plugin" />
<property name="plugin.excludes" value="nothing_plugin" />
<property name="plugin.main.excludes" value="nothing" />
<!-- All the libraries are used for compilation by default-->
<patternset id="default-runtime-libs">
<include name="common/*.jar" />
<include name="server/*.jar" />
<include name="ext/*.jar" />
<include name="logging/*.jar" />
<include name="test-only/junit*.jar"/>
<exclude name="ant*.jar" />
<include name="*.jar" />
</patternset>
<!-- Information about the compiler -->
<!-- property name="build.compiler" value="javac1.3"/-->
<property name="debug" value="on" />
<property name="optimize" value="off" />
<property name="deprecation" value="off" />
<property name="verbose" value="no" />
<property name="target_vm" value="1.6" />
<property name="packages" value="org.*" />
<!-- The rapla-directories -->
<property name="src.dir" value="${main.dir}/src" />
<property name="webappsrc.dir" value="${main.dir}/war" />
<property name="webapp.default_css" value="${webappsrc.dir}/default.css" />
<property name="lib.dir" value="${main.dir}/lib" />
<property name="build.dir" value="${main.dir}/build" />
<property name="dist.dir" value="${main.dir}/dist" />
<property name="temp.dir" value="${main.dir}/temp" />
<property name="testsrc.dir" value="${main.dir}/test-src" />
<property name="test.dir" value="${basedir}/test" />
<property name="test-dist-src.dir" value="${test.dir}/rapla-source-test" />
<property name="build.src" value="${build.dir}/src" />
<property name="build.javadocs" value="${main.dir}/javadoc" />
<property name="build.dest.main" value="${build.dir}/classes" />
<property name="build.dest.client" value="${build.dir}/clientclasses" />
<property name="build.dest.bootstrap" value="${build.dir}/bootstrap" />
<property name="build.dest.test" value="${build.dir}/test/classes" />
<property name="dist-src.dir" value="${dist.dir}/rapla-source-${doc.version}" />
<property name="dist-bin.dir" value="${dist.dir}/rapla-binary-${doc.version}" />
<property name="webapp.dir" value="${build.dir}/war" />
<property name="keystore.file" value="${main.dir}/testkeystore" />
<property name="keystore.password" value="secret" />
<property name="application.name" value="Rapla" />
<property name="main.lib" value="rapla-${doc.version}.jar" />
<property name="main.client.lib" value="raplaclient.jar" />
<property name="target" value="dist-bin" />
<available file="${keystore.file}" property="keystore.present" />
<condition property="permissions.client" value="all-permissions" else="sandbox">
<available file="${keystore.file}"/>
</condition>
<!-- filters will replace tokens in source files with the values in doc.properties -->
<filterset id="docfilter">
<filter token="doc.name" value="${doc.name}" />
<filter token="doc.date" value="${doc.date}" />
<filter token="doc.version" value="${doc.version}" />
<filter token="doc.buildtime" value="${BUILD_TIME}" />
<filter token="doc.year" value="${doc.year}" />
<filter token="doc.copyright" value="${doc.copyright}" />
<filter token="doc.developer-list-link" value="${doc.developer-list-link}" />
<filter token="doc.developer-list" value="${doc.developer-list}" />
<filter token="doc.homepage" value="${doc.homepage}" />
</filterset>
</target>
<target name="clean_on_demand" if="clean.everytime">
<echo message="clean.everytime specified in build so clean is called"/>
<antcall target="clean" />
</target>
<target name="choose-target" depends="init,clean_on_demand" description="Executes the target specified in build.properties. Default is dist-bin.">
<antcall target="${target}" />
</target>
<!-- =================================================================== -->
<!-- The Targets prepare,compile,compile-resources and build are for -->
<!-- creating the ${main.lib} -->
<!-- =================================================================== -->
<target name="prepare" depends="init">
<mkdir dir="${temp.dir}" />
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dest.main}" />
<mkdir dir="${build.dest.client}" />
<mkdir dir="${build.dest.bootstrap}" />
<mkdir dir="${build.dest.main}/META-INF" />
<mkdir dir="${build.dest.client}/META-INF" />
</target>
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${build.dest.bootstrap}" debug="${debug}" source="${target_vm}" target="${target_vm}" optimize="${optimize}" deprecation="${deprecation}" verbose="${verbose}" includeAntRuntime="false">
<include name="org/rapla/bootstrap/*"/>
</javac>
<javac srcdir="${src.dir}" sourcepath="" destdir="${build.dest.client}" debug="${debug}" source="${target_vm}" target="${target_vm}" optimize="${optimize}" deprecation="${deprecation}" verbose="${verbose}" includeAntRuntime="false">
<classpath>
<fileset dir="${lib.dir}">
<include name="common/*.jar" />
</fileset>
</classpath>
<exclude name="org/rapla/bootstrap/*"/>
<exclude name="**/Slf4jAdapter**" />
<exclude name="**/server/**" />
<exclude name="**/storage/dbfile/**" />
<exclude name="**/storage/dbsql/**" />
<exclude name="**/servletpages/**" />
<exclude name="se/jiderhamn/**"/>
<include name="**" />
</javac>
<!-- now compile the rest -->
<javac srcdir="${src.dir}" sourcepath="" destdir="${build.dest.main}" debug="${debug}" source="${target_vm}" target="${target_vm}" optimize="${optimize}" deprecation="${deprecation}" verbose="${verbose}" includeAntRuntime="false">
<classpath>
<fileset dir="${lib.dir}">
<include name="client/*.jar" />
<include name="common/*.jar" />
<include name="server/*.jar" />
<include name="logging/slf4j-api-*.jar" />
<include name="servlet-api-*.jar" />
</fileset>
</classpath>
<exclude name="org/rapla/bootstrap/*"/>
</javac>
<!-- The png,license,xsl and rng files must be in the correct classpath -->
<copy todir="${build.dest.main}">
<fileset dir="${src.dir}">
<exclude name="org/rapla/bootstrap"/>
<exclude name="org/rapla/bootstrap/**"/>
<exclude name="**/*.java" />
<exclude name="**/*Resources.xml" />
<exclude name="**/package.html" />
<exclude name="**/overview.html" />
<exclude name="**/DEPENDENCIES" />
<exclude name="**/ical4j.properties" />
<exclude name="**/commons-logging.properties" />
</fileset>
</copy>
<copy todir="${build.dest.main}/META-INF">
<fileset dir="${main.dir}/legal">
<include name="readme.txt"/>
<include name="license.txt"/>
</fileset>
</copy>
<copy todir="${build.dest.bootstrap}">
<fileset dir="${src.dir}">
<include name="org/rapla/bootstrap/**"/>
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<!-- Set a variable if plugin meta is already up-to-date. -->
<target name="pluginmeta-check" depends="prepare">
<condition property="pluginmeta.notrequired">
<and>
<uptodate>
<srcfiles dir="${build.dest.main}" includes="**/*Plugin.class" />
<mapper type="merge" to="${build.dest.main}/META-INF/rapla-plugin.list" />
</uptodate>
</and>
</condition>
</target>
<target name="generate-plugin-meta" unless="pluginmeta.notrequired" description="Generate the rapla-plugin.list" depends="pluginmeta-check,compile">
<echo message="generating Plugin Metainfo" />
<mkdir dir="${temp.dir}/META-INF" />
<java classname="org.rapla.framework.ServiceListCreator" failonerror="true" fork="yes">
<arg value="${build.dest.main}" />
<arg value="${temp.dir}/META-INF/rapla-plugin.list" />
<classpath>
<pathelement path="${build.dest.main}" />
</classpath>
</java>
<copy file="${temp.dir}/META-INF/rapla-plugin.list" tofile="${build.dest.main}/META-INF/rapla-plugin.list">
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="org\.rapla\.plugin\.(${plugin.main.excludes})\..*"/>
</linecontainsregexp>
</filterchain>
</copy>
</target>
<!-- Set a variable if resources are already up-to-date. -->
<target name="resources-check" depends="init">
<condition property="resources.notrequired">
<and>
<uptodate>
<srcfiles dir="${src.dir}">
<include name="**/*Resources.xml" />
</srcfiles>
<mapper type="glob" from="*Resources.xml" to="${build.dest.main}/*Resources.properties" />
</uptodate>
<uptodate property="test" srcfile="${main.dir}/${doc.properties}" targetfile="${build.dest.main}/org/rapla/RaplaResources.properties" />
</and>
</condition>
</target>
<target name="check-svn-entries" depends="init">
<available file="${basedir}/.svn" property="svn.entries.present"/>
<echo message="SVN present ${svn.entries.present}"/>
</target>
<target name="revision-number" depends="check-svn-entries" if="svn.entries.present">
<delete file="${temp.dir}/svninfo.xml"/>
<exec executable="svn" output="${temp.dir}/svninfo.xml" failifexecutionfails="false" logerror="false" searchpath="true" resolveexecutable="true">
<arg line="info --xml" />
</exec>
<xmlproperty file="${temp.dir}/svninfo.xml" collapseattributes="true" />
</target>
<target name="revision-number-filter1" depends="check-svn-entries,revision-number" if="info.entry.commit.revision">
<filterset id="revisionfilter">
<filter token="doc.revision" value="${info.entry.commit.revision}" />
</filterset>
</target>
<target name="revision-number-filter2" depends="check-svn-entries,revision-number" unless="info.entry.commit.revision">
<filterset id="revisionfilter">
<filter token="doc.revision" value="-" />
</filterset>
</target>
<target name="compile-resources" unless="resources.notrequired" description="Generate and compile the RaplaResources" depends="check-svn-entries,revision-number,revision-number-filter1,revision-number-filter2,resources-check,compile">
<echo message="generating Resourcefiles" />
<java classname="org.rapla.components.xmlbundle.impl.ResourceFileGenerator" failonerror="true" fork="yes">
<arg value="${src.dir}" />
<arg value="${temp.dir}/unfiltered-resources" />
<classpath>
<pathelement path="${build.dest.main}" />
</classpath>
</java>
<uptodate property="resources.rebuild">
<srcfiles dir="${build.dest.main}" includes="**/*Resources*.properties" />
<mapper type="merge" to="{$main.dir}/${doc.properties}" />
</uptodate>
<echo message="Applying filter to ResourceFiles" />
<copy todir="${build.dest.main}">
<fileset dir="${temp.dir}/unfiltered-resources">
<include name="**/*.properties" />
</fileset>
<filterset refid="docfilter" />
<filterset refid="revisionfilter" />
</copy>
<!-- <delete dir="${temp.dir}/languages" /> -->
</target>
<target name="build" depends="compile,compile-resources,generate-plugin-meta">
<mkdir dir="${build.src}" />
<jar jarfile="${build.dir}/${main.lib}">
<fileset dir="${build.dest.main}">
<exclude name="org/rapla/bootstrap/*" />
</fileset>
<manifest>
<attribute name="Created-By" value="${user.name}" />
<section name="common">
<attribute name="Implementation-Title" value="common" />
<attribute name="Implementation-Version" value="${doc.version} ${TODAY}" />
<attribute name="url" value="${doc.homepage}"/>
<attribute name="Codebase" value="*"/>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Permissions" value="all-permissions"/>
<attribute name="Bundle-License" value="http://www.gnu.org/licenses/gpl.html"/>
</section>
</manifest>
</jar>
<copy todir="${build.dest.client}">
<fileset dir="${build.dest.main}">
<exclude name="**/*.class" />
<exclude name="**/server" />
<exclude name="**/server/**" />
<exclude name="se"/>
<exclude name="se/jiderhamn"/>
<exclude name="se/jiderhamn/**"/>
<exclude name="org/rapla/storage/dbfile"/>
<exclude name="org/rapla/storage/dbfile/**" />
<exclude name="org/rapla/storage/dbsql"/>
<exclude name="org/rapla/storage/dbsql/**" />
<exclude name="org/rapla/servletpages" />
<exclude name="org/rapla/servletpages/**" />
</fileset>
</copy>
<jar jarfile="${build.dir}/${main.client.lib}">
<fileset dir="${build.dest.client}">
</fileset>
<manifest>
<attribute name="Created-By" value="${user.name}" />
<section name="common">
<attribute name="Implementation-Title" value="common" />
<attribute name="Implementation-Version" value="${doc.version} ${TODAY}" />
<attribute name="url" value="${doc.homepage}"/>
<attribute name="Bundle-License" value="http://www.gnu.org/licenses/gpl.html"/>
</section>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Codebase" value="*"/>
<attribute name="Permissions" value="${permissions.client}"/>
</manifest>
</jar>
<jar jarfile="${build.dir}/raplabootstrap.jar">
<fileset dir="${build.dest.bootstrap}">
</fileset>
<manifest>
<attribute name="Created-By" value="${user.name}" />
<attribute name="Main-Class" value="org.rapla.bootstrap.RaplaStandaloneLoader" />
<section name="common">
<attribute name="Implementation-Title" value="common" />
<attribute name="Implementation-Version" value="${doc.version} ${TODAY}" />
<attribute name="url" value="${doc.homepage}"/>
<attribute name="Bundle-License" value="http://www.gnu.org/licenses/gpl.html"/>
</section>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Codebase" value="*"/>
<attribute name="Permissions" value="all-permissions"/>
</manifest>
</jar>
</target>
<target name="build-plugins" depends="compile">
<subant target="build" genericantfile="buildplugin.xml">
<dirset dir="${plugin.base}" includes="${plugin.includes}" excludes="${plugin.excludes}"/>
<property name="rapla.dir" value="${main.dir}"/>
<property name="rapla.build.dir" value="${build.dir}"/>
<property name="plugin.base" value="${plugin.base}"/>
<property name="permissions.client" value="${permissions.client}"/>
<property name="application.name" value="${application.name}"/>
</subant>
</target>
<target name="build-plugins-sub" depends="prepare">
<echo message="Building dependencies ${plugin.dependencies.sub}"/>
<subant target="compile" genericantfile="${main.dir}/buildplugin.xml" inheritAll="false" inheritRefs="false">
<dirset dir="${plugin.base}" includes="${plugin.dependencies.sub}" />
<property name="rapla.dir" value="${main.dir}"/>
<property name="rapla.build.dir" value="${build.dir}"/>
<property name="plugin.base" value="${plugin.base}"/>
<property name="permissions.client" value="${permissions.client}"/>
<property name="application.name" value="${application.name}"/>
</subant>
</target>
<target name="run" depends="dist-bin" description="build and run binary-distribution">
<java classname="org.rapla.bootstrap.RaplaStandaloneLoader" fork="yes" dir="${dist-bin.dir}">
<classpath>
<fileset dir="${dist-bin.dir}">
<include name="raplabootstrap.jar"/>
</fileset>
</classpath>
</java>
</target>
<!-- =================================================================== -->
<!-- Build the webapps folder -->
<!-- =================================================================== -->
<target name="webapp" depends="build" description="Build the rapla web-application">
<mkdir dir="${webapp.dir}" />
<mkdir dir="${webapp.dir}/WEB-INF" />
<mkdir dir="${webapp.dir}/META-INF" />
<mkdir dir="${webapp.dir}/webclient" />
<mkdir dir="${webapp.dir}/WEB-INF/lib" />
<mkdir dir="${webapp.dir}/WEB-INF/classes" />
<!-- this also includes the build of the plugins -->
<subant target="copytowebapp" genericantfile="buildplugin.xml" inheritAll="false" inheritRefs="false">
<dirset dir="${plugin.base}" includes="${plugin.includes}" excludes="${plugin.excludes}"/>
<property name="rapla.dir" value="${main.dir}"/>
<property name="rapla.build.dir" value="${build.dir}"/>
<property name="webapp.dir" value="${webapp.dir}"/>
<property name="plugin.base" value="${plugin.base}"/>
<property name="permissions.client" value="${permissions.client}"/>
<property name="application.name" value="${application.name}"/>
</subant>
<copy todir="${webapp.dir}">
<fileset dir="${webappsrc.dir}">
<exclude name="WEB-INF/classes/**" />
<exclude name="default.css" />
<include name="**" />
</fileset>
</copy>
<copy tofile="${webapp.dir}/default.css" file="${webapp.default_css}"/>
<copy todir="${webapp.dir}/webclient">
<fileset dir="${lib.dir}/common">
<include name="*.jar" />
</fileset>
<fileset dir="${build.dir}">
<include name="${main.client.lib}" />
</fileset>
</copy>
<jar jarfile="${webapp.dir}/webclient/iText-4.2.0-com.itextpdf.jar" update="true">
<manifest>
<attribute name="Permissions" value="${permissions.client}"/>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Codebase" value="*"/>
</manifest>
</jar>
<jar jarfile="${webapp.dir}/webclient/super-csv-2.0.1.jar" update="true">
<manifest>
<attribute name="Permissions" value="${permissions.client}"/>
<attribute name="Application-Name" value ="${application.name}"/>
<attribute name="Codebase" value="*"/>
</manifest>
</jar>
<copy file="${src.dir}/org/rapla/gui/images/tafel.png" tofile="${webapp.dir}/webclient/logo.png" />
<copy todir="${webapp.dir}/WEB-INF/lib">
<fileset dir="${lib.dir}/common">
<include name="*.jar" />
</fileset>
<fileset dir="${lib.dir}/server">
<exclude name="mailapi*.jar" if="mailapi.exclude"/>
<exclude name="smtp*.jar" if="mailapi.exclude"/>
<include name="*.jar"/>
</fileset>
<fileset dir="${build.dir}">
<include name="${main.lib}" />
</fileset>
</copy>
<copy todir="${webapp.dir}/WEB-INF/classes">
<fileset dir="${src.dir}">
<include name="**/ical4j.properties" />
<include name="**/commons-logging.properties" />
</fileset>
<fileset dir="${webappsrc.dir}/WEB-INF">
<include name="raplaserver.xconf" />
</fileset>
</copy>
<uptodate property="clientlib.uptodate" targetfile="${webapp.dir}/WEB-INF/classes/clientlibs.properties">
<srcfiles dir="${webapp.dir}/webclient" includes="*.jar"/>
</uptodate>
</target>
<target name="sign" if="keystore.present">
<signjar
alias="rapla" keystore="${keystore.file}"
storepass="${keystore.password}"
lazy="true"
>
<path>
<fileset dir="${webapp.dir}/webclient" includes="**/*.jar" />
<fileset dir="${webapp.dir}/WEB-INF/lib" includes="**/*.jar" />
</path>
</signjar>
</target>
<target name="updateclientlibs" depends="webapp" unless="clientlib.uptodate">
<path id="dist.contents">
<fileset dir="${webapp.dir}/webclient">
<include name="*.jar"/>
</fileset>
</path>
<path id="dist.contents.dir">
<dirset dir="${webapp.dir}/webclient">
</dirset>
</path>
<property name="prop.dist.contents" refid="dist.contents"/>
<property name="prop.dist.contents.dir" refid="dist.contents.dir"/>
<echo file="${webapp.dir}/WEB-INF/classes/clientlibs.properties">${prop.dist.contents}</echo>
<replace file="${webapp.dir}/WEB-INF/classes/clientlibs.properties" token="${prop.dist.contents.dir}${file.separator}" value="" preserveLastModified="true"/>
<replace file="${webapp.dir}/WEB-INF/classes/clientlibs.properties" token="${path.separator}" value=";" preserveLastModified="true"/>
</target>
<target name="war" depends="webapp,updateclientlibs,sign" description="Pack the war">
<war destfile="${build.dir}/rapla.war">
<fileset dir="${webapp.dir}"/>
</war>
</target>
<!-- =================================================================== -->
<!-- Create the basic binary distribution that can run Rapla -->
<!-- =================================================================== -->
<target name="dist-bin" depends="webapp,war" description="Build the binary distribution">
<mkdir dir="${dist-bin.dir}" />
<mkdir dir="${dist-bin.dir}/data" />
<mkdir dir="${dist-bin.dir}/webapps" />
<copy todir="${dist-bin.dir}/webapps">
<fileset dir="${build.dir}" >
<include name="rapla.war" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/service" />
<copy todir="${dist-bin.dir}/service">
<fileset dir="${main.dir}/service" >
<include name="**" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/lib" />
<copy todir="${dist-bin.dir}/lib">
<fileset dir="${lib.dir}">
<include name="servlet-api-*.jar" />
<include name="jetty*.jar" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/lib/logging" />
<copy todir="${dist-bin.dir}/lib/logging">
<fileset dir="${lib.dir}/logging">
<include name="logback*.jar" />
<include name="*slf4j*.jar" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/lib/ext" />
<copy todir="${dist-bin.dir}/lib/ext">
<fileset dir="${lib.dir}/ext">
<include name="*.jar" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/etc" />
<copy todir="${dist-bin.dir}/etc">
<fileset dir="${main.dir}/etc" >
<include name="jetty.xml" />
<include name="webdefault.xml" />
</fileset>
</copy>
<mkdir dir="${dist-bin.dir}/resources" />
<copy todir="${dist-bin.dir}/resources">
<fileset dir="${main.dir}/resources" >
<include name="logback.xml" />
<include name="logback-access.xml" />
</fileset>
</copy>
<copy todir="${dist-bin.dir}/contexts">
<fileset dir="${main.dir}/contexts" >
<include name="*.xml_" />
<exclude name="rapla-develop.xml" />
</fileset>
<mapper type="glob" from="*.xml_" to="*.xml" />
</copy>
<mkdir dir="${dist-bin.dir}/logs" />
<copy todir="${dist-bin.dir}">
<fileset dir="${build.dir}">
<include name="raplabootstrap.jar" />
</fileset>
<fileset dir="${main.dir}/templates">
<include name="rapla*.exe" />
<include name="rapla*.l4j.ini" />
</fileset>
<fileset dir="${main.dir}">
<include name="README**" />
<include name="INSTALL**" />
<include name="legal/**" />
</fileset>
</copy>
<!-- It's the same excutable with different config files-->
<copy file="${dist-bin.dir}/rapla.exe" tofile="${dist-bin.dir}/raplaclient.exe"/>
<copy todir="${dist-bin.dir}">
<fileset dir="${main.dir}/templates/scripts">
<include name="raplaserver_*" />
</fileset>
<mapper type="glob" from="raplaserver_*" to="raplaserver.*" />
</copy>
<copy todir="${dist-bin.dir}">
<fileset dir="${main.dir}/templates/scripts">
<include name="raplaclient_*" />
</fileset>
<mapper type="glob" from="raplaclient_*" to="raplaclient.*" />
</copy>
<copy todir="${dist-bin.dir}">
<fileset dir="${main.dir}/templates/scripts">
<include name="rapla_*" />
</fileset>
<mapper type="glob" from="rapla_*" to="rapla.*" />
</copy>
<copy todir="${dist-bin.dir}">
<fileset dir="${main.dir}/templates/scripts">
<include name="raplaimport_*" />
</fileset>
<mapper type="glob" from="raplaimport_*" to="raplaimport.*" />
</copy>
<copy todir="${dist-bin.dir}">
<fileset dir="${main.dir}/templates/scripts">
<include name="raplaexport_*" />
</fileset>
<mapper type="glob" from="raplaexport_*" to="raplaexport.*" />
</copy>
<fixcrlf srcdir="${dist-bin.dir}" eol="crlf">
<include name="*.bat" />
</fixcrlf>
<fixcrlf srcdir="${dist-bin.dir}" eol="lf">
<include name="*.sh" />
</fixcrlf>
<chmod perm="u+x">
<fileset dir="${dist-bin.dir}">
<include name="*.sh" />
<include name="*.bat" />
</fileset>
</chmod>
</target>
<!-- =================================================================== -->
<!-- Create the source distribution -->
<!-- =================================================================== -->
<target name="dist-src" depends="prepare" description="Build the source distribution">
<mkdir dir="${dist-src.dir}" />
<copy todir="${dist-src.dir}/lib">
<fileset dir="${lib.dir}">
<include name="*.jar" />
<include name="common/**" />
<include name="server/**" />
<include name="ext/**" />
<include name="logging/**" />
<include name="test-only/junit*" />
</fileset>
</copy>
<copy todir="${dist-src.dir}">
<fileset dir="${main.dir}">
<include name="src/**" />
<include name="test-src/**" />
<include name="templates/**" />
<include name="legal/**" />
<include name="README**" />
<include name="INSTALL.txt" />
<include name="doc.properties" />
<include name=".project" />
<include name=".classpath" />
<include name="etc/**" />
<include name="bin/*" />
<include name="build.xml" />
<include name="buildplugin.xml" />
<include name="build.properties.template" />
<include name="build.sh" />
<include name="build.bat" />
<include name="war/**" />
<exclude name="war/WEB-INF/lib/**" />
<exclude name="war/WEB-INF/classes" />
<exclude name="war/WEB-INF/classes/**" />
<include name="resources/**" />
<include name="contexts/rapla-develop.xml" />
<include name="contexts/rapla.xml_" />
<include name="service/**" />
</fileset>
</copy>
<chmod perm="u+x">
<fileset dir="${dist-src.dir}">
<include name="**/*.bat" />
<include name="**/*.sh" />
<include name="bin/ant" />
<include name="bin/antRun" />
</fileset>
</chmod>
<fixcrlf srcdir="${dist-src.dir}" eol="crlf">
<include name="*.bat" />
</fixcrlf>
<fixcrlf srcdir="${dist-src.dir}" eol="lf">
<include name="*.sh" />
<include name="bin/ant" />
<include name="bin/antRun" />
</fixcrlf>
</target>
<!-- =================================================================== -->
<!-- Packages the distribution as .zip and tar.gz -->
<!-- =================================================================== -->
<target name="tarball">
<fixcrlf srcdir="${tarball.dir}" eol="lf" eof="remove">
<patternset refid="text-files" />
<include name="**/*.sh" />
<include name="**/ant" />
<include name="**/antRun" />
<exclude name="**/*.bat" />
</fixcrlf>
<tar tarfile="${dist.dir}/${tarball.name}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset dir="${tarball.dir}/..">
<!-- This is a workaround until tarfileset supports the prefix-->
<include name="${tarball.name}/**" />
<exclude name="${tarball.name}/**/*.sh" />
<exclude name="${tarball.name}/**/*.bat" />
<exclude name="${tarball.name}/**/ant" />
<exclude name="${tarball.name}/**/antRun" />
</tarfileset>
<tarfileset dir="${tarball.dir}/.." mode="755">
<include name="${tarball.name}/**/*.sh" />
<include name="${tarball.name}/**/*.bat" />
<include name="${tarball.name}/**/ant" />
<include name="${tarball.name}/**/antRun" />
</tarfileset>
</tar>
<fixcrlf srcdir="${tarball.dir}" eol="crlf">
<patternset refid="text-files" />
<exclude name="**/*.sh" />
<exclude name="**/ant" />
<exclude name="**/antRun" />
</fixcrlf>
<zip zipfile="${dist.dir}/${tarball.name}.zip">
<!-- This is a workaround until tarfileset supports the prefix-->
<zipfileset dir="${tarball.dir}" prefix="${tarball.name}" />
</zip>
<fixcrlf srcdir="${tarball.dir}">
<patternset refid="text-files" />
</fixcrlf>
</target>
<target name="tarballs" description="Generate all tarballs for download" depends="init,dist-bin,dist-src">
<antcall target="tarball">
<param name="tarball.name" value="rapla-binary-${doc.version}" />
<param name="tarball.dir" value="${dist-bin.dir}" />
</antcall>
<antcall target="tarball">
<param name="tarball.name" value="rapla-source-${doc.version}" />
<param name="tarball.dir" value="${dist-src.dir}" />
</antcall>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadocs" depends="prepare" description="Generate the API documentation">
<!-- Filter-Information for the java-doc generator and the rapla-language-files-->
<delete dir="${build.src}" />
<mkdir dir="${build.src}" />
<mkdir dir="${build.javadocs}" />
<copy todir="${build.src}">
<fileset dir="${src.dir}">
<include name="**/*.java" />
<include name="**/package.html" />
<include name="**/overview.html" />
</fileset>
<filterset refid="docfilter" />
</copy>
<copy file="${src.dir}/org/rapla/gui/images/tafel.png" tofile="${build.javadocs}/logo.png" />
<javadoc packagenames="${packages}" destdir="${build.javadocs}" author="true" version="true" use="false" noindex="true" windowtitle="${doc.name} API (${doc.version})" bottom="Copyright © ${doc.year} ${doc.copyright}. All Rights Reseserved." overview="${build.src}/org/rapla/overview.html">
<packageset dir="${build.src}" defaultexcludes="yes">
<include name="org/rapla" />
<include name="org/rapla/bootstrap" />
<include name="org/rapla/facade" />
<include name="org/rapla/entities" />
<include name="org/rapla/entities/domain" />
<include name="org/rapla/entities/dynamictype" />
<include name="org/rapla/entities/configuration" />
<include name="org/rapla/framework" />
<include name="org/rapla/framework/logger" />
<include name="org/rapla/examples" />
<include name="org/rapla/components/xmlbundle" />
<include name="org/rapla/components/util" />
<include name="org/rapla/components/util/undo" />
<include name="org/rapla/components/util/iterator" />
<include name="org/rapla/components/calendar" />
<include name="org/rapla/components/iolayer" />
<include name="org/rapla/components/layout" />
<include name="org/rapla/components/tablesorter" />
<include name="org/rapla/plugin" />
<include name="org/rapla/plugin/mail" />
<include name="org/rapla/plugin/tableview" />
<include name="org/rapla/gui" />
<include name="org/rapla/gui/images" />
<include name="org/rapla/gui/toolkit" />
<include name="org/rapla/client" />
<include name="org/rapla/server" />
<include name="org/rapla/servletpages" />
<include name="org/rapla/examples" />
<include name="org/rapla/entities" />
<exclude name="**/internal/**" />
<exclude name="**/impl/**" />
<exclude name="**/print/**" />
</packageset>
<classpath>
<fileset dir="${lib.dir}">
<patternset refid="default-runtime-libs" />
</fileset>
</classpath>
<link href="http://docs.oracle.com/javase/7/docs/api/" />
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Test -->
<!-- =================================================================== -->
<target name="compile-tests" depends="prepare,compile,compile-resources,generate-plugin-meta">
<mkdir dir="${build.dest.test}" />
<javac srcdir="${testsrc.dir}" destdir="${build.dest.test}" debug="${debug}" source="${target_vm}" target="${target_vm}" optimize="${optimize}" deprecation="${deprecation}" includeAntRuntime="false">
<classpath>
<fileset dir="${lib.dir}">
<patternset refid="default-runtime-libs" />
</fileset>
<pathelement path="${build.dest.main}" />
</classpath>
</javac>
</target>
<target name="check-test" unless="test.class">
<echo message="You must specify a test.class. Example: build -Dtest.class=mypackage.MyTest test " />
</target>
<target name="test" if="test.class" description="Run one JUnit-Test" depends="compile-tests,check-test">
<junit printsummary="no" haltonfailure="yes" fork="yes" dir="${main.dir}">
<classpath>
<pathelement path="${build.dest.main}" />
<pathelement path="${main.dir}/resources" />
<pathelement path="${build.dest.test}" />
<fileset dir="${lib.dir}">
<patternset refid="default-runtime-libs" />
</fileset>
</classpath>
<formatter type="plain" usefile="no" />
<test name="${test.class}" />
</junit>
<echo message="Tests complete" />
</target>
<target name="test-all" description="Run all JUnit-Tests" depends="clean-test,compile-tests">
<junit printsummary="no" haltonfailure="yes" fork="yes" dir="${main.dir}">
<classpath>
<pathelement path="${build.dest.main}" />
<pathelement path="${main.dir}/resources" />
<pathelement path="${build.dest.test}" />
<fileset dir="${lib.dir}">
<patternset refid="default-runtime-libs" />
</fileset>
</classpath>
<formatter type="plain" usefile="no" />
<batchtest>
<fileset dir="${build.dest.test}">
<include name="**/*Test.class" />
<exclude name="**/*$$*Test.class" />
<exclude name="**/Abstract**.class" />
</fileset>
</batchtest>
</junit>
<echo message="Tests complete" />
</target>
<!-- ===================================================================
Tests the build-process of the binary and the source-distribution.
Performs the following steps:
1. clean the test directory
2. build a source-distribution in the test directory
3. start the test (target test-all)
4. build a binary-distribution out of the source-distribution
5. start the binary-distribution and test for exceptions
6. clean the test dir
=================================================================== -->
<target name="test-build" description="Tests the build-process of the binary and the source-distribution" depends="init">
<delete dir="${test.dir}" />
<mkdir dir="${test.dir}" />
<mkdir dir="${test-dist-src.dir}" />
<ant antfile="build.xml" target="dist-src">
<property name="dist-src.dir" value="${test-dist-src.dir}" />
</ant>
<ant antfile="${test-dist-src.dir}/build.xml" target="test-all" dir="${test-dist-src.dir}" inheritAll="false">
<property name="main.dir" value="${test-dist-src.dir}" />
</ant>