Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (101 sloc) 3.74 KB
<project name="cajoleit" default="war">
<property name="appengine.sdk" location=".appengine_java_sdk"/>
<fail message="Please run the ./install-deps script.">
<condition>
<not> <and>
<isset property="appengine.sdk"/>
<available file="${appengine.sdk}/config/user/ant-macros.xml"/>
</and> </not>
</condition>
</fail>
<import file="${appengine.sdk}/config/user/ant-macros.xml"/>
<property name="debug.port" value="5005"/>
<property name="http.port" value="8070"/>
<property name="log.file" value="app.log"/>
<property name="log.days" value="2"/>
<property name="war.dir" location="war"/>
<target name="war" depends="enhance"
description="Assemble the application directory">
<copy todir="${war.dir}">
<fileset dir="html">
<exclude name="**/*~"/>
</fileset>
</copy>
<mkdir dir="${war.dir}/WEB-INF"/>
<copy file="appengine.xml" tofile="${war.dir}/WEB-INF/appengine-web.xml" />
<copy file="web.xml" todir="${war.dir}/WEB-INF" />
<mkdir dir="${war.dir}/WEB-INF/lib"/>
<copy todir="${war.dir}/WEB-INF/lib">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</copy>
<enhance_war war="${war.dir}"/>
</target>
<target name="enhance" depends="compile"
description="Enhance the classes after compilation">
<enhance_war war="${war.dir}" />
</target>
<target name="compile"
description="Compile the application servlet code">
<mkdir dir="${war.dir}/WEB-INF/classes"/>
<mkdir dir="${war.dir}/WEB-INF/lib"/>
<javac srcdir="src" destdir="${war.dir}/WEB-INF/classes" includeantruntime="false">
<compilerarg value="-Xlint:deprecation"/>
<classpath>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${appengine.sdk}/lib/user">
<include name="*.jar"/>
</fileset>
<fileset dir="${appengine.sdk}/lib/shared">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
<copy file="lib/coffee-script.js" todir="${war.dir}/WEB-INF/classes/cajoleit" />
</target>
<target name="clean"
description="Force a clean slate to rebuild">
<delete dir="${war.dir}"/>
</target>
<target name="runserver" depends="war"
description="Run the dev_appserver">
<dev_appserver war="${war.dir}" port="${http.port}"/>
</target>
<target name="dev_appserver" depends="runserver"/>
<target name="debug" depends="war"
description="Launches dev_appserver with remote debugging enabled">
<echo message="Launching dev_appserver on Web port ${http.port}, Java remote debug port ${debug.port}"/>
<dev_appserver war="${war.dir}" port="${http.port}">
<options>
<arg value="--jvm_flag=-Xdebug"/>
<arg value="--jvm_flag=-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${debug.port}"/>
</options>
</dev_appserver>
</target>
<target name="update" depends="war"
description="Uploads the application, including indexes">
<appcfg action="update" war="${war.dir}"/>
</target>
<target name="update_indexes" depends="war"
description="Uploads only the application's indexes">
<appcfg action="update_indexes" war="${war.dir}"/>
</target>
<target name="rollback" depends="war"
description="Rolls back any in-progress application update">
<appcfg action="rollback" war="${war.dir}"/>
</target>
<target name="request_logs"
description="Downloads the application's logs">
<appcfg action="request_logs" war="${war.dir}">
<options>
<arg value="--num_days=${log.days}"/>
</options>
<args>
<arg value="${log.file}"/>
</args>
</appcfg>
</target>
</project>