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
|
<?xml version="1.0"?>
<project name="IT Mill Toolkit" basedir="../" default="package-all">
<!-- Package creation - - - - - - - - - - - - - - - - - - - - - - - - -
When creating release use only "package-*" targets:
package-all
* creates four release packages for three three platforms (below)
package-windows
* itmill-toolkit-windows-<version>.zip
package-linux
* itmill-toolkit-linux-<version>.tar.bz2
package-mac
* itmill-toolkit-mac-<version>.tar.gz
* itmill-toolkit-mac-<version>.dmg
NOTE: This build script requires directories named build/gwt/(linux|windows|mac) .
You must unpack platform specific binaries under linux, windows and mac directories.
build/gwt/(linux|windows|mac) are used for
a) compile WebContent/ITMILL/widgetsets
b) creating platform specific release ZIP/TGZ packages.
-->
<!--
Call one of package-* targets unless you understand what you are doing
-->
<target name="package-all" depends="clean-all, init, build, docs, internal-package-mac, internal-package-windows, internal-package-linux" description="Build public packages for Windows, Linux and Mac platforms.">
</target>
<target name="package-mac" depends="clean-all, init, build, docs, internal-package-mac" description="Create public tar.gz package for Mac.">
</target>
<target name="package-windows" depends="clean-all, init, build, docs, internal-package-windows" description="Create public ZIP package for Windows.">
</target>
<target name="package-linux" depends="clean-all, init, build, docs, internal-package-linux" description="Create public tar.bz2 package for Linux.">
</target>
<target name="package-jar-war" depends="clean-all, init, build" description="Create itmill-toolkit-x.y.z.jar and war file.">
</target>
<!-- internal tests for packaging -->
<target name="test-build" depends="clean-all, init, build" description="used for testing build.xml">
</target>
<target name="test-package" depends="init" description="used for testing build.xml">
<echo>Creating package for Mac platform.</echo>
<var name="package-platform" value="mac" />
<!-- TODO: on Mac Leopard, we should not use -XstartOnFirstThread -->
<var name="eclipse-launch-vmargs" value="-XstartOnFirstThread -Xms128M -Xmx512M" />
<antcall target="add-platform-specific-files" inheritAll="true" inheritRefs="true" />
<exec executable="ln" failonerror="false">
<arg line="-s" />
<arg line="${output-dir}" />
<arg line="${result-path}/eclipse-test" />
</exec>
<exec executable="ln" failonerror="false">
<arg line="-s" />
<arg line="${basedir}/build/gwt/${package-platform}" />
<arg line="${output-dir}/gwt" />
</exec>
</target>
<!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="clean-all" depends="">
<property file="build/build.properties" />
<delete dir="${result-path}" includes="**/*" followsymlinks="false" defaultexcludes="false" includeemptydirs="true" failonerror="false">
</delete>
</target>
<!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="init">
<property file="build/build.properties" />
<property file="build/VERSION.properties" />
<property file="build/html-style.properties" />
<!-- Create result dir unless already exists -->
<mkdir dir="${result-path}" />
<!-- Find out which platform we are in -->
<if>
<equals arg1="${os.name}" arg2="Windows 2000, Windows XP" />
<then>
<property name="platform" value="windows" />
</then>
</if>
<if>
<equals arg1="${os.name}" arg2="Linux" />
<then>
<property name="platform" value="linux" />
</then>
</if>
<if>
<equals arg1="${os.name}" arg2="Mac OS X" />
<then>
<property name="platform" value="mac" />
</then>
</if>
<!-- required when compiling WebContent/ITMILL/widgetsets (and also Java server-side classes) -->
<property name="lib-gwt-dev" value="gwt-dev-${platform}.jar" />
<echo>We are on ${platform} platform, using build/gwt/${platform}/${lib-gwt-dev}.</echo>
<!-- Destination files -->
<property name="lib-jar-name" value="${product-file}-${version}.jar" />
<property name="demo-war-name" value="${product-file}-demo-${version}.war" />
<echo message="Prepared to build ${product-file} version ${version} packages" />
<!-- Output directory -->
<property name="output-dir" value="${result-path}/${product-file}-${version}" />
<mkdir dir="${output-dir}" />
<!-- Create Output Directory Hierarchy -->
<mkdir dir="${output-dir}/doc/manual" />
<mkdir dir="${output-dir}/doc/api" />
<mkdir dir="${output-dir}/lib" />
<mkdir dir="${output-dir}/WebContent" />
<mkdir dir="${output-dir}/WebContent/WEB-INF" />
<mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />
<mkdir dir="${output-dir}/WebContent/doc" />
<mkdir dir="${output-dir}/WebContent/doc/demo-source" />
<!-- Construct classpath used by java and javadoc compilation -->
<path id="compile.classpath">
<pathelement path="build/gwt/${platform}/gwt-user.jar" />
<pathelement path="build/gwt/${platform}/${lib-gwt-dev}" />
<pathelement path="build/external/fileupload/classes" />
<pathelement path="lib/reservr/googlemaps_gwt.jar" />
<pathelement path="lib/jetty/jetty-6.1.5.jar" />
<pathelement path="lib/jetty/jetty-util-6.1.5.jar" />
<pathelement path="lib/jetty/servlet-api-2.5-6.1.5.jar" />
</path>
</target>
<target name="internal-package-windows">
<echo>Creating package for Windows platform.</echo>
<var name="package-platform" value="windows" />
<var name="eclipse-launch-vmargs" value="-Xms256M -Xmx512M" />
<antcall target="add-platform-specific-files" inheritAll="true" inheritRefs="true" />
<zip zipfile="${result-path}/${product-file}-${package-platform}-${version}.zip">
<zipfileset prefix="${product-file}-${package-platform}-${version}" dir="${result-path}/${product-file}-${version}">
<patternset>
<include name="**/*" />
</patternset>
</zipfileset>
<zipfileset prefix="${product-file}-${package-platform}-${version}/gwt" dir="build/gwt/windows">
<patternset>
<include name="**/*" />
</patternset>
</zipfileset>
</zip>
</target>
<target name="internal-package-linux">
<echo>Creating package for Linux platform.</echo>
<var name="package-platform" value="linux" />
<var name="eclipse-launch-vmargs" value="-Xms256M -Xmx512M" />
<antcall target="add-platform-specific-files" inheritAll="true" inheritRefs="true" />
<tar destfile="${result-path}/${product-file}-${package-platform}-${version}.tar.gz" compression="gzip" longfile="gnu">
<!-- TODO use very slow but effective bzip2
<tar destfile="${result-path}/${product-file}-${package-platform}-${version}.tar.bz2" compression="bzip2" longfile="gnu">
-->
<tarfileset prefix="${product-file}-${package-platform}-${version}" dir="${result-path}/${product-file}-${version}">
<patternset>
<include name="**/*" />
</patternset>
</tarfileset>
<tarfileset prefix="${product-file}-${package-platform}-${version}/gwt" dir="build/gwt/linux">
<patternset>
<include name="**/*" />
</patternset>
</tarfileset>
</tar>
</target>
<target name="internal-package-mac">
<echo>Creating package for Mac platform.</echo>
<var name="package-platform" value="mac" />
<var name="eclipse-launch-vmargs" value="-XstartOnFirstThread -Xms256M -Xmx512M" />
<antcall target="add-platform-specific-files" inheritAll="true" inheritRefs="true" />
<tar destfile="${result-path}/${product-file}-${package-platform}-${version}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset prefix="${product-file}-${package-platform}-${version}" dir="${result-path}/${product-file}-${version}">
<patternset>
<include name="**/*" />
</patternset>
</tarfileset>
<tarfileset prefix="${product-file}-${package-platform}-${version}/gwt" dir="build/gwt/mac">
<patternset>
<include name="**/*" />
</patternset>
</tarfileset>
</tar>
<!-- TODO: remove me: DISABLED for speed
<antcall target="create-mac-diskimage" inheritAll="true" inheritRefs="true" />
-->
</target>
<target name="create-mac-diskimage">
<!-- create Mac disk image (dmg) also -->
<property name="mount.dir" value="${result-path}/mac-mounted-image" />
<mkdir dir="${mount.dir}" />
<delete file="${result-path}/*.dmg" />
<if>
<equals arg1="${platform}" arg2="mac" />
<then>
<untar src="${result-path}/${product-file}-${package-platform}-${version}.tar.gz" dest="${result-path}/" compression="gzip" />
<echo>Creating Mac disk image (dmg)</echo>
<!-- create image -->
<echo>hdiutil create -format UDRW -volname ${product-file}-${version} -srcfolder ${result-path}/${product-file}-${package-platform}-${version} ${result-path}/disk-image.dmg</echo>
<exec executable="hdiutil" failonerror="true">
<arg line="create -format UDRW -volname ${product-file}-${version} -srcfolder ${result-path}/${product-file}-${package-platform}-${version} ${result-path}/disk-image.dmg" />
</exec>
<!-- open image -->
<exec executable="hdiutil" failonerror="true">
<arg line='attach' />
<arg line='-readwrite' />
<arg line='-noverify' />
<arg line='-noautoopen' />
<arg line='-mountpoint ${mount.dir}' />
<arg line='${result-path}/disk-image.dmg' />
</exec>
<!-- make sure root folder is opened when image is -->
<exec executable="bless" failonerror="true">
<arg line='--folder ${mount.dir}' />
<arg line='--openfolder ${mount.dir}' />
</exec>
<!-- hack: wait for completion -->
<exec executable="sleep" failonerror="true">
<arg line='2' />
</exec>
<!-- here we could position items -->
<!--
<exec executable="osascript" failonerror="true">
<arg line='package/positionItems.scpt ${mount.dir}' />
</exec>
-->
<!-- turn on volume icon -->
<exec executable="/Developer/Tools/SetFile" failonerror="true">
<arg line='-a C' />
<arg line='${mount.dir}' />
</exec>
<!-- set executable bit -->
<chmod file="${mount.dir}/start-demo.sh" perm="ugo+x" />
<!-- close image -->
<exec executable="hdiutil" failonerror="true">
<arg line='detach ${mount.dir}/' />
</exec>
<!-- make read-only -->
<exec executable="hdiutil" failonerror="true">
<arg line='convert ${result-path}/disk-image.dmg' />
<arg line='-format UDZO' />
<arg line='-imagekey zlib-level=9' />
<arg line='-o ${result-path}/${product-file}-${package-platform}-${version}.dmg' />
</exec>
<delete file="${result-path}/disk-image.dmg" />
<!-- internet-enable -->
<exec executable="hdiutil" failonerror="true">
<arg line='internet-enable ${result-path}/${product-file}-${package-platform}-${version}.dmg' />
</exec>
</then>
</if>
</target>
<target name="add-platform-specific-files">
<delete includeemptydirs="true" defaultexcludes="false">
<fileset dir="${output-dir}">
<include name="start-demo.*" />
<include name=".project" />
<include name=".classpath" />
<include name="*.launch" />
</fileset>
</delete>
<copy todir="${output-dir}">
<filterchain>
<expandproperties />
<!-- .classpath, *.launch, build-widgetsets.xml -->
<replacetokens begintoken="<" endtoken=">">
<token key="version" value="${version}" />
<token key="/version" value="" />
</replacetokens>
<!-- .classpath -->
<replacetokens begintoken="<" endtoken=">">
<token key="platform-specific-entries" value="<classpathentry kind="lib" path="gwt/gwt-dev-${package-platform}.jar" />" />
<token key="/platform-specific-entries" value="" />
</replacetokens>
<!-- .classpath, HostedMode.launch, build-widgetsets.xml -->
<replacetokens begintoken="<" endtoken=">">
<token key="platform" value="${package-platform}" />
<token key="/platform" value="" />
</replacetokens>
<!-- .project, *.launch -->
<replacetokens begintoken="<" endtoken=">">
<token key="eclipse-workspace-name" value="${eclipse-workspace-name}" />
<token key="/eclipse-workspace-name" value="" />
</replacetokens>
<!-- HostedMode.launch -->
<replacetokens begintoken="<" endtoken=">">
<token key="eclipse-launch-vmargs" value="${eclipse-launch-vmargs}" />
<token key="/eclipse-launch-vmargs" value="" />
</replacetokens>
</filterchain>
<fileset dir="build/package">
<include name="eclipse-classpath" />
<include name="eclipse-project" />
<include name="eclipse*launch" />
<include name="build-widgetsets.xml" />
</fileset>
</copy>
<move file="${output-dir}/eclipse-classpath" tofile="${output-dir}/.classpath" />
<move file="${output-dir}/eclipse-project" tofile="${output-dir}/.project" />
<move file="${output-dir}/eclipse-IT Mill Toolkit Hosted Mode-launch" tofile="${output-dir}/IT Mill Toolkit Hosted Mode.launch" />
<move file="${output-dir}/eclipse-IT Mill Toolkit Web Mode-launch" tofile="${output-dir}/IT Mill Toolkit Web Mode.launch" />
<if>
<equals arg1="${package-platform}" arg2="windows" />
<then>
<copy todir="${output-dir}">
<fileset dir="build/package">
<include name="start-demo.bat" />
</fileset>
</copy>
</then>
</if>
<if>
<equals arg1="${package-platform}" arg2="linux" />
<then>
<copy todir="${output-dir}">
<fileset dir="build/package">
<include name="start-demo.sh" />
</fileset>
</copy>
<chmod file="${output-dir}/start-demo.sh" perm="ugo+x" />
</then>
</if>
<if>
<equals arg1="${package-platform}" arg2="mac" />
<then>
<copy todir="${output-dir}">
<fileset dir="build/package">
<include name="start-demo.sh" />
<include name=".VolumeIcon.icns" />
<include name=".DS_Store" />
</fileset>
</copy>
<!-- TODO: this does not work, why? -->
<chmod file="${output-dir}/start-demo.sh" perm="ugo+x" />
</then>
</if>
</target>
<target name="build" depends="root, demo" description="Build package required files, without packing them.">
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Add and filter root files
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="root">
<copy todir="${output-dir}/license">
<fileset dir="license">
<filename name="*.pdf" />
</fileset>
</copy>
<copy todir="${output-dir}">
<filterchain>
<expandproperties />
<replacetokens begintoken="<" endtoken=">">
<token key="version" value="${version}" />
<token key="/version" value="" />
</replacetokens>
</filterchain>
<fileset dir="">
<filename name="release-notes.html" />
</fileset>
</copy>
<copy todir="${output-dir}">
<filterchain>
<expandproperties />
<replacetokens begintoken="<" endtoken=">">
<token key="body" value="${html.body.tag}${html.body.start1}${product-name}${html.body.start2}" />
<token key="/body" value="${html.body.end}${html.body.endtag}" />
<token key="version" value="${version}" />
<token key="/version" value="" />
</replacetokens>
</filterchain>
<fileset dir="">
<exclude name="**/.svn" />
<exclude name="release-notes.html" />
<include name="*.html" />
<include name="*.txt" />
<include name="license/*.html" />
</fileset>
</copy>
<!-- copy 3rd part libraries used by demo -->
<copy todir="${output-dir}/lib/demo">
<fileset dir="lib">
<include name="reservr/**/*" />
</fileset>
</copy>
<copy todir="${output-dir}/lib">
<fileset dir="lib">
<include name="jetty/**/*" />
</fileset>
</copy>
</target>
<!-- Copy and preprocess sources for packaging
NOTE: Replaces <version></version> tags with build version tag for some "textual" files
-->
<target name="preprocess-src">
<mkdir dir="${result-path}/src" />
<echo>Copying src directory and processing copied files.</echo>
<echo>Replacing <version> tag with build version for java/html/css/xml files.</echo>
<copy todir="${result-path}/src">
<filterset>
<filter token="VERSION" value="${version}" />
</filterset>
<fileset dir="src">
<patternset>
<include name="**/*.java" />
<include name="**/*.html" />
<include name="**/*.css" />
<include name="**/*.xml" />
</patternset>
</fileset>
</copy>
<!-- Unify mix usage of mac/Linux/Win characters -->
<echo>Unifying mix usage of Mac/Linux/Win linefeeds for java/html/css/xml files.</echo>
<fixcrlf srcdir="${result-path}/src" eol="crlf" tablength="4" tab="asis" includes="**/*.java **/*.html **/*.css **/*.xml" />
<!-- Add other files such as images, these are not filtered or processed by fixcrlf task -->
<echo>Copying non java/html/css/xml files such as images.</echo>
<copy todir="${result-path}/src">
<fileset dir="src">
<patternset>
<exclude name="**/.svn" />
<exclude name="**/*.java" />
<exclude name="**/*.html" />
<exclude name="**/*.css" />
<exclude name="**/*.xml" />
</patternset>
</fileset>
</copy>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
WebContent
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="webcontent" depends="preprocess-src">
<!-- Add demo sources -->
<echo>Adding demo sources to WebContent/WEB-INF/src</echo>
<copy todir="${output-dir}/WebContent/WEB-INF/src">
<fileset dir="${result-path}/src">
<include name="${toolkit-package}/demo/**/*" />
</fileset>
</copy>
<echo>Creating demo source html files</echo>
<java2html srcdir="${output-dir}/WebContent/WEB-INF/src/${toolkit-package}/demo" destdir="${output-dir}/WebContent/doc/demo-source/${toolkit-package}/demo" includes="**/*.java" style="eclipse" showLineNumbers="false" showFileName="true" showTableBorder="false" />
<!-- Add WebContent -->
<echo>Adding WebContent files, excluding ITMILL/widgetsets and few internal development libraries.</echo>
<copy todir="${output-dir}/WebContent">
<fileset dir="WebContent">
<exclude name="**/.svn" />
<exclude name="openajax/**" />
<exclude name="index.html" />
<exclude name="WEB-INF/web.xml" />
<exclude name="ITMILL/widgetsets/**" />
<exclude name="WEB-INF/lib/commons-fileupload-custom.jar" />
<exclude name="ITMILL/themes/test*/**" />
<exclude name="WEB-INF/classes/**" />
</fileset>
</copy>
<copy file="build/package/webcontent-index.html" tofile="${output-dir}/WebContent/index.html" />
<copy file="build/package/web.xml" tofile="${output-dir}/WebContent/WEB-INF/web.xml" />
</target>
<target name="compile-fileupload">
<echo>Compiling custom fileupload classes.</echo>
<ant dir="build/external/fileupload" antfile="build.xml" target="compile" />
</target>
<target name="compile-java" depends="compile-fileupload, webcontent">
<echo>Compiling src (server-side)</echo>
<!-- Compile -->
<mkdir dir="${result-path}/classes" />
<javac source="1.4" target="1.4" classpathref="compile.classpath" srcdir="${result-path}/src" destdir="${result-path}/classes" includes="${toolkit-package}/**" debug="true">
</javac>
</target>
<target name="compile-client-side" depends="webcontent">
<echo>Compiling src (client-side)</echo>
<echo>com.itmill.toolkit.terminal.gwt.DefaultWidgetSet</echo>
<java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
<arg value="-out" />
<arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
<arg value="com.itmill.toolkit.terminal.gwt.DefaultWidgetSet" />
<arg value="-style" />
<arg value="OBF" />
<classpath>
<pathelement location="build/gwt/${platform}/gwt-user.jar" />
<pathelement location="build/gwt/${platform}/${lib-gwt-dev}" />
<pathelement location="${result-path}/src" />
</classpath>
</java>
<echo>com.itmill.toolkit.demo.reservation.gwt.ReservationWidgetSet</echo>
<java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
<arg value="-out" />
<arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
<arg value="com.itmill.toolkit.demo.reservation.gwt.ReservationWidgetSet" />
<arg value="-style" />
<arg value="OBF" />
<classpath>
<pathelement location="build/gwt/${platform}/gwt-user.jar" />
<pathelement location="build/gwt/${platform}/${lib-gwt-dev}" />
<pathelement location="${result-path}/src" />
<!-- demo jars -->
<pathelement location="${output-dir}/lib/demo/reservr/googlemaps_gwt.jar" />
<!-- demo widgetset sources -->
<pathelement path="${output-dir}/WebContent/WEB-INF/src" />
</classpath>
</java>
<echo>com.itmill.toolkit.demo.colorpicker.gwt.ColorPickerWidgetSet</echo>
<java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
<arg value="-out" />
<arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
<arg value="com.itmill.toolkit.demo.colorpicker.gwt.ColorPickerWidgetSet" />
<arg value="-style" />
<arg value="OBF" />
<classpath>
<pathelement location="build/gwt/${platform}/gwt-user.jar" />
<pathelement location="build/gwt/${platform}/${lib-gwt-dev}" />
<pathelement location="${result-path}/src" />
<!-- demo widgetset sources -->
<pathelement path="${output-dir}/WebContent/WEB-INF/src" />
</classpath>
</java>
</target>
<target name="libs" depends="compile-java, compile-client-side">
<echo>Creating libs (server-side)</echo>
<!-- Create Toolkit JAR -->
<jar jarfile="${output-dir}/lib/${lib-jar-name}" compress="true">
<fileset dir="${result-path}/classes">
<patternset>
<exclude name="${toolkit-package}/demo/**" />
<exclude name="${toolkit-package}/tests/**" />
<exclude name="${toolkit-package}/launcher/**" />
</patternset>
</fileset>
<!-- fileupload, see build/external/fileupload/build.xml -->
<fileset dir="build/external/fileupload/classes">
<include name="**/*" />
</fileset>
<!-- add sources -->
<fileset dir="${result-path}/src">
<patternset>
<exclude name="${toolkit-package}/demo/**" />
<exclude name="${toolkit-package}/tests/**" />
<exclude name="${toolkit-package}/launcher/**" />
</patternset>
</fileset>
<fileset dir="${output-dir}/WebContent">
<patternset>
<include name="ITMILL/widgetsets/com.itmill.toolkit.terminal.gwt.DefaultWidgetSet/**/*" />
</patternset>
</fileset>
</jar>
</target>
<!-- Demo - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="demo" depends="libs, javadoc">
<echo>Building demo</echo>
<echo>Adding demo class files.</echo>
<copy todir="${output-dir}/WebContent/WEB-INF/classes">
<fileset dir="${result-path}/classes">
<include name="${toolkit-package}/demo/**/*" />
<!-- user might want to tweak launcher classes -->
<include name="${toolkit-package}/launcher/**" />
</fileset>
</copy>
<echo>Adding (duplicating) Toolkit JAR to WebContent/WEB-INF/lib</echo>
<copy todir="${output-dir}/WebContent/WEB-INF/lib">
<fileset dir="${output-dir}/lib">
<include name="${lib-jar-name}" />
</fileset>
</copy>
<echo>Adding (duplicating) source for demo</echo>
<copy todir="${output-dir}/WebContent/WEB-INF/src">
<fileset dir="${result-path}/src">
<include name="${toolkit-package}/demo/**/*" />
<!-- user might want to tweak launcher classes -->
<include name="${toolkit-package}/launcher/**" />
</fileset>
</copy>
<echo>Adding (duplicating) javadocs for demo</echo>
<copy todir="${output-dir}/WebContent/doc">
<fileset dir="${output-dir}/doc">
<include name="api/**/*" />
</fileset>
</copy>
<echo>Building WAR</echo>
<war warfile="${output-dir}/lib/${product-file}.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir="${output-dir}/WebContent">
<exclude name="WEB-INF/web.xml" />
<include name="**/*" />
</fileset>
<lib dir="${output-dir}/lib">
<include name="${lib-jar-name}" />
</lib>
<!-- All javadoc (demos link to these)-->
<fileset dir="${output-dir}">
<include name="doc/api/**/*" />
</fileset>
<!-- All sources (demos link to these)-->
<fileset dir="${result-path}/src">
<include name="**/*" />
</fileset>
</war>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Documentation
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="docs" depends="javadoc,manual-pdf,manual-html,package-docs">
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Documentation: Add documentation including style files
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="package-docs">
<copy todir="${output-dir}/doc/manual/html-style">
<fileset dir="doc/manual/html-style">
<exclude name="**/.svn" />
<exclude name="**/test.html" />
</fileset>
</copy>
<copy todir="${output-dir}/doc">
<fileset dir="doc">
<exclude name="**/.svn" />
<include name="dtd/**/*.dtd" />
</fileset>
</copy>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Documentation: Add Javadoc to doc
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="javadoc" depends="preprocess-src">
<javadoc destdir="${output-dir}/doc/api" author="true" version="true" use="true" windowtitle="${product-name}" classpathref="compile.classpath">
<packageset dir="${result-path}/src">
<include name="${toolkit-package}/**" />
<exclude name="${toolkit-package}/demo/**" />
<exclude name="${toolkit-package}/tests/**/*" />
</packageset>
<doctitle>${javadoc.doctitle}</doctitle>
<!-- <header><![CDATA[<script type="text/javascript" src=".html-style/style.js"></script>]]></header> -->
<bottom>${javadoc.bottom}</bottom>
<link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc="build/javadoc/j2se-1.5.0" />
<link offline="true" href="http://java.sun.com/j2ee/1.4/docs/api/" packagelistLoc="build/javadoc/j2ee-1.4" />
</javadoc>
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Documentation: Add book part 2 (TBD)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="book-part2" depends="dbdoclet">
<!-- TODO Add XSLT to transform dbdoclet results to book part 2 -->
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Documentation: Add manual
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="dbdoclet" depends="preprocess-src">
<echo>Manual: DocBookDoclet</echo>
<javadoc access="public" charset="UTF-8" docencoding="UTF-8" encoding="ISO-8859-15" failonerror="yes" classpath="build/lib/servlet-api.jar" maxmemory="512m" source="1.5">
<packageset dir="${result-path}/src">
<include name="${toolkit-package}/**" />
<exclude name="${toolkit-package}/demo/**" />
<exclude name="${toolkit-package}/tests/**/*" />
</packageset>
<doclet name="org.dbdoclet.doclet.docbook.DocBookDoclet" path="build/lib/jdk${java.specification.version}/dbdoclet.jar">
<param name="-d" value="result/docbook" />
</doclet>
</javadoc>
</target>
<!-- XEP-based FO building -->
<target name="manual-pdf">
<echo>PDF Manual: processing images (TBD)</echo>
<!-- TBD -->
<echo>PDF Manual: converting xml to fo</echo>
<java classname="org.apache.xalan.xslt.Process" failonerror="yes" fork="yes" maxmemory="512m">
<arg value="-xsl" />
<arg value="build/docbook/conf/custom-fo-docbook.xsl" />
<arg value="-in" />
<arg value="doc/manual/book.xml" />
<arg value="-out" />
<arg value="${result-path}/book.fo" />
<arg value="-param" />
<arg value="section.autolabel" />
<arg value="1" />
<arg value="-param" />
<arg value="section.label.includes.component.label" />
<arg value="1" />
<arg value="-param" />
<arg value="section.autolabel.max.depth" />
<arg value="2" />
<arg value="-param" />
<arg value="draft.watermark.image" />
<arg value="''" />
<arg value="-param" />
<arg value="draft.mode" />
<arg value="'no'" />
<classpath>
<pathelement location="build/lib/xalan.jar" />
<pathelement location="build/lib/xercesImpl.jar" />
<pathelement location="build/lib/xml-apis.jar" />
</classpath>
</java>
<echo>PDF Manual: converting fo to pdf</echo>
<!-- Run XEP FO processor to convert FO to PDF -->
<java classname="com.renderx.xep.XSLDriver" error="${result-path}/xep-error.log" failonerror="yes" fork="yes" maxmemory="512m" input="${result-path}/book.fo" output="${output-dir}/doc/manual.pdf">
<arg value="-Dcom.renderx.xep.CONFIG=build/lib/XEP/xep.xml" />
<classpath>
<pathelement location="build/lib/XEP/lib/tools.jar" />
<pathelement location="build/lib/XEP/lib/xep.jar" />
<pathelement location="build/lib/XEP/lib/saxon.jar" />
<pathelement location="build/lib/XEP/lib/xt.jar" />
</classpath>
</java>
</target>
<target name="manual-html">
<echo>Manual: HTML</echo>
<delete file="build/docbook/conf/temp.xsl" />
<copy file="build/docbook/conf/custom-html-docbook.xsl" tofile="build/docbook/conf/temp.xsl">
<filterchain>
<replacetokens>
<token key="BODYHEADER" value="${html.body.start1}${docbook.head.title}${html.body.start2}" />
<token key="BODYFOOTER" value="${html.body.end}" />
</replacetokens>
</filterchain>
</copy>
<path id="docbook-xsl.classpath">
<pathelement path="build/lib/fserializer.jar" />
<pathelement path="build/lib/xalan.jar" />
<pathelement path="build/lib/xercesImpl.jar" />
<pathelement path="build/lib/xml-apis.jar" />
</path>
<java classname="org.apache.xalan.xslt.Process" failonerror="yes" fork="yes" maxmemory="1300m">
<arg value="-in" />
<arg value="doc/manual/book.xml" />
<arg value="-xsl" />
<arg value="build/docbook/conf/temp.xsl" />
<arg value="-out" />
<arg value="${output-dir}/doc/manual/index.html" />
<arg value="-param" />
<arg value="use.extensions" />
<arg value="1" />
<classpath refid="docbook-xsl.classpath" />
</java>
<delete file="build/docbook/conf/temp.xsl" />
<copy todir="${output-dir}/doc/manual/img">
<fileset dir="doc/manual/img">
<exclude name="**/.svn" />
</fileset>
</copy>
</target>
<!-- ant contrib required for flow control (for loop, if, property override) -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="build/lib/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<!-- java2html converter -->
<taskdef name="java2html" classname="de.java2html.anttasks.Java2HtmlTask" classpath="build/lib/java2html.jar" />
</project>
|