Changeset 13264


Ignore:
Timestamp:
04/09/11 07:12:47 (12 years ago)
Author:
Mark Evenson
Message:

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.

Location:
trunk/abcl/examples/google-app-engine
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/examples/google-app-engine/README

    r12722 r13264  
    66Running ABCL in a Google App Engine container.
    77
    8 This example shows how to run your servlet off ABCL in general
     8This example shows how to run your Java servlet off ABCL in general
    99and in Google App Engine (GAE) in particular.
    1010
     
    1313
    1414
     15Running Locally
     16---------------
     17
     181.  Download the [Google App Engine SDK for Java][1], unzipping the
     19    distribution somewhere on your filesystem
     20    (e.g. "~/work/appengine-java-sdk-1.4.3").
     21
     22[1]: http://googleappengine.googlecode.com/files/appengine-java-sdk-1.4.3.zip
     23
     242.  Simply invoke Ant on the `build.xml' in this directory with the
     25    `runserver' target, setting the `sdk.dir' JVM property to specify
     26    the location of the SDK.
     27
     28        unix$ ant -Dsdk.dir=$HOME/work/appengine-java-sdk-1.4.3/ runserver
     29
     303.  Visit `http://localhost:8080/hello' in a web browser to see the example run.
    1531
    1632
     33
     34
     35
     36
  • trunk/abcl/examples/google-app-engine/build.xml

    r12729 r13264  
    11<project default="compile">
    2 
     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  -->
    36  <property name="sdk.dir"
    4             location="../../../appengine-java-sdk" />
     7            location="${user.home}/work/appengine-java-sdk-1.4.3/" />
    58  <import file="${sdk.dir}/config/user/ant-macros.xml" />
    69
    710  <path id="project.classpath">
    8   <pathelement path="war/WEB-INF/classes" />
    9   <fileset dir="war/WEB-INF/lib">
    10     <include name="**/*.jar" />
    11   </fileset>
    12   <fileset dir="${sdk.dir}/lib">
    13     <include name="shared/**/*.jar" />
    14   </fileset>
     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>
    1518  </path>
    1619
    1720  <target name="copyjars"
    1821    description="Copies the App Engine and ABCL JARs to the WAR.">
    19   <copy
    20     todir="war/WEB-INF/lib"
    21     flatten="true">
    22     <fileset dir="${sdk.dir}/lib/user">
    23       <include name="**/*.jar" />
    24     </fileset>
    25     <fileset dir="../..">
    26       <include name="dist/*.jar" />
    27     </fileset>
    28   </copy>
    29   <copy
    30     todir="war/fasls">
    31     <fileset dir="src">
    32     <include name="*.abcl" />
    33     </fileset>
    34   </copy>
     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>
    3566  </target>
    3667
    37   <target name="compile" depends="copyjars,abcl.jar"
    38     description="Compiles Java source and copies other source files to the WAR.">
    39   <mkdir dir="war/WEB-INF/classes" />
    40   <copy todir="war/WEB-INF/classes">
    41     <fileset dir="src">
    42       <exclude name="**/*.java" />
    43     </fileset>
    44   </copy>
    45   <javac
    46     srcdir="src"
    47     destdir="war/WEB-INF/classes"
    48     classpathref="project.classpath"
    49                 includeantruntime="false"
    50     debug="on" />
    51   </target>
    52 
    53   <target name="abcl.jar">
    54     <ant dir="../.." target="abcl.jar"/>
     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"/>
    5571  </target>
    5672
    5773  <target name="clean" description="Cleans all the jars and fasls.">
    5874    <delete>
    59       <fileset dir="." includes="**/*.jar" />
    60       <fileset dir="." includes="**/*.class" />
    61       <fileset dir="." includes="**/*.abcl" />
     75      <fileset dir="${basedir}">
     76        <include name="**/*.jar" />
     77        <include name="**/*.class" />
     78        <include name="**/*.abcl" />
     79      </fileset>
    6280    </delete>
    6381  </target>
    64   <target name="runserver" depends="compile"
     82
     83  <target name="runserver"
     84          depends="compile"
    6585    description="Starts the development server.">
    66   <dev_appserver war="war" />
     86    <dev_appserver war="war" />
    6787  </target>
    6888  <target name="runserver-debug" depends="compile"
    6989    description="Starts the development server.">
    70   <dev_appserver war="war" port="8888"/>
     90    <dev_appserver war="war" port="8888"/>
    7191  </target>
    7292</project>
  • trunk/abcl/examples/google-app-engine/war/WEB-INF/web.xml

    r12231 r13264  
    1414  </servlet-mapping>
    1515  <welcome-file-list>
    16     <welcome-file>/index.html</welcome-file>
     16    <welcome-file>index.html</welcome-file>
    1717  </welcome-file-list>
    1818</web-app>
Note: See TracChangeset for help on using the changeset viewer.