1 <project name="Sticky" default="compile">
2 <property file="build.properties" />
3 <property name="project.dir" location="." />
5 <macrodef name="compile.gwtc">
6 <attribute name="module" />
7 <attribute name="srcdir" default="src" />
8 <attribute name="wardir" />
9 <attribute name="classpathref" />
12 classname="com.google.gwt.dev.Compiler"
13 classpathref="@{classpathref}"
16 <jvmarg value="-Xmx512M"/>
18 <arg file="@{wardir}" />
19 <arg value="@{module}" />
24 <path id="backend.classpath">
25 <pathelement path="war/WEB-INF/classes" />
26 <fileset dir="war/WEB-INF/lib" includes="**/*.jar" />
27 <fileset dir="${appengine.sdk}/lib" includes="shared/**/*.jar" />
30 <path id="frontend.classpath">
31 <pathelement path="src" />
32 <fileset file="${gwt.sdk}/gwt-user.jar" />
33 <fileset file="${gwt.sdk}/gwt-dev.jar" />
36 <import file="${appengine.sdk}/config/user/ant-macros.xml" />
38 <target name="copyjars" >
39 <copy todir="war/WEB-INF/lib"
41 <fileset dir="${appengine.sdk}/lib/user"
42 includes="**/*.jar" />
44 <copy todir="war/WEB-INF/lib">
45 <fileset file="${gwt.sdk}/gwt-servlet.jar" />
49 <target name="compile.init">
50 <mkdir dir="war/WEB-INF/classes" />
53 <path id="enhancer.classpath">
54 <pathelement path="war/WEB-INF/classes" />
55 <!-- The server side code instantiates client side objects, so the enhancer
56 will need gwt user to resolve all the imports it sees. -->
57 <fileset file="${gwt.sdk}/gwt-user.jar" />
58 <fileset dir="${appengine.sdk}/lib"
59 includes="shared/**/*.jar, tools/**/*.jar, user/*.jar" />
62 <target name="compile.backend" depends="compile.init, copyjars">
64 <copy todir="war/WEB-INF/classes">
65 <fileset dir="src" includes="META-INF/**" />
67 <!-- build backend classes -->
69 destdir="war/WEB-INF/classes"
70 classpathref="backend.classpath">
71 <include name="com/google/appengine/demos/sticky/server/**" />
73 <!-- enhance classes -->
74 <taskdef name="enhance"
75 classpathref="enhancer.classpath"
76 classname="org.datanucleus.enhancer.tools.EnhancerTask" />
77 <enhance classpathref="enhancer.classpath"
79 <fileset dir="war/WEB-INF/classes"
80 includes="com/google/appengine/demos/sticky/server/**" />
84 <target name="compile.frontend">
85 <compile.gwtc module="com.google.appengine.demos.sticky.Sticky"
88 classpathref="frontend.classpath" />
91 <target name="compile" depends="compile.backend, compile.frontend"/>
93 <target name="runserver" depends="compile">
94 <dev_appserver war="${project.dir}/war" />
98 <delete dir="war/WEB-INF/classes" />
99 <delete dir="war/sticky" />
101 <fileset dir="war/WEB-INF/lib" includes="*.jar" />