source: trunk/abcl/examples/google-app-engine/build.xml

Last change on this file was 13266, checked in by Mark Evenson, 14 years ago

Add an 'update' task to upload application to GAE.

File size: 3.2 KB
Line 
1<project default="compile">
2  <!--
3       'sdk.dir' contains the location of the Google AppEngine for Java SDK
4       http://googleappengine.googlecode.com/files/appengine-java-sdk-1.4.3.zip
5  -->
6  <property name="sdk.dir" 
7            location="${user.home}/work/appengine-java-sdk-1.4.3/" />
8  <import file="${sdk.dir}/config/user/ant-macros.xml" />
9
10  <path id="project.classpath">
11    <pathelement path="war/WEB-INF/classes" />
12    <fileset dir="war/WEB-INF/lib">
13      <include name="**/*.jar" />
14    </fileset>
15    <fileset dir="${sdk.dir}/lib">
16      <include name="shared/**/*.jar" />
17    </fileset>
18  </path>
19
20  <property name="abcl.dir"
21            location="${basedir}/../.."/>
22
23  <target name="resources.copy"
24          depends="compile.lisp,abcl.jar"
25    description="Copies the necessary resources to the WAR.">
26    <copy
27        todir="war/WEB-INF/lib"
28        flatten="true">
29      <!--
30      <fileset dir="${sdk.dir}/lib/user">
31        <include name="**/*.jar" />
32      </fileset>
33      -->
34      <fileset dir="${abcl.dir}">
35        <include name="dist/*.jar" />
36      </fileset>
37    </copy>
38    <copy
39        todir="war/fasls">
40      <fileset dir="src">
41        <include name="*.abcl" />
42      </fileset>
43    </copy>
44  </target>
45 
46  <target name="compile"
47          depends="compile.java,compile.lisp"/>
48
49  <target name="compile.java" depends="resources.copy,abcl.jar"
50    description="Compiles Java source and copies other source files to the WAR.">
51    <mkdir dir="war/WEB-INF/classes" />
52    <copy todir="war/WEB-INF/classes">
53      <fileset dir="src">
54        <exclude name="**/*.java" />
55      </fileset>
56    </copy>
57    <javac srcdir="src"
58           destdir="war/WEB-INF/classes"
59           classpathref="project.classpath"
60           includeantruntime="false"
61           debug="on" />
62  </target>
63 
64  <property name="abcl.jar" value="${abcl.dir}/dist/abcl.jar"/>
65  <target name="compile.lisp" depends="abcl.jar">
66    <java fork="true"
67          classpath="${abcl.jar}"
68          classname="org.armedbear.lisp.Main"
69          inputstring="(compile-file &quot;${basedir}/src/first-servlet.lisp&quot;)">
70      <arg value="--noinit"/>
71    </java>
72  </target>
73
74  <available file="${abcl.jar}" property="abcl.jar.p"/>
75  <target name="abcl.jar" unless="abcl.jar.p">
76    <ant dir="${abcl.dir}" target="abcl.jar"/>
77  </target>
78
79  <target name="clean" description="Cleans all the jars, classes, and FASLs.">
80    <delete>
81      <fileset dir="${basedir}">
82        <include name="**/*.jar" />
83        <include name="**/*.class" />
84        <include name="**/*.abcl" />
85      </fileset>
86    </delete>
87  </target>
88
89  <target name="runserver" 
90          depends="compile,resources.copy"
91    description="Starts the development server.">
92    <dev_appserver war="war" />
93  </target>
94
95  <target name="runserver-debug" depends="compile"
96    description="Starts the development server.">
97    <dev_appserver war="war" port="8888"/>
98  </target>
99 
100  <target name="update" depends="compile"
101          description="Uploads the application to App Engine.">
102    <appcfg action="update" war="war" />
103  </target>
104   
105</project>
Note: See TracBrowser for help on using the repository browser.