blob: 3cb304537b2ba96149842f28f6a9a20d689002bb [file] [log] [blame]
<project name="user" default="build" basedir=".">
<property name="gwt.root" location=".." />
<property name="project.tail" value="user" />
<property name="test.args" value="" />
<import file="${gwt.root}/common.ant.xml" />
<!--
Default hosted mode test cases
-->
<fileset id="default.hosted.tests" dir="${javac.junit.out}"
includes="${gwt.junit.testcase.includes}" />
<!--
Default web mode test cases
-->
<fileset id="default.web.tests" dir="${javac.junit.out}"
includes="${gwt.junit.testcase.includes}" />
<!-- Platform shouldn't matter here, just picking one -->
<property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev-linux.jar" />
<target name="compile" description="Compile all class files">
<mkdir dir="${javac.out}" />
<gwt.javac>
<classpath>
<pathelement location="${gwt.tools.lib}/tomcat/servlet-api-2.4.jar" />
<pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
<pathelement location="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar" />
<pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
<pathelement location="${gwt.dev.jar}" />
</classpath>
</gwt.javac>
<!-- Build the BrowserManagerServer_Stub to allow remote browser testing -->
<rmic base="${javac.out}"
classname="com.google.gwt.junit.remote.BrowserManagerServer"
stubversion="1.2"/>
</target>
<!--
Compile test code for dev/core to pick up TypeOracleTestUtils and others.
-->
<target name="compile.dev.core.tests" description="Compiles test dependencies in dev/core">
<gwt.ant dir="../dev/core" target="compile.tests" />
</target>
<target name="compile.tests" depends="compile.dev.core.tests" description="Compiles the test code for this project">
<mkdir dir="${javac.junit.out}" />
<gwt.javac srcdir="test" excludes="com/google/gwt/langtest/**" destdir="${javac.junit.out}">
<classpath>
<pathelement location="${javac.out}" />
<pathelement location="${gwt.build}/out/dev/core/bin-test" />
<pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
<pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
<pathelement location="${gwt.dev.staging.jar}" />
</classpath>
</gwt.javac>
</target>
<target name="build" depends="compile" description="Build and package this project">
<mkdir dir="${gwt.build.lib}" />
<gwt.jar>
<fileset dir="src" excludes="**/package.html" />
<fileset dir="super" excludes="**/package.html" />
<fileset dir="${javac.out}" />
<zipfileset src="${gwt.tools.lib}/tomcat/servlet-api-2.4.jar" />
</gwt.jar>
</target>
<target name="checkstyle" description="Static analysis of source">
<gwt.checkstyle>
<fileset dir="src" />
<fileset dir="super/com/google/gwt/emul" />
<fileset dir="super/com/google/gwt/junit/translatable" />
</gwt.checkstyle>
</target>
<target name="remoteweb-test" description="Run a remoteweb test at the given host and path" if="gwt.remote.browsers">
<echo message="Performing remote browser testing at ${gwt.remote.browsers}" />
<gwt.junit test.args="${test.args} -out www -remoteweb ${gwt.remote.browsers}" test.out="${junit.out}/remoteweb" test.cases="default.web.tests" >
<extraclasspaths>
<pathelement location="${gwt.build}/out/dev/core/bin-test" />
</extraclasspaths>
</gwt.junit>
</target>
<target name="selenium-test" description="Run a remote test using Selenium RC test at the given host and path" if="gwt.selenium.hosts">
<echo message="Performing remote browser testing using Selenium RC at ${gwt.selenium.hosts}" />
<gwt.junit test.args="${test.args} -out www -selenium ${gwt.selenium.hosts}" test.out="${junit.out}/selenium" test.cases="default.web.tests" >
<extraclasspaths>
<pathelement location="${gwt.build}/out/dev/core/bin-test" />
</extraclasspaths>
</gwt.junit>
</target>
<target name="test.hosted" depends="compile, compile.tests" description="Run only hosted-mode tests for this project.">
<gwt.junit test.args="${test.args}" test.out="${junit.out}/${build.host.platform}-hosted-mode" test.cases="default.hosted.tests" >
<extraclasspaths>
<pathelement location="${gwt.build}/out/dev/core/bin-test" />
</extraclasspaths>
</gwt.junit>
</target>
<target name="test.web" depends="compile, compile.tests" description="Run only web-mode tests for this project.">
<gwt.junit test.args="${test.args} -out www -web" test.out="${junit.out}/${build.host.platform}-web-mode" test.cases="default.web.tests" >
<extraclasspaths>
<pathelement location="${gwt.build}/out/dev/core/bin-test" />
</extraclasspaths>
</gwt.junit>
</target>
<target name="test" depends="compile, compile.tests" description="Run hosted-mode, web-mode, remoteweb, and selenium tests for this project.">
<property.ensure name="distro.built" location="${gwt.dev.staging.jar}" message="GWT must be built before performing any tests. This can be fixed by running ant in the ${gwt.root} directory." />
<!--
Run hosted and web mode tests for the platform on which this build
is executing
-->
<limit failonerror="true" hours="2">
<parallel threadsPerProcessor="1">
<!-- selenium-test is a no-op unless gwt.selenium.hosts is defined -->
<antcall target="selenium-test"/>
<!-- remoteweb-test is a no-op unless gwt.remote.browsers is defined -->
<antcall target="remoteweb-test"/>
<antcall target="test.hosted"/>
<antcall target="test.web"/>
</parallel>
</limit>
</target>
<target name="clean" description="Cleans this project's intermediate and output files">
<delete dir="${project.build}" />
<delete file="${project.lib}" />
</target>
</project>