<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}" />
</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}" />
<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">
<target name="clean">
<antcall target="common.clean" />
</target>
+
+ <target name="tests">
+ <antcall target="common.tests.run" />
+ </target>
+
</project>
\ No newline at end of file
<conf name="build" />
<conf name="build-provided" />
<conf name="ide" />
+ <conf name="tests" />
</configurations>
<publications>
<artifact type="jar" />
<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>