gwt.team.scottb | b05c900 | 2006-12-12 09:53:31 +0000 | [diff] [blame] | 1 | <project name="ant-gwt" default="build" basedir="."> |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 2 | <property name="gwt.root" location="../.." /> |
| 3 | <property name="project.tail" value="build-tools/ant-gwt" /> |
| 4 | <import file="${gwt.root}/common.ant.xml" /> |
gwt.team.scottb | b05c900 | 2006-12-12 09:53:31 +0000 | [diff] [blame] | 5 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 6 | <target name="compile" description="Compiles this project"> |
| 7 | <mkdir dir="${javac.out}" /> |
| 8 | <gwt.javac> |
| 9 | <classpath> |
| 10 | <pathelement location="${gwt.tools.lib}/apache/ant-1.6.5.jar" /> |
| 11 | </classpath> |
| 12 | </gwt.javac> |
| 13 | </target> |
gwt.team.scottb | b05c900 | 2006-12-12 09:53:31 +0000 | [diff] [blame] | 14 | |
scottb@google.com | 359e55c | 2009-03-13 00:26:54 +0000 | [diff] [blame] | 15 | <target name="compile.tests" depends="build" description="Compiles the test code for this project"> |
| 16 | <mkdir dir="${javac.junit.out}" /> |
| 17 | <gwt.javac srcdir="test" destdir="${javac.junit.out}"> |
| 18 | <classpath> |
| 19 | <pathelement location="${javac.out}" /> |
| 20 | <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" /> |
| 21 | </classpath> |
| 22 | </gwt.javac> |
| 23 | </target> |
| 24 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 25 | <target name="build" depends="compile" description="Packages this project into a jar"> |
| 26 | <mkdir dir="${gwt.build.lib}" /> |
| 27 | <gwt.jar destfile="${gwt.build.lib}/${ant.project.name}.jar"> |
| 28 | <fileset dir="src" /> |
| 29 | <fileset dir="${javac.out}" /> |
| 30 | </gwt.jar> |
| 31 | </target> |
gwt.team.scottb | b05c900 | 2006-12-12 09:53:31 +0000 | [diff] [blame] | 32 | |
scottb@google.com | 359e55c | 2009-03-13 00:26:54 +0000 | [diff] [blame] | 33 | <target name="test" depends="build, compile.tests" description="Run unit tests for this project."> |
| 34 | <!-- TODO: refactor gwt.junit so it can be reused here --> |
| 35 | <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"> |
| 36 | <classpath> |
| 37 | <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" /> |
| 38 | <pathelement location="${gwt.tools.antlib}/ant-junit-1.6.5.jar" /> |
| 39 | </classpath> |
| 40 | </taskdef> |
| 41 | |
| 42 | <echo message="Writing test results to ${junit.out}/reports for ${test.cases}" /> |
| 43 | <mkdir dir="${junit.out}/reports" /> |
| 44 | |
| 45 | <echo message="${javac.out} ${javac.junit.out}" /> |
| 46 | <junit dir="${junit.out}" fork="yes" printsummary="yes" haltonfailure="true"> |
| 47 | <classpath> |
| 48 | <pathelement location="${javac.junit.out}" /> |
| 49 | <pathelement location="${javac.out}" /> |
| 50 | <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" /> |
| 51 | </classpath> |
| 52 | |
| 53 | <formatter type="plain" /> |
| 54 | <formatter type="xml" /> |
| 55 | |
| 56 | <batchtest todir="${junit.out}/reports"> |
| 57 | <fileset dir="${javac.junit.out}" includes="**/*Test.class" /> |
| 58 | </batchtest> |
| 59 | </junit> |
| 60 | </target> |
| 61 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 62 | <target name="checkstyle" description="Static analysis of source"> |
| 63 | <gwt.checkstyle> |
| 64 | <fileset dir="src" /> |
| 65 | </gwt.checkstyle> |
| 66 | </target> |
gwt.team.scottb | b05c900 | 2006-12-12 09:53:31 +0000 | [diff] [blame] | 67 | |
fabbott@google.com | 0e2dc628 | 2008-08-22 16:09:01 +0000 | [diff] [blame] | 68 | <target name="clean" description="Cleans this project's intermediate and output files"> |
| 69 | <delete dir="${project.build}" /> |
| 70 | <delete file="${project.lib}" /> |
| 71 | </target> |
gwt.team.scottb | b05c900 | 2006-12-12 09:53:31 +0000 | [diff] [blame] | 72 | |
| 73 | </project> |