summaryrefslogtreecommitdiff
path: root/build.xml
blob: f45fa348a162485c9907c16d47661005397b1da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!-- Taken in large parts from: http://github.com/duelinmarkers/guestbook-clj -->

<project name="logikorr" basedir="." default="test">

  <property environment="env" />
  <property name="sdk.dir" location="/Users/mulk/Programme/Google App Engine for Java SDK" />
  <property name="classes.dir" value="war/WEB-INF/classes" />
  <property name="lib.dir" value="war/WEB-INF/lib" />
  <property name="src.dir" value="src" />
  <property name="test.dir" value="test" />
  <property name="devlib.dir" value="/Users/mulk/Downloads/Git" />
  <property name="clojure.dir" value="${devlib.dir}/clojure" />
  <property name="clojure_contrib.dir" value="${devlib.dir}/clojure-contrib" />
  <property name="compojure.dir" value="${devlib.dir}/compojure" />
  <property name="appengine_clj.dir" value="${devlib.dir}/appengine-clj" />
  <property name="clojure_json.dir" value="${devlib.dir}/clojure-json" />

  <import file="${sdk.dir}/config/user/ant-macros.xml"/>

  <path id="project.classpath">
    <pathelement path="${classes.dir}" />
    <fileset dir="${lib.dir}">
      <include name="**/*.jar" />
    </fileset>
    <fileset dir="${sdk.dir}/lib">
      <include name="**/*.jar" />
    </fileset>
  </path>

  <target name="clean">
    <delete dir="${classes.dir}" />
  </target>

  <target name="init">
    <mkdir dir="${classes.dir}" />
  </target>

  <target name="copyjars">
    <copy file="${sdk.dir}/lib/user/appengine-api-1.0-sdk-1.2.2.jar" todir="${lib.dir}" />
    <copy file="${compojure.dir}/compojure.jar" todir="${lib.dir}" />
    <copy file="${appengine_clj.dir}/appengine-clj.jar" todir="${lib.dir}" />
    <copy file="${clojure.dir}/clojure.jar" todir="${lib.dir}" />
    <copy file="${clojure_contrib.dir}/clojure-contrib.jar" todir="${lib.dir}" />
    <copy file="${clojure_json.dir}/clojure-json.jar" todir="${lib.dir}" />
    <copy todir="${lib.dir}">
      <filelist dir="${compojure.dir}/deps" files="commons-fileupload-1.2.1.jar commons-io-1.4.jar commons-codec-1.3.jar" />
    </copy>   
  </target>

  <target name="compile" depends="clean,init,copyjars">
    <java classname="clojure.lang.Compile" classpathref="project.classpath" failonerror="true">
      <classpath path="${src.dir}" />
      <sysproperty key="clojure.compile.path" value="${classes.dir}" />
      <arg value="logikorr.servlet" />
    </java>
  </target>

  <target name="test" description="Run the unit tests." depends="compile">
    <mkdir dir="${test.dir}" />
    <java classname="clojure.main" classpathref="project.classpath" fork="true" failonerror="true" dir="${test.dir}">
      <classpath path="${test.dir}" />
      <arg value="-e" />
      <arg value="(use 'clojure.contrib.test-is)
                  (require 'logikorr.tests)
                  (run-tests 'logikorr.tests)" />
    </java>
  </target>

  <target name="devserver" description="Run the local development webserver."  depends="compile,test">
    <dev_appserver war="war" />
  </target>

  <target name="deploy" description="Deploy to AppSpot."  depends="compile,test">
    <appcfg action="update" war="war" />
  </target>
</project>