summaryrefslogtreecommitdiffstats
path: root/build.xml
blob: e68eb9e2dd04c665e51acd74ed8546ee455325fe (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
<?xml version="1.0"?>

<project name="vaadin" basedir="." default="package" xmlns:ivy="antlib:org.apache.ivy.ant">
	<include file="common.xml" as="common" />

	<path id="vaadin.buildhelpers.classpath" location="${vaadin.basedir}/buildhelpers/result/classes" />

	<!-- ================================= target: all ================================= -->
	<!--<target name="all" description="Compiles all parts of the project" 
        depends="buildhelpers,theme-compiler,shared,server,client"> -->
	<target name="package" description="Compiles and packages all modules in the project" depends="buildorder">
		<subant buildpathref="build-path" target="publish-local">
		</subant>
	</target>

	<target name="buildorder" depends="official.build.checks">
		<!-- Find out a good build order -->
		<ivy:buildlist reference="ivy.build.path">
			<fileset dir="." includes="**/build.xml">
				<exclude name="build.xml" />
				<exclude name="build/**" />
				<exclude name="bin/**" />
				<exclude name="buildhelpers/**" />
				<exclude name="all/**" />
			</fileset>
		</ivy:buildlist>
		<path id="build-path">
			<!--    <path location="buildhelpers/build.xml" /> -->
			<path refid="ivy.build.path" />
			<!-- <path location="all/build.xml" /> -->
		</path>
	</target>
	<target name="clean" depends="buildorder">
		<subant buildpathref="build-path" target="clean">
		</subant>
		<delete dir="result" />
		<!-- Clean IVY cache (~/.ivy2) so no old artifacts are fetched from 
            there (leave everything but Vaadin artifacts) -->
		<delete dir="${ivy.cache.dir}/com.vaadin" />
		<delete dir="${ivy.cache.dir}/com.carrotsearch" />

	</target>
	<target name="checkstyle" depends="buildorder">
		<subant buildpathref="build-path" target="checkstyle" />
	</target>
	<target name="test" depends="buildorder">
		<subant buildpathref="build-path" target="test" />
	</target>

	<target name="test-all" depends="buildorder">
		<parallel>
			<!-- JUnit tests, can be run without a server -->
			<subant buildpathref="build-path" target="test" />

			<!-- Server deployment + TestBench tests  -->
			<antcall target="integration-test" />
		</parallel>
	</target>

	<target name="integration-test" depends="buildorder">
		<property name="war.file" location="result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" />

		<ant antfile="uitest/build.xml" target="test-testbench">
			<property name="war.file" location="${war.file}" />
		</ant>
	</target>

	<target name="official.build.checks" if="build.release">
		<condition property="java.version.matches">
			<equals arg1="${ant.java.version}" arg2="${vaadin.java.version}" />
		</condition>
		<fail unless="java.version.matches" message="Java version is ${ant.java.version}, but Vaadin must be compiled with genuine Java ${vaadin.java.version} compiler." />
		<echo>Java version is ${ant.java.version} as required.</echo>
	</target>

</project>