aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/build.xml
blob: 8a5fe71b354fc68cb7354748ffa5e75fd6c47915 (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
<?xml version="1.0"?>

<project name="vaadin-uitest" basedir="." default="publish-local" xmlns:ivy="antlib:org.apache.ivy.ant">
	<description>
		Provides a uitest WAR containing Vaadin UI tests
	</description>
	<include file="../common.xml" as="common" />
	<include file="../build.xml" as="vaadin" />

	<!-- global properties -->
	<property name="module.name" value="vaadin-uitest" />
	<property name="result.dir" value="result" />

	<path id="classpath.compile.custom">
	</path>

	<target name="dependencies">
		<!-- This is copied from common.xml to be able to add server.tests.source to the source path -->

		<ivy:resolve resolveid="common" conf="build" />
		<ivy:cachepath pathid="classpath.compile.dependencies" conf="build" />
	</target>

	<target name="compile" description="Compiles the module" depends="dependencies">

		<fail unless="module.name" message="No module name given" />
		<property name="result.dir" location="result" />
		<property name="src" location="${result.dir}/../src" />
		<property name="classes" location="${result.dir}/classes" />
		<property name="server.tests.sources" location="${result.dir}/../../server/tests/src" />
		<mkdir dir="${classes}" />

		<!-- TODO: Get rid of this -->
		<javac destdir="${classes}" source="${vaadin.java.version}" target="${vaadin.java.version}" debug="true" encoding="UTF-8" includeantruntime="false">
			<src path="${server.tests.sources}" />
			<include name="com/vaadin/tests/data/bean/**" />
			<include name="com/vaadin/tests/VaadinClasses.java" />
			<include name="com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java" />
			<classpath refid="classpath.compile.dependencies" />
			<classpath refid="classpath.compile.custom" />
		</javac>

		<javac destdir="${classes}" source="${vaadin.java.version}" target="${vaadin.java.version}" debug="true" encoding="UTF-8" includeantruntime="false">
			<src path="${src}" />
			<classpath location="${classes}" />
			<classpath refid="classpath.compile.dependencies" />
			<classpath refid="classpath.compile.custom" />
		</javac>
	</target>

	<target name="war" depends="compile, dependencies">
		<property name="result.dir" location="result" />
		<property name="classes" location="${result.dir}/classes" />
		<property name="result.war" location="${result.dir}/lib/${module.name}-${vaadin.version}.war" />
		<property name="WebContent.dir" location="${vaadin.basedir}/WebContent" />
		<property name="deps.dir" location="${result.dir}/deps" />

		<ivy:resolve resolveid="common" conf="build" />
		<ivy:cachepath pathid="classpath.runtime.dependencies" conf="build" />

		<delete dir="${deps.dir}" />
		<mkdir dir="${deps.dir}" />

		<copy todir="${deps.dir}" flatten="true">
			<path refid="classpath.runtime.dependencies" />
		</copy>

		<war destfile="${result.war}" duplicate="fail" index="true">
			<fileset refid="common.files.for.all.jars" />
			<fileset dir="${WebContent.dir}">
				<include name="statictestfiles/**" />
				<include name="WEB-INF/*.xml" />
			</fileset>
			<classes dir="${classes}" />
			<lib dir="${deps.dir}" />
		</war>

	</target>

	<target name="publish-local" depends="war">
		<antcall target="common.publish-local" />
	</target>

	<target name="clean">
		<antcall target="common.clean" />
	</target>
	<target name="tests">
		<!--<antcall target="common.tests.run" />-->
		<echo>WHAT? No JUnit tests for ${module.name}!</echo>
	</target>
</project>