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

Last change on this file since 13264 was 13264, checked in by Mark Evenson, 11 years ago

Fix the GAE example so that the 'ant runserver' target works.

Now invoke ABCL to compile the necessary FASL.

The web.xml descriptor contained an incorrect absolute path for the
welcome file.

In the interest of speeding up the (presumably) morecommon use case of
merely running the example, the GAE build.xml now merely checks for
the presence of 'abcl.jar' rather than invoking the main ABCL build
each time.

File size: 2.8 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  <target name="copyjars"
21    description="Copies the App Engine and ABCL JARs to the WAR.">
22    <copy
23        todir="war/WEB-INF/lib"
24        flatten="true">
25      <fileset dir="${sdk.dir}/lib/user">
26        <include name="**/*.jar" />
27      </fileset>
28      <fileset dir="../..">
29        <include name="dist/*.jar" />
30      </fileset>
31    </copy>
32    <copy
33        todir="war/fasls">
34      <fileset dir="src">
35        <include name="*.abcl" />
36      </fileset>
37    </copy>
38  </target>
39 
40  <target name="compile"
41          depends="compile.java,compile.lisp"/>
42
43  <target name="compile.java" depends="copyjars,abcl.jar"
44    description="Compiles Java source and copies other source files to the WAR.">
45    <mkdir dir="war/WEB-INF/classes" />
46    <copy todir="war/WEB-INF/classes">
47      <fileset dir="src">
48        <exclude name="**/*.java" />
49      </fileset>
50    </copy>
51    <javac srcdir="src"
52           destdir="war/WEB-INF/classes"
53           classpathref="project.classpath"
54           includeantruntime="false"
55           debug="on" />
56  </target>
57 
58  <property name="abcl.jar" value="${basedir}/../../dist/abcl.jar"/>
59  <target name="compile.lisp" depends="abcl.jar">
60    <java fork="true"
61          classpath="${abcl.jar}"
62          classname="org.armedbear.lisp.Main"
63          inputstring="(compile-file &quot;${basedir}/war/WEB-INF/classes/first-servlet.lisp&quot;)">
64      <arg value="--noinit"/>
65    </java>
66  </target>
67
68  <available file="${abcl.jar}" property="abcl.jar.p"/>
69  <target name="abcl.jar" unless="abcl.jar.p">
70    <ant dir="${basedir}/../.." target="abcl.jar"/>
71  </target>
72
73  <target name="clean" description="Cleans all the jars and fasls.">
74    <delete>
75      <fileset dir="${basedir}">
76        <include name="**/*.jar" />
77        <include name="**/*.class" />
78        <include name="**/*.abcl" />
79      </fileset>
80    </delete>
81  </target>
82
83  <target name="runserver" 
84          depends="compile"
85    description="Starts the development server.">
86    <dev_appserver war="war" />
87  </target>
88  <target name="runserver-debug" depends="compile"
89    description="Starts the development server.">
90    <dev_appserver war="war" port="8888"/>
91  </target>
92</project>
Note: See TracBrowser for help on using the repository browser.