summaryrefslogtreecommitdiffstats
path: root/build/build.xml
blob: 0fe17a5b732a0990d331a67bde2c095a3bf5b9fe (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
<?xml version="1.0"?>

<project xmlns:antcontrib="antlib:net.sf.antcontrib"
         xmlns:artifact="antlib:org.apache.maven.artifact.ant"
         xmlns:ivy="antlib:org.apache.ivy.ant"
         name="Vaadin"
         basedir="../" default="package-all">

	<property name="project.root" value="."/>
    <!-- Import common targets  -->
    <import file="./common.xml" />

    <!--Call one of package-* targets unless you understand what you are doing. -->
    <target name="package-all" depends="clean-all, init, build, javadoc, internal-package-war, internal-package-liferay, differences" description="Build public packages.">
    </target>

    <target name="package-jar" depends="clean-result, init, vaadin.jar" description="Create vaadin-x.y.z.jar file.">
    </target>

    <target name="package-war" depends="clean-result, init, build, javadoc, internal-package-war, differences">
    </target>

    <target name="package-liferay-zip" depends="clean-result, init, build, internal-package-liferay">
    </target>
	
    <target name="init-deps" depends="common.init-deps" >
        <property name="ivy.resolved" value="1" />
        <ivy:resolve file="build/ivy/ivy.xml" resolveid="common" conf="ss.compile, cs.compile, ss.test.compile"/>
        <ivy:cachepath pathid="compile.classpath.server-side" conf="ss.compile"/>
        <ivy:cachepath pathid="compile.classpath.client-side" conf="cs.compile"/>
        <ivy:cachepath pathid="compile.classpath.server-side-tests" conf="ss.test.compile"/>
    </target>

    <!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - -->
    <target name="clean-result" depends="build.properties">

        <!-- Clean build result directory. -->
        <delete dir="${result-path}" includes="**/*" followsymlinks="false" defaultexcludes="false" includeemptydirs="true" failonerror="false"/>
    </target>

	<target name="build.properties">
        <property file="build/build.properties" />
		
        <property file="build/VERSION.properties" />
        <property file="build/GWT-VERSION.properties" />

		<!-- result source and classes folders -->
		<property name="result-src-core" value="${result-path}/src/core"/>
		<property name="result-src-junit" value="${result-path}/src/junit"/>
		<property name="result-src-testbench" value="${result-path}/src/testbench"/>
		<property name="result-classes-core" value="${result-path}/classes/core"/>
		<property name="result-classes-junit" value="${result-path}/classes/junit"/>
		<property name="result-classes-testbench" value="${result-path}/classes/testbench"/>
		<!-- Folder where Emma instrumented classes are placed (if Emma is used)-->
		<property name="result-classes-core-for-emma-war" value="${result-path}/classes/emma-war"/>
		<property name="result-classes-core-for-emma-junit" value="${result-path}/classes/emma-junit"/>

	</target>
    <target name="clean-all" depends="clean-result">
    </target>

    <!-- ================================================================== -->
    <!-- Check versions.                                                    -->
    <!-- ================================================================== -->

    <!-- Java compiler version. -->
    <target name="check-java-version">
      <condition property="java.version.matches">
        <or>
          <equals arg1="${ant.java.version}" arg2="1.5"/>
          <isset property="ignoreversion"/>
        </or>
      </condition>
      <fail unless="java.version.matches" message="Java version is ${ant.java.version}, but Vaadin must be compiled with genuine Java 1.5 compiler. Use -Dignoreversion=1 for ant to ignore the version check."/>
      <echo>Java version is ${ant.java.version} as required.</echo>
    </target>

    <!-- ================================================================== -->
    <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - -->
    <!-- ================================================================== -->

     <target name="init" depends="init-deps, build.properties">
        <!-- Current timestamp in different formats. -->
        <tstamp>
            <format property="build.date" pattern="yyyy-MM-dd"/>
        </tstamp>
        <tstamp>
            <format property="build.date.compact" pattern="yyyyMMdd"/>
        </tstamp>

        <antcontrib:propertyregex property="version.major" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\1"/>
        <antcontrib:propertyregex property="version.minor" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\2"/>
        <antcontrib:propertyregex property="version.revision" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\3"/>

        <!-- Default full version name. -->
        <!-- Nightly and other TeamCity builds will define their own. -->
        <property name="version.full" value="${version}.dev-${build.date.compact}"/>
        <echo>Base Version: ${version}</echo>
        <echo>Full Version: ${version.full}</echo>

        <!-- Other properties -->
        <property file="build/html-style.properties" />

        <echo>Vaadin package is: ${vaadin-package}</echo>

        <!-- Create result dir unless already exists -->
        <mkdir dir="${result-path}" />

        <!-- Create dirs that might be used by the test coverage generation -->
    	<mkdir dir="${result-classes-core-for-emma-war}" />
    	<mkdir dir="${result-classes-core-for-emma-junit}" />
    	<mkdir dir="${result-path}/coverage" />

        <echo>We are using gwt version ${gwt-version}.</echo>

        <!-- Destination files -->
        <property name="base-name" value="${product-file}-${version.full}" />
        <property name="lib-jar-name" value="${base-name}.jar" />
        <property name="lib-sources-jar-name" value="${base-name}-sources.jar" />
        <property name="lib-javadoc-jar-name" value="${base-name}-javadoc.jar" />
        <property name="test-war-filename" value="${product-file}-tests-${version.full}.war"/>

        <echo message="Prepared to build ${product-file} version ${version.full} packages" />

        <!-- Output directory -->
        <property name="output-dir" value="${result-path}/${base-name}" />
        <mkdir dir="${output-dir}" />

        <!-- Where widgetsets are written to.                             -->
        <!-- When not building a package, widgetsets should be written to -->
        <!-- WebContent/VAADIN/widgetsets, which needs to be set in       -->
        <!-- init-nonpackage target before calling this main init target. -->
        <property name="widgetsets-output-dir" value="${output-dir}/WebContent/VAADIN/widgetsets" />
        
     	<!-- Build helpers -->
     	<property name="buildhelpers-src" value="build/buildhelpers" />
     	<property name="buildhelpers-classes" value="${result-path}/buildhelpers/classes" />

        <!-- Create Output Directory Hierarchy -->
        <mkdir dir="${output-dir}/WebContent" />
        <mkdir dir="${output-dir}/WebContent/demo" />
        <mkdir dir="${output-dir}/WebContent/docs" />
        <mkdir dir="${output-dir}/WebContent/docs/api" />
        <mkdir dir="${output-dir}/WebContent/tests" />
        <mkdir dir="${output-dir}/WebContent/WEB-INF" />
        <mkdir dir="${output-dir}/WebContent/WEB-INF/lib" />
        <mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />
    </target>

    <target name="internal-package-war">
        <echo>Building Test WAR</echo>

        <echo>Adding test class files and resources and launcher configuration.</echo>
        <copy todir="${output-dir}/WebContent/WEB-INF/classes">
            <fileset dir="${result-classes-testbench}">
                <include name="${vaadin-package}/tests/**/*" />
                <include name="${vaadin-package}/launcher/**" />
            </fileset>
            <fileset dir="${result-classes-junit}">
            	<!-- VaadinClasses is used by both JUnit and TestBench tests -->
                <include name="**/VaadinClasses*.class" />
            </fileset>
            <!-- test resources -->
            <fileset dir="tests/testbench">
                <include name="${vaadin-package}/tests/**/*" />
                <!-- Pre-processed versions of these copied above -->
                <exclude name="**/*.java" />
                <exclude name="**/*.html" />
                <exclude name="**/*.css" />
                <exclude name="**/*.xml" />
            </fileset>

        	<!-- Include files required by the DemoLauncher/DevelopmentServerLauncher -->
            <fileset dir="tests/testbench">
        		<include name="${vaadin-package}/launcher/jetty-webdefault.xml" />
        		<include name="${vaadin-package}/launcher/keystore" />
            </fileset>
        </copy>

        <war warfile="${result-path}/${test-war-filename}"> 
            <fileset dir="${output-dir}/WebContent">
                <!-- Already in JAR -->
            	<!-- Not excluded because used from WAR by portal integration tests
                <exclude name="VAADIN/themes/base/**/*" />
                <exclude name="VAADIN/themes/chameleon/**/*" />
                <exclude name="VAADIN/themes/liferay/**/*" />
                <exclude name="VAADIN/themes/reindeer/**/*" />
                <exclude name="VAADIN/themes/runo/**/*" />
                <exclude name="VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" />
                -->

                <!-- Not needed for testing -->
                <exclude name="docs/**/*" />
                <exclude name="docs" />
                
                <include name="**/*" />
            </fileset>
        </war>
    </target>

    <target name="internal-package-liferay" depends="internal-package-war">
        <!-- We assume the needed files are put in place by internal-package-war -->
        <echo>Building Liferay zip</echo>

        <zip zipfile="${result-path}/${base-name}-liferay.zip">
            <zipfileset prefix="VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet" dir="${output-dir}/WebContent/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet">
                <patternset>
                    <include name="**/*" />
                </patternset>
            </zipfileset>
            <zipfileset prefix="VAADIN/themes" dir="${output-dir}/WebContent/VAADIN/themes">
                <patternset>
                    <include name="base/**/*" />
                    <include name="chameleon/**/*" />
                    <include name="liferay/**/*" />
                    <include name="runo/**/*" />
                    <include name="reindeer/**/*" />
                </patternset>
            </zipfileset>
            <zipfileset prefix="VAADIN" dir="${output-dir}/WebContent/VAADIN">
                <patternset>
                    <include name="vaadinBootstrap.js" />
                </patternset>
            </zipfileset>
        </zip>
        
        <echo>##teamcity[publishArtifacts '${result-path}/${base-name}-liferay.zip']</echo>
    </target>

    <!-- Build server-side, client-side, libraries, and tests.                   -->
    <!-- The client-side needs to be built before vaadin.jar, because the vaadin.jar -->
    <!-- require the default widgetset and doing otherwise would build it twice. -->
    <!-- However, since compiling the server-side is required by the client-side -->
    <!-- compilation, the server-side will actually be built before it.          -->
    <target name="build"
            depends="compile-server-side, compile-tests, compile-client-side, vaadin.jar, vaadin-sources.jar"
            description="Build package required files, without packing them.">
    </target>

    <target name="compile-server-side" depends="compile-core, webcontent"/>

    <!-- Copy and preprocess sources for packaging 
    NOTE: Replaces <version></version> tags with build version tag for some "textual" files
    -->
    <target name="preprocess-src">
        <!--
        Source directories in the project are
         * src (Vaadin core)
         * tests/testbench (TestBench test cases)
         * tests/server-side (Server-side JUnit test cases)
         * tests/client-side (Client-side JUnit test cases)

        These are copied to 
         * ${result-path}/src/core
         * ${result-path}/src/tests
         * ${result-path}/src/junit

        And compiled to 
         * ${result-path}/classes/core
         * ${result-path}/classes/tests
         * ${result-path}/classes/junit
         
        Java/HTML/CSS/XML files are filtered so the license is added and the version is set. 
        Other files are just copied.
        -->
        
        <loadfile property="VaadinApache2LicenseForJavaFiles" srcFile="build/VaadinApache2LicenseForJavaFiles.txt" />
        
        <mkdir dir="${result-path}/src" />
        <mkdir dir="${result-src-core}" />
        <mkdir dir="${result-src-testbench}" />
        <mkdir dir="${result-src-junit}" />

        <patternset id="preprocessable-files">
            <include name="**/*.java" />
            <include name="**/*.html" />
            <include name="**/*.css" />
            <include name="**/*.xml" />
        </patternset>
        <patternset id="non-preprocessable-files">
            <exclude name="**/.svn" />
            <exclude name="**/*.java" />
            <exclude name="**/*.html" />
            <exclude name="**/*.css" />
            <exclude name="**/*.xml" />
        </patternset>
        <filterset id="version-and-license">
            <filter token="VaadinApache2LicenseForJavaFiles" value="${VaadinApache2LicenseForJavaFiles}" />
            <filter token="VERSION" value="${version.full}" />
        </filterset>
        
        <!-- Adds a style class to JavaDoc <pre> tags for style customization. -->
        <filterset id="pre-css-style" begintoken="     * &lt;" endtoken="&gt;">
            <filter token="pre" value="     * &lt;pre class='code'&gt;" />
        </filterset>

        <echo>Copying src directory and processing copied files.</echo>
        <echo>Replacing &lt;version&gt; tag with build version for java/html/css/xml files.</echo>
        <copy todir="${result-src-core}" overwrite="yes">
            <filterset refid="version-and-license"/>
            <filterset refid="pre-css-style"/>
            <fileset dir="src">
                <patternset refid="preprocessable-files" />
            </fileset>
        </copy>

        <copy todir="${result-src-testbench}">
            <filterset refid="version-and-license"/>
            <fileset dir="tests/testbench">
                <patternset refid="preprocessable-files" />
            </fileset>
        </copy>
        <copy todir="${result-src-junit}">
            <filterset refid="version-and-license"/>
            <fileset dir="tests/server-side">
                <patternset refid="preprocessable-files" />
            </fileset>
            <fileset dir="tests/client-side">
                <patternset refid="preprocessable-files" />
            </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-src-core}">
            <fileset dir="src">
                <patternset refid="non-preprocessable-files" />
            </fileset>
        </copy>
        <copy todir="${result-src-testbench}">
            <fileset dir="tests/testbench">
                <patternset refid="non-preprocessable-files" />
            </fileset>
        </copy>
        <copy todir="${result-src-junit}">
            <fileset dir="tests/server-side">
                <patternset refid="non-preprocessable-files" />
            </fileset>
            <fileset dir="tests/client-side">
                <patternset refid="non-preprocessable-files" />
            </fileset>
        </copy>

    </target>

    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  WebContent
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
    <target name="webcontent" depends="preprocess-src,defaulttheme">

        <!-- Add WebContent -->
        <echo>Adding VAADIN/themes and META-INF</echo>
        <copy todir="${output-dir}/WebContent">
            <fileset dir="WebContent">
                <exclude name="**/.svn" />
                <include name="WEB-INF/lib/hsqldb.jar" />
                <include name="VAADIN/themes/**/*" />
            	<include name="VAADIN/vaadinBootstrap.js" />
                <include name="META-INF/**/*" />
            </fileset>
        </copy>

        <!-- Add servlet and portlet configuration files from WebContent -->
        <copy todir="${output-dir}/WebContent/WEB-INF">
            <fileset dir="WebContent/WEB-INF">
                <include name="liferay-*.xml" />
                <include name="portlet.xml" />
                <include name="web.xml" />
            </fileset>
        </copy>
        
        <!-- These should go to various JARs -->
        <copy todir="${output-dir}/WebContent">
            <filterchain>
                <expandproperties />
                <replacetokens begintoken="@" endtoken="@">
                    <token key="version" value="${version.full}" />
                </replacetokens>
                <replacetokens begintoken="@" endtoken="@">
                    <token key="version-minor" value="${version.major}.${version.minor}" />
                </replacetokens>
                <replacetokens begintoken="@" endtoken="@">
                    <token key="builddate" value="${build.date}" />
                </replacetokens>
                <replacetokens begintoken="@" endtoken="@">
                    <token key="gwt-version" value="${gwt-version}" />
                </replacetokens>
            </filterchain>
            <fileset dir="WebContent">
                <exclude name="**/.svn" />
                <include name="release-notes.html" />
                <include name="license.html" />
                <include name="css/**" />
                <include name="img/**" />
            </fileset>
        </copy>
    </target>

    <target name="compile-core" depends="init, preprocess-src">
        <echo>Compiling src (server-side)</echo>
    	<!-- Compile core sources first as the other sources depend on these -->
        <mkdir dir="${result-classes-core}" />
        <javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-classes-core}" debug="true" encoding="UTF-8" includeantruntime="false">
            <src path="${result-src-core}"/>
        </javac>
    </target>
	
    <target name="compile-tests" depends="compile-core">
        <echo>Compiling src (Server and client side JUnit tests)</echo>
    	<!-- Compile server and client side JUnit tests -->
        <mkdir dir="${result-classes-junit}" />
        <javac source="1.5" target="1.5" classpathref="compile.classpath.server-side-tests" destdir="${result-classes-junit}" debug="true" encoding="UTF-8" includeantruntime="false">
        	<classpath path="${result-classes-core}"></classpath>
            <src path="${result-src-junit}"/>
        </javac>
    	
        <echo>Compiling src (TestBench tests)</echo>
    	<!-- Compile TestBench tests -->
        <mkdir dir="${result-classes-testbench}" />
        <javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-classes-testbench}" debug="true" encoding="UTF-8" includeantruntime="false">
        	<classpath path="${result-classes-junit}"></classpath>
        	<classpath path="${result-classes-core}"></classpath>
            <src path="${result-src-testbench}"/>
        </javac>
    	
    </target>

    <target name="compile-helpers" depends="init">
    	<mkdir dir="${buildhelpers-classes}" />
        <ivy:cachepath pathid="buildhelpers.dependencies" resolveId="buildhelpers" conf="compile" file="build/ivy/buildhelpers-ivy.xml"/>        
        <javac source="1.5" target="1.5" includeantruntime="false" srcdir="${buildhelpers-src}" 
                	classpathref="buildhelpers.dependencies" destdir="${buildhelpers-classes}" debug="true" encoding="UTF-8" />
    </target>
    
    <target name="defaulttheme" depends="init, compile-helpers">
        <echo>Combining default themes css files</echo>
        <java classname="com.vaadin.buildhelpers.CompileDefaultTheme" failonerror="yes" fork="yes">
            <arg value="-version" />
            <arg value="${version.full}"/>
            <classpath>
                <path location="${buildhelpers-classes}" />
                <path refid="buildhelpers.dependencies" />
            </classpath>
            <jvmarg value="-Djava.awt.headless=true"/>
        </java>
    </target>

    <target name="testtarget">
        <echo>TEST TARGET CALLED</echo>
    </target>

    <!-- ================================================================== -->
    <!-- Widget Set Compilation                                             -->
    <!-- ================================================================== -->
    <!-- Widget set compilation process:                                    -->
    <!--   1. Preprocess sources                                            -->
    <!--   2. Compile server-side java                                      -->
    <!--   3. Generate widget set definitions and classes                   -->
    <!--   4. Compile widget sets                                           -->
    <!--                                                                    -->
    <!-- Widget sets can be built for two purposes:                         -->
    <!--   * for building installation packages                             -->
    <!--   * for building single widget sets during development             -->
    <!--      Targets: widgetset-<name>                                     -->

    <target name="remove-widgetset-gwt-tmp">
        <echo>Removing widgetset temp files</echo>
        <delete dir="${widgetsets-output-dir}/.gwt-tmp" includeemptydirs="true"/>
        <!-- This is generated by GWT 2.3+ for rpcPolicyManifest and symbolMaps, cannot disable -->
        <delete dir="${widgetsets-output-dir}/WEB-INF" includeemptydirs="true" failonerror="false" />
    </target>

    <!-- The widgetset generator is currently compiled along with rest of server-side Java. -->    
    <target name="compile-widgetset-generator" depends="compile-core"/>

    <target name="compile-widgetset" depends="init-deps" description="Compiles the widgetset given as the first parameter">
        <fail unless="widgetset" message="No widgetset parameter set"/>
        <property name="widgetset-style" value="OBF" />
    	<property name="widgetset-localWorkers" value="4" />
    	<property name="widgetset-extraParams" value="" />
        <echo>Compiling widgetset ${widgetset}. Output directory: ${widgetsets-output-dir}</echo>
    	<mkdir dir="${widgetsets-output-dir}"/>
        <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m">
        	<classpath>
        		   <path refid="compile.classpath.client-side" />
        		   <pathelement location="${result-classes-core}" />
        	       <pathelement location="${result-src-core}" />
            </classpath>            
            <arg value="-war" />
            <arg value="${widgetsets-output-dir}" />
            <arg value="-style" />
            <arg value="${widgetset-style}" />
            <arg value="-localWorkers" />
            <arg value="${widgetset-localWorkers}" />
        	<arg line="${widgetset-extraParams}" />
            <arg value="${widgetset}" />

            <jvmarg value="-Xss8M"/>
            <jvmarg value="-XX:MaxPermSize=256M"/>  
            <jvmarg value="-Djava.awt.headless=true"/>
        </java>
        <antcall target="remove-widgetset-gwt-tmp"/>
        
        <echo>Compiled ${widgetset}</echo>
    </target>
    
    <target name="compile-widgetset-default">
        <antcall target="compile-widgetset">
            <reference refid="compile.classpath.client-side" />
            <param name="widgetset" value="com.vaadin.terminal.gwt.DefaultWidgetSet"/>
        </antcall>
    </target>
    
    <target name="compile-widgetset-portal-default" unless="compile.only.default-widgetset">
        <antcall target="compile-widgetset">
            <reference refid="compile.classpath.client-side" />
            <param name="widgetset" value="com.vaadin.portal.gwt.PortalDefaultWidgetSet"/>
        </antcall>
    </target>

    <!-- Compiles all widgetsets.                                         -->
    <!-- This is called when building packages and when compiling all     -->
    <!-- widgetsets, but not when compiling individual widgetsets.        -->
    <target name="compile-client-side" depends="compile-server-side">
        <echo>Compiling widget sets in parallel.</echo>
        <parallel threadsperprocessor="1">
            <antcall inheritrefs="true" target="compile-widgetset-default"/>
            <antcall inheritrefs="true" target="compile-widgetset-portal-default"/>
        </parallel>
    </target>

    <!-- Definitions for building local components, i.e., not for an installation package. -->
    <target name="init-nonpackage" depends="build.properties">
        <!-- Definitions for building the client-side. -->
        <property name="widgetsets-output-dir" value="WebContent/VAADIN/widgetsets" />

        <echo>We are using ${lib-gwt-dev}.</echo>
        <echo>Widget sets output dir: ${widgetsets-output-dir}</echo>
    </target>

    <!-- Builds all widgetsets locally, i.e., not for an installation package. -->
    <target name="widgetsets" depends="init-nonpackage, init, compile-widgetset-generator, compile-client-side"/>

    <!-- Build each widgetset locally, i.e., not for an installation package. -->
    <target name="widgetset-default" depends="init-nonpackage, init, compile-widgetset-generator, compile-widgetset-default"/>
    <target name="widgetset-portal-default" depends="init-nonpackage, init, compile-widgetset-generator, compile-widgetset-portal-default"/>

    <!-- ================================================================== -->
    <!-- Libraries and Tests                                                -->
    <!-- ================================================================== -->

    <!-- Compile the Vaadin library JAR.                                    -->
    <!-- Need only the default widgetset for this, but can't depend         -->
    <!-- specifically on it, because dependence does not see compiled       -->
    <!-- individual widgetsets, because antcall does not fulfill            -->
    <!-- dependencies.                                                      -->
    <target name="vaadin.jar" depends="compile-server-side, compile-client-side, compile-helpers">
        <echo>Creating JAR (server-side) ${lib-jar-name}</echo>
        <!-- Create Vaadin JAR -->
        <mkdir dir="${output-dir}/META-INF"/>
        <echo file="${output-dir}/META-INF/VERSION">${version.full}</echo> 
        <echo file="${output-dir}/META-INF/GWT-VERSION">${gwt-version}</echo> 
        	
		<emma enabled="${emma.enabled}" >
			<instr instrpath="${result-classes-core}"
				destdir="${result-classes-core-for-emma-war}"
				mode="copy"
				metadatafile="${result-path}/war.es"
				merge="false"
			>
				<filter includes="com.vaadin.*" />
				<filter excludes="com.vaadin.terminal.gwt.*" />
			</instr>
		</emma>    	
    	
        <jar jarfile="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"
             compress="true" manifest="build/package/META-INF/MANIFEST.MF" duplicate="preserve">
            <metainf dir="${output-dir}/META-INF"/>
            <manifest>
                <attribute name="Vaadin-Package-Version" value="1" />
                <attribute name="Vaadin-Widgetsets" value="com.vaadin.terminal.gwt.DefaultWidgetSet" />
                <attribute name="Implementation-Vendor" value="Vaadin Ltd" />
                <attribute name="Implementation-URL" value="http://vaadin.com" />
                <attribute name="Implementation-Version" value="${version.full}" />
                <attribute name="GWT-Version" value="${gwt-version}" />
                <attribute name="GWT-Version-Dependencies" value="${gwt-version-dependencies}" />
                <attribute name="Bundle-Version" value="${version.full}" />
            </manifest>
            <!-- Include any instrumented class files before the normal classes -->
            <fileset dir="${result-classes-core-for-emma-war}" />
            <fileset dir="${result-classes-core}"/>
            <!-- add sources -->
            <fileset dir="${result-src-core}"/>
            <fileset dir="${output-dir}/WebContent">
                <patternset>
                    <include name="VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" />
                    <include name="VAADIN/themes/base/**/*" />
                    <include name="VAADIN/themes/chameleon/**/*" />
                    <include name="VAADIN/themes/liferay/**/*" />
                    <include name="VAADIN/themes/runo/**/*" />
                    <include name="VAADIN/themes/reindeer/**/*" />
                    <include name="VAADIN/vaadinBootstrap.js" />
                    
                    <include name="release-notes.html" />
                    <include name="license.html" />
                    <include name="css/**" />
                    <include name="img/**" />
                </patternset>
            </fileset>
        </jar>
        
        <!-- Generate the Export-Package attribute in the manifest of the JAR -->
        <java classname="com.vaadin.buildhelpers.GeneratePackageExports" failonerror="true" fork="yes">
            <arg value="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"/>
            <classpath>
                <pathelement location="${buildhelpers-classes}" />
            </classpath>
        </java>
        
        <echo>##teamcity[publishArtifacts '${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}']</echo>
    </target>

    <target name="vaadin-sources.jar" depends="init">
        <jar file="${result-path}/${lib-sources-jar-name}" compress="true">
            <fileset dir="${result-src-core}">
                <patternset>
                    <include name="**/*.java" />
                </patternset>
            </fileset>
            <fileset dir="${output-dir}/WebContent">
                <patternset>
                    <include name="release-notes.html" />
                    <include name="license.html" />
                    <include name="css/**" />
                    <include name="img/**" />
                </patternset>
            </fileset>
        </jar>
    </target>
    
    <!-- ================================================================== -->
    <!-- Documentation                                                      -->
    <!-- ================================================================== -->

    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
    <!-- Documentation: Add Javadoc to doc                                  -->
    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->
    <target name="javadoc" depends="init, preprocess-src">
        <property name="javadoc.destdir" value="${output-dir}/WebContent/docs/api"/>
        
        <javadoc destdir="${javadoc.destdir}" author="true" version="true" use="true" windowtitle="${product-name}" classpathref="compile.classpath.client-side">
            <packageset dir="${result-src-core}"/>
            <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>

        <!-- Create a javadoc jar, mainly for Maven -->
        <jar file="${result-path}/${lib-javadoc-jar-name}" compress="true">
            <fileset dir="${javadoc.destdir}">
                <patternset>
                    <include name="**" />
                </patternset>
            </fileset>
            <fileset dir="${output-dir}/WebContent">
                <patternset>
                    <include name="release-notes.html" />
                    <include name="license.html" />
                    <include name="css/**" />
                    <include name="img/**" />
                </patternset>
            </fileset>
        </jar>

        <!-- Append local style definitions. -->
        <echo>Appending local style definitions</echo>
        <concat destfile="${javadoc.destdir}/stylesheet.css" append="yes">
            <filelist dir="build/javadoc" files="stylesheet-local.css"/>
        </concat>
    </target>

    <!-- ================================================================== -->
    <!-- Difference to previous release package.                            -->
    <!-- ================================================================== -->

    <!-- This should be called after the Linux package is ready. -->
    <target name="differences" if="build.differences">
        <exec executable="python" searchpath="true" failonerror="true" output="${result-path}/differences.txt">
            <arg value="build/bin/package-diff.py"/>
            <arg value="${version.full}"/>
        </exec>

        <echo>##teamcity[publishArtifacts '${result-path}/differences.txt']</echo>
    </target>
    
    <!-- ================================================================== -->
    <!-- Custom build.                                                     -->
    <!-- ================================================================== -->

    <!-- Main target for the custom build. -->
    <!-- Need to read custom build configuration before calling clean-result -->
    <target name="custom-build" depends="custom-build-init, clean-result, nightly-init, init, build">
    </target>


    <!-- Initialize a custom build. -->
    <target name="custom-build-init">
        <echo>Preparing a custom build with properties file: ${build.properties.file}</echo>

        <!-- Custom build support -->
        <antcontrib:if>
            <isset property="build.properties.file"/>
            <then>
                <tstamp>
                    <format property="build.date.compact" pattern="yyyyMMdd"/>
                </tstamp>
                <property file="${build.properties.file}" />
                <property name="version" value="${vaadin.version}"/>
                <property name="version.full" value="${version}-${build.date.compact}"/>
            </then>
            <!-- Otherwise version is set by the target "init" -->
        </antcontrib:if>
    </target>

    <target name="custom-build-maven-publish">
        <antcall target="nightly-maven-publish" />
    </target>


    <!-- ================================================================== -->
    <!-- Nightly build.                                                     -->
    <!-- ================================================================== -->

    <!-- Main target for the nightly build. -->
    <target name="nightly" depends="clean-result, nightly-init, init, build, javadoc, differences">
    </target>


    <!-- Initialize a nightly build. -->
    <target name="nightly-init" depends="build.properties">

        <!-- Mandatory parameters. -->
        <fail unless="build.number" message="The build.number property must be defined."/>
        <fail unless="nightly.publish" message="The nightly.publish property must be defined."/>

        <!-- Optional parameters. -->
        <property name="build.tag" value="dev"/>

        <echo>Base version: ${version}</echo>
        <echo>Build number: ${build.number}</echo>
        <echo>Build tag: ${build.tag}</echo>
        <echo>Publish target: ${nightly.publish}</echo>
        <echo>Demo publish target: ${nightly.demo.publish}</echo>

        <!-- Set build number. -->
        <tstamp>
            <format property="nightly.date" pattern="yyyyMMdd"/>
        </tstamp>
        <property name="version.full" value="${version}.${build.tag}-${nightly.date}-${build.number}"/>

        <echo>Version will be: ${version.full}</echo>

        <!-- Tell TeamCity the build name. Have to do it this way, because   -->
        <!-- this script needs to get the plain build number as a parameter. -->
        <echo>##teamcity[buildNumber '${version}-c${build.number}']</echo>
    </target>

    <target name="nightly-teamcity-publish">
        <!-- Publish as a TeamCity artifact. -->
        <echo>##teamcity[publishArtifacts '${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}']</echo>
    </target>

    <!-- Copies the nightly build artifacts to the download server. -->
    <target name="nightly-download-publish" if="nightly.publish">
        <!-- Publish to the download server. -->
        <echo>Installing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to ${nightly.publish}</echo>
        <echo>Hopefully you have permissions for the copy operation with SSH.</echo>

        <!-- Copy the linux installation package and the JAR. -->
        <exec executable="scp" searchpath="true" resultproperty="nightly.install.scp.result">
            <arg value="-B"/>
            <arg value="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"/>
            <arg value="${nightly.publish}"/>
        </exec>

        <echo>Result: ${nightly.install.scp.result}</echo>
    </target>

    <!-- Copies the nightly build artifacts to the download server. -->
    <target name="nightly-tests-publish" if="nightly.demo.publish" depends="internal-package-war">
        <fail unless="version.major" message="Major version must be defined in version.major"/>
        <fail unless="version.minor" message="Major version must be defined in version.minor"/>
        
        
        <!-- Publish to the demo server. -->
        <property name="src" value="${result-path}/${test-war-filename}"/>
        <property name="target" value="${nightly.demo.publish}/${version.major}.${version.minor}-${build.tag}.war"/>
        
        <echo>Installing ${src} to ${target}</echo>

        <!-- Copy the linux installation package and the JAR. -->
        <exec executable="scp" searchpath="true" resultproperty="nightly.demo.install.scp.result">
            <arg value="-B"/>
            <arg value="${src}"/>
            <arg value="${target}"/>
        </exec>

        <echo>Result: ${nightly.install.scp.result}</echo>
    </target>

    <target name="nightly-publish" depends="nightly-teamcity-publish, nightly-download-publish, nightly-tests-publish">
    </target>

    
    <target name="nightly-maven-pom.xml">
        <echo>Creating pom.xml for nightly build</echo>
        <property name="vaadin.version.maven" value="${version.major}.${version.minor}-SNAPSHOT" />
        <copy tofile="build/maven/pom.xml">
            <filterchain>
                <expandproperties />
                <replacetokens begintoken="@" endtoken="@">
                    <token key="MAVEN-VERSION" value="${vaadin.version.maven}" />
                </replacetokens>
            </filterchain>
            <fileset file="build/maven/pom-template.xml"/>
        </copy>
    </target>
    
    <target name="nightly-maven-publish" depends="nightly-maven-pom.xml">
        <property file="${gpg.passphrase.file}" />

        <echo>Publishing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to Maven repository</echo>
        <artifact:mvn>
            <arg value="gpg:sign-and-deploy-file"/>
            <!-- .. is a workaround as maven runs in the build directory -->
            <sysproperty key="file" value="../${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" />
            <sysproperty key="pomFile" value="maven/pom.xml" />
            <sysproperty key="repositoryId" value="vaadin-snapshots" />
            <sysproperty key="url" value="${snapshot.repository.url}" />
            <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" />
        </artifact:mvn>
    </target>

    <target name="local-maven-pom.xml">
        <echo>Creating pom.xml for local test build</echo>
        <fail unless="version.major" message="Major version must be defined in version.major"/>
        <fail unless="version.minor" message="Major version must be defined in version.minor"/>
        <property name="vaadin.version.maven" value="${version.major}.${version.minor}" />
        <copy tofile="build/maven/pom.xml">
            <filterchain>
                <expandproperties />
                <replacetokens begintoken="@" endtoken="@">
                    <token key="MAVEN-VERSION" value="${vaadin.version.maven}" />
                </replacetokens>
            </filterchain>
            <fileset file="build/maven/pom-template.xml"/>
        </copy>
    </target>
    
    <target name="local-maven-publish" depends="local-maven-pom.xml">
        <echo>Publishing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to the local Maven repository</echo>
        <artifact:mvn>
            <arg value="install:install-file"/>
            <!-- .. is a workaround as maven runs in the build directory -->
            <sysproperty key="file" value="../${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" />
            <sysproperty key="pomFile" value="maven/pom.xml" />
        </artifact:mvn>
    </target>

    <!-- ================================================================== -->
    <!-- Automated tests.                                                   -->
    <!-- ================================================================== -->

    <target name="tests" depends="compile-tests, internal-package-war">
        <!-- Run all different types of tests in parallel to decrease testing time -->
        <parallel threadcount="3">
        	<sequential>
                <!-- Sleep before running integration tests so testbench tests have time to compile and start -->
                <sleep minutes="4" /> 
                <antcall inheritrefs="true" inheritall="true" target="integration-tests"></antcall>
        	</sequential>
            <antcall inheritrefs="true" inheritall="true" target="testbench-tests"></antcall>
            <antcall inheritrefs="true" inheritall="true" target="server-side-tests"></antcall>
        </parallel>
        
        <!-- Create a combined report from each test's sub report -->
		<emma enabled="${emma.enabled}" >
			<merge file="${result-path}/combined.es">
				<fileset dir="${result-path}" >
					<include name="*.ec" />
					<include name="*.em" />
				</fileset>
			</merge>
			<report sourcepath="${result-src-core}" >
				<fileset dir="${result-path}" >
					<include name="combined.es" />
				</fileset>
				
				<txt outfile="../${result-path}/coverage/coverage-combined/coverage.txt" />
				<html outfile="../${result-path}/coverage/coverage-combined/coverage.html" />
			</report>
		</emma>    	    	
        <echo>##teamcity[publishArtifacts '${result-path}/coverage']</echo>
    </target>
    
    <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
    <target name="server-side-tests" unless="tests.serverside.skip" depends="compile-tests">
		<emma enabled="${emma.enabled}" >
			<instr instrpath="${result-classes-core}"
				destdir="${result-classes-core-for-emma-junit}"
				mode="copy"
				metadatafile="${result-path}/unittests.em"
   			    merge="false"
		        >
				<filter includes="com.vaadin.*" />
				<filter excludes="com.vaadin.terminal.gwt.*" />
			</instr>
		</emma>    	    	
        <junit printsummary="yes"> 
            <classpath> 
                <pathelement path="${result-classes-core-for-emma-junit}" />
                <pathelement path="${result-classes-core}" />
                <pathelement path="${result-classes-junit}" />
            	<path refid="compile.classpath.server-side-tests"></path>
            </classpath>
        	<jvmarg value="-Demma.coverage.out.file=../${result-path}/unittests.ec" />

            <batchtest fork="yes">
                <fileset dir="tests/server-side" includes="**/*.java" excludes="**/Abstract*.java,com/vaadin/tests/data/bean/*.java,com/vaadin/tests/util/*.java,**/VaadinClasses.java" />
                <fileset dir="tests/client-side" includes="**/*.java" excludes="**/Abstract*.java" />
            </batchtest>
        </junit>
		<emma enabled="${emma.enabled}" >
			<report sourcepath="${result-src-core}" >
				<fileset dir="${result-path}" >
					<include name="unittests.*" />
				</fileset>
				
				<txt outfile="../${result-path}/coverage/coverage-unittests/unittests_coverage.txt" />
				<html outfile="../${result-path}/coverage/coverage-unittests/unittests_coverage.html" />
			</report>
    	</emma>
        <echo>##teamcity[publishArtifacts '${result-path}/coverage']</echo>
    </target>

    <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
    <target name="testbench-tests" unless="tests.testbench.skip">
        <fail unless="product-file" message="The 'product-file' property must be defined."/>
        <fail unless="version" message="The 'version' property must be defined."/>

        <echo>Version: ${version.full}</echo>

        <!-- Parameters for the test.xml script. -->
        <fail unless="com.vaadin.testbench.tester.host" message="The 'com.vaadin.testbench.tester.host' property must be defined."/>
        <fail unless="com.vaadin.testbench.deployment.url" message="The 'com.vaadin.testbench.deployment.url' property must be defined."/>
        <fail unless="com.vaadin.testbench.lib.dir" message="The 'com.vaadin.testbench.lib.dir' property must be defined."/>

        <property name="com.vaadin.testbench.screenshot.block.error" value="0.025"/>
        <property name="com.vaadin.testbench.debug" value="false"/>
        <property name="package.name" value="${base-name}"/>

        <!-- Only Linux tests allowed. TODO: Generalize this. -->
        <property name="package.filename" value="${result-path}/${test-war-filename}"/>

        <!-- Run the separate test script. -->
        <ant antfile="tests/test.xml" target="test-package" inheritall="false" inheritrefs="true">
            <!-- This is provided so that the test script can copy the -->
            <!-- "tests" classes after unpacking the package.          -->
            <property name="output-dir" value="${output-dir}"/>

            <!-- Convert tests to run multiple times if failed. -->
            <property name="retries" value="2"/>
                        	
            <property name="package.filename" value="${basedir}/${package.filename}"/>
            <property name="testing.testarea" value="/tmp/testarea"/>
            <property name="package.name" value="${package.name}"/>
            <property name="test-output-dir" value="../build/test-output" />
            <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}"/>
            <property name="com.vaadin.testbench.deployment.url" value="${com.vaadin.testbench.deployment.url}"/>
            <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}"/>
            <property name="com.vaadin.testbench.debug" value="${com.vaadin.testbench.debug}"/>
            <property name="com.vaadin.testbench.screenshot.block.error" value="${com.vaadin.testbench.screenshot.block.error}"/>
        	
        	<property name="deps.initialized"  value="${deps.initialized}"/>
        		
        </ant>
    	
		<emma enabled="${emma.enabled}" >
			<report sourcepath="${result-src-core}" >
				<fileset dir="${result-path}" >
					<include name="war.*" />
				</fileset>
				
				<txt outfile="../${result-path}/coverage/coverage-testbench/testbench_coverage.txt" />
				<html outfile="../${result-path}/coverage/coverage-testbench/testbench_coverage.html" />
			</report>
		</emma>    	
        <echo>##teamcity[publishArtifacts '${result-path}/coverage/']</echo>
    </target>

    <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
    <target name="integration-tests" depends="init-deps" unless="tests.integration.skip">
        <!-- Parameters for the test.xml script. -->
        <fail unless="com.vaadin.testbench.tester.host" message="The 'com.vaadin.testbench.tester.host' property must be defined."/>
        <fail unless="com.vaadin.testbench.lib.dir" message="The 'com.vaadin.testbench.lib.dir' property must be defined."/>
        <fail unless="sshkey.file" message="The 'sshkey.file' property must be defined."/>

        <!-- Empty passphrase if no passphrase defined -->
        <property name="passphrase" value="" />
        <property name="tests.war" location="${result-path}/${test-war-filename}" />
        
        <!-- Run the separate test script. -->
        <ant antfile="tests/integration_tests.xml" target="integration-test-all" inheritall="false" inheritrefs="true">
              <!-- This is provided so that the test script can copy the -->
              <!-- "tests" classes after unpacking the package.          -->
              <property name="output-dir" value="${output-dir}"/>

              <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}"/>
              <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}"/>
              <property name="sshkey.file" value="${sshkey.file}" />
              <property name="passphrase" value="${passphrase}" />
              <property name="demo.war" value="${tests.war}"/>
        	
              <property name="deps.initialized"  value="${deps.initialized}"/>
        </ant>
    </target>
</project>

<!-- These are for emacs. -->
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-omittag:nil
sgml-shorttag:nil
sgml-namecase-general:nil
sgml-general-insert-case:lower
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:4
sgml-indent-data:t
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:("/etc/sgml/catalog" "/usr/share/xemacs21/xemacs-packages/etc/psgml-dtds/CATALOG")
sgml-local-ecat-files:("ECAT" "~/sgml/ECAT" "/usr/share/sgml/ECAT" "/usr/local/share/sgml/ECAT" "/usr/local/lib/sgml/ECAT")
End:
-->