1 <?xml version="1.0" encoding="utf-8" ?>
2 <project name="GWTGuestbook" default="build" basedir=".">
4 <property file="build.properties" />
6 <import file="${appengine.home}/config/user/ant-macros.xml" />
8 <path id="project.class.path">
9 <pathelement location="war/WEB-INF/classes" />
10 <pathelement location="${gwt.home}/gwt-user.jar" />
11 <!-- Add additional JARs used for unit testing -->
12 <pathelement location="${junit.home}/junit.jar" />
13 <pathelement location="${appengine.home}/lib/impl/appengine-api-stubs.jar" />
14 <pathelement location="${appengine.home}/lib/impl/appengine-local-runtime.jar" />
15 <fileset dir="war/WEB-INF/lib">
16 <include name="**/*.jar" />
20 <path id="tools.class.path">
21 <path refid="project.class.path" />
22 <pathelement location="${appengine.home}/lib/appengine-tools-api.jar" />
23 <fileset dir="${appengine.home}/lib/tools">
24 <include name="**/asm-*.jar" />
25 <include name="**/datanucleus-enhancer-*.jar" />
29 <target name="libs" description="Copy libs to WEB-INF/lib">
30 <mkdir dir="war/WEB-INF/lib" />
31 <copy todir="war/WEB-INF/lib" file="${gwt.home}/gwt-servlet.jar" />
32 <!-- Add any additional server libs that need to be copied -->
33 <copy todir="war/WEB-INF/lib" flatten="true">
34 <fileset dir="${appengine.home}/lib/user">
35 <include name="**/*.jar" />
40 <target name="javac" depends="libs" description="Compile java source">
41 <mkdir dir="war/WEB-INF/classes" />
42 <javac srcdir="src" includes="**" encoding="utf-8" destdir="war/WEB-INF/classes" source="1.5" target="1.5" nowarn="true" debug="true" debuglevel="lines,vars,source">
43 <classpath refid="project.class.path" />
46 <enhance failonerror="true">
48 <path refid="tools.class.path"/>
49 <pathelement path="war/WEB-INF/classes"/>
50 <fileset dir="war/WEB-INF/lib" includes="*.jar"/>
52 <fileset dir="war/WEB-INF/classes" includes="**/*.class"/>
54 <copy todir="war/WEB-INF/classes/META-INF" file="src/META-INF/jdoconfig.xml" />
57 <!-- can add additional arguments like -logLevel INFO or -style PRETTY -->
58 <target name="gwtc" depends="javac" description="GWT compile to JavaScript">
59 <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
61 <pathelement location="src" />
62 <path refid="project.class.path" />
63 <pathelement location="${gwt.home}/gwt-dev.jar" />
65 <!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
66 <jvmarg value="-Xmx256M" />
67 <arg value="com.google.gwt.sample.gwtguestbook.Guestbook" />
71 <target name="runserver" depends="gwtc">
72 <java classname="com.google.appengine.tools.development.DevAppServerMain"
73 classpath="${appengine.home}/lib/appengine-tools-api.jar"
79 <target name="build" depends="gwtc" description="Build this project" />
81 <target name="clean" description="Cleans this project">
82 <delete dir="war/WEB-INF/classes" failonerror="false" />
83 <delete dir="war/guestbook" failonerror="false" />
86 <target name="javac-tests" depends="libs" description="Compile unit test classes">
87 <javac srcdir="test" includes="**" encoding="utf-8" source="1.5" target="1.5" nowarn="true" debug="true" debuglevel="lines,vars,source">
88 <classpath refid="project.class.path" />
92 <target name="gwttest" description="Execute GWT unit tests">
93 <java failonerror="true" fork="true" classname="junit.textui.TestRunner">
95 <pathelement location="src" />
96 <pathelement location="test" />
97 <path refid="project.class.path" />
98 <path refid="tools.class.path" />
99 <pathelement location="${gwt.home}/gwt-dev.jar" />
100 <pathelement location="${junit.home}/junit.jar" />
102 <jvmarg value="-Xmx256M" />
103 <arg value="${test}" />
107 <target name="servertest" description="Execute server-side unit tests">
108 <junit printsummary="yes" showoutput="yes">
110 <pathelement location="src" />
111 <pathelement location="test" />
112 <path refid="project.class.path" />
113 <path refid="tools.class.path" />
114 <pathelement location="${gwt.home}/gwt-dev.jar" />
115 <pathelement location="${junit.home}/junit.jar" />
117 <jvmarg value="-Xmx256M" />
118 <test fork="yes" haltonfailure="yes" name="${test}" />