summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common.xml50
-rw-r--r--theme-compiler/build.xml8
-rw-r--r--theme-compiler/ivy.xml10
3 files changed, 63 insertions, 5 deletions
diff --git a/common.xml b/common.xml
index 2e9341c423..0d6c0bb3b2 100644
--- a/common.xml
+++ b/common.xml
@@ -81,7 +81,7 @@
<property name="src" location="{$result.dir}/../src" />
<union id="jar.files">
- <fileset dir="${classes}" excludes="${classes.exclude}" />
+ <fileset dir="${tests.classes}" excludes="${tests.classes.exclude}" />
<fileset dir="${src}" excludes="${jar.exclude}" />
<fileset refid="common.files.for.all.jars" />
<fileset file="${pom.xml}" />
@@ -133,11 +133,59 @@
</javac>
</target>
+ <target name="tests.run" depends="tests.compile">
+ <fail unless="module.name" message="No module name given" />
+
+ <property name="result.dir" location="result" />
+ <property name="classes" location="${result.dir}/classes" />
+ <property name="tests.classes" location="${result.dir}/tests/classes" />
+
+ <junit printsummary="withOutAndErr">
+ <formatter usefile="false" type="plain" />
+
+ <classpath location="${tests.classes}" />
+ <classpath location="${classes}" />
+ <classpath refid="classpath.compile.custom" />
+ <classpath refid="classpath.tests.dependencies" />
+
+ <batchtest fork="yes">
+ <fileset dir="${tests.classes}">
+ </fileset>
+ </batchtest>
+ </junit>
+ </target>
+
+ <target name="tests.compile" description="Compiles tests" depends="compile, dependencies.tests">
+ <fail unless="module.name" message="No module name given" />
+ <property name="result.dir" location="result" />
+ <property name="base.dir" location="${result.dir}/.." />
+ <property name="tests.src" location="${base.dir}/tests/src" />
+ <property name="tests.resources" location="${base.dir}/tests/resources" />
+ <property name="tests.classes" location="${result.dir}/tests/classes" />
+ <property name="classes" location="${result.dir}/classes" />
+
+ <mkdir dir="${tests.classes}" />
+
+ <javac srcdir="${tests.src}" destdir="${tests.classes}" source="${vaadin.java.version}" target="${vaadin.java.version}" debug="true" encoding="UTF-8" includeantruntime="false">
+ <classpath refid="classpath.tests.dependencies" />
+ <classpath location="${classes}" />
+ <classpath refid="classpath.tests.custom" />
+ </javac>
+ <copy todir="${tests.classes}">
+ <fileset dir="${tests.resources}" />
+ </copy>
+ </target>
+
<target name="dependencies" description="Resolves dependencies needed by this module">
<ivy:resolve resolveid="common" conf="build, build-provided" />
<ivy:cachepath pathid="classpath.compile.dependencies" conf="build, build-provided" />
</target>
+ <target name="dependencies.tests" description="Resolves dependencies needed by tests">
+ <ivy:resolve resolveid="common" conf="tests" />
+ <ivy:cachepath pathid="classpath.tests.dependencies" conf="tests" />
+ </target>
+
<target name="clean">
<fail unless="result.dir" message="No result.dir parameter given" />
<delete dir="${result.dir}" />
diff --git a/theme-compiler/build.xml b/theme-compiler/build.xml
index 9c3e5f46ce..71b1a6ae3e 100644
--- a/theme-compiler/build.xml
+++ b/theme-compiler/build.xml
@@ -11,12 +11,13 @@
<property name="module.name" value="vaadin-theme-compiler" />
<property name="result.dir" value="result" />
<path id="classpath.compile.custom" />
+ <path id="classpath.tests.custom" />
<property name="classes.exclude" value="com/vaadin/buildhelpers/**" />
<target name="jar">
<antcall target="common.jar">
- <reference torefid="extra.jar.includes" refid="empty.reference"/>
+ <reference torefid="extra.jar.includes" refid="empty.reference" />
</antcall>
</target>
<target name="publish-local" depends="jar">
@@ -26,4 +27,9 @@
<target name="clean">
<antcall target="common.clean" />
</target>
+
+ <target name="tests">
+ <antcall target="common.tests.run" />
+ </target>
+
</project> \ No newline at end of file
diff --git a/theme-compiler/ivy.xml b/theme-compiler/ivy.xml
index 45a7fd918a..be6a1d7021 100644
--- a/theme-compiler/ivy.xml
+++ b/theme-compiler/ivy.xml
@@ -10,6 +10,7 @@
<conf name="build" />
<conf name="build-provided" />
<conf name="ide" />
+ <conf name="tests" />
</configurations>
<publications>
<artifact type="jar" />
@@ -17,15 +18,18 @@
<artifact type="javadoc" ext="jar" />
</publications>
<dependencies defaultconf="*->default">
- <dependency org="org.w3c.css" name="sac" rev="1.3"/>
- <dependency org="milyn" name="flute" rev="1.3" conf="*->default"/>
+ <dependency org="org.w3c.css" name="sac" rev="1.3" />
+ <dependency org="milyn" name="flute" rev="1.3" conf="*->default" />
<dependency org="javax.servlet" name="servlet-api"
rev="2.5" />
<dependency org="com.carrotsearch" name="smartsprites"
rev="0.2.3-itmill" />
<dependency org="com.vaadin" name="vaadin-buildhelpers"
rev="${vaadin.version}" conf="build"></dependency>
-
+ <dependency org="junit" name="junit" rev="4.5"
+ conf="tests -> master" />
+ <dependency org="net.sourceforge.cssparser" name="cssparser"
+ rev="0.9.5" conf="tests,ide->master" />
</dependencies>
</ivy-module>