Catch exception related to number field handling in older SDK.
[gae-samples.git] / gwtguestbook-namespaces / build.xml
blob4e65c798a3163b242353b5883c5e75dd6dab4a97
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" />
17     </fileset>
18   </path>
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" />
26       </fileset>
27     </path>
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" />
36       </fileset>
37     </copy>
38   </target>
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" />
44     </javac>
45     
46     <enhance failonerror="true">
47       <classpath>
48         <path refid="tools.class.path"/>
49         <pathelement path="war/WEB-INF/classes"/>
50         <fileset dir="war/WEB-INF/lib" includes="*.jar"/>
51       </classpath>
52       <fileset dir="war/WEB-INF/classes" includes="**/*.class"/>
53     </enhance>
54     <copy todir="war/WEB-INF/classes/META-INF" file="src/META-INF/jdoconfig.xml" />
55   </target>
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">
60       <classpath>
61         <pathelement location="src" />
62         <path refid="project.class.path" />
63         <pathelement location="${gwt.home}/gwt-dev.jar" />
64       </classpath>
65       <!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
66       <jvmarg value="-Xmx256M" />
67       <arg value="com.google.gwt.sample.gwtguestbook.Guestbook" />
68     </java>
69   </target>
71   <target name="runserver" depends="gwtc">
72     <java classname="com.google.appengine.tools.development.DevAppServerMain"
73           classpath="${appengine.home}/lib/appengine-tools-api.jar"
74           fork="true" >
75       <arg value="war" />
76     </java>
77   </target>
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" />
84   </target>
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" />
89     </javac>
90   </target>
92   <target name="gwttest" description="Execute GWT unit tests">
93     <java failonerror="true" fork="true" classname="junit.textui.TestRunner">
94       <classpath>
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" />
101       </classpath>
102       <jvmarg value="-Xmx256M" />
103       <arg value="${test}" />
104     </java>
105   </target>
107   <target name="servertest" description="Execute server-side unit tests">
108     <junit printsummary="yes" showoutput="yes">
109       <classpath>
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" />
116       </classpath>
117       <jvmarg value="-Xmx256M" />
118       <test fork="yes" haltonfailure="yes" name="${test}" />
119     </junit>
120   </target>
122 </project>