blob: d243b066891e79985f113e694f20d45237ea877c [file] [log] [blame]
<project name="benchmark-viewer" default="build" basedir=".">
<!--
TODO(tobyr)
Once we have more than a single tool, this build should be re-examined
to see if several of the targets should be lifted into common.ant.xml.
The simple targets, like tests*, clean, and checkstyle are good
candidates, while the other targets depend heavily on the actual
makeup of the future tools.
-->
<property name="gwt.root" location="../.." />
<property name="project.tail" value="tools/benchmark-viewer" />
<import file="${gwt.root}/common.ant.xml" />
<!-- Platform shouldn't matter here, just picking one -->
<property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev.jar" />
<property.ensure name="gwt.user.jar" location="${gwt.build.lib}/gwt-user.jar" />
<property.ensure name="gwt.servlet.jar" location="${gwt.build.lib}/gwt-servlet.jar" />
<property name="war" location="${project.build}/war" />
<path id="project.class.path">
<pathelement location="war/WEB-INF/classes"/>
<pathelement location="${gwt.user.jar}"/>
<pathelement location="${gwt.dev.jar}"/>
<fileset dir="${war}/WEB-INF/lib" includes="**/*.jar"/>
</path>
<target name="wardir" description="Create the target war directory">
<copy todir="${war}">
<fileset dir="war" excludes="WEB-INF/classes/marker" />
</copy>
<mkdir dir="${war}/WEB-INF/lib" />
<copy todir="${war}/WEB-INF/lib" file="${gwt.servlet.jar}" />
<copy todir="${war}/WEB-INF/lib" file="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar" />
<copy todir="${war}/WEB-INF/lib" file="${gwt.tools.lib}/jfreechart/jcommon-1.0.6.jar" />
</target>
<target name="javac" depends="wardir" description="Compile java source">
<mkdir dir="${war}/WEB-INF/classes"/>
<gwt.javac destdir="${war}/WEB-INF/classes">
<classpath refid="project.class.path"/>
</gwt.javac>
<copy todir="${war}/WEB-INF/classes">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
<target name="gwtc" depends="javac" description="GWT compile to JavaScript">
<outofdate>
<sourcefiles>
<fileset dir="src"/>
<path refid="project.class.path"/>
</sourcefiles>
<targetfiles path="${war}/reportViewer/reportViewer.nocache.js" />
<sequential>
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
<pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar"/>
<pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar"/>
</classpath>
<jvmarg value="-Xmx256M"/>
<arg value="-war"/>
<arg value="${war}"/>
<arg value="com.google.gwt.benchmarks.viewer.ReportViewer"/>
</java>
</sequential>
</outofdate>
</target>
<target name="war" depends="gwtc" description="Create a war file">
<zip destfile="${gwt.build.lib}/gwt-benchmark-viewer.war" basedir="${war}"/>
</target>
<target name="build" depends="war" description="Build this project" />
<target name="clean" description="Cleans this project">
<delete dir="${war}" failonerror="false" />
<delete file="${gwt.build.lib}/gwt-benchmark-viewer.war" failonerror="false" />
</target>
<target name="checkstyle" description="Static analysis of source">
<gwt.checkstyle>
<fileset dir="src"/>
</gwt.checkstyle>
</target>
<target name="test" depends="build" />
</project>