1 | <project name="leiningen" default="jar"> |
---|
2 | <description> |
---|
3 | Pack all leiningen sources into a JAR. |
---|
4 | </description> |
---|
5 | |
---|
6 | <property name="src" location="src"/> |
---|
7 | <property name="build" location="classes"/> |
---|
8 | <property name="dist" location="dist"/> |
---|
9 | <property name="prefix" location="__PREFIX__"/> |
---|
10 | |
---|
11 | <property name="clojure.jar" |
---|
12 | location="${prefix}/clojure/lib/clojure.jar"/> |
---|
13 | <property name="clojure-contrib.jar" |
---|
14 | location="${prefix}/clojure/lib/clojure-contrib.jar"/> |
---|
15 | <property name="ant.jar" |
---|
16 | location="${prefix}/apache-ant/lib/ant.jar"/> |
---|
17 | <property name="ant-launcher.jar" |
---|
18 | location="${prefix}/apache-ant/lib/ant-launcher.jar"/> |
---|
19 | <property name="maven.jar" |
---|
20 | location="${prefix}/maven2/lib/maven-2.2.0-uber.jar"/> |
---|
21 | <property name="maven-ant-tasks.jar" |
---|
22 | location="${prefix}/maven-ant-tasks.jar"/> |
---|
23 | |
---|
24 | <!-- The JAR file to create. --> |
---|
25 | <property name="jarfile" location="leiningen.jar"/> |
---|
26 | |
---|
27 | <target name="init"> |
---|
28 | <tstamp/> |
---|
29 | <mkdir dir="${build}"/> |
---|
30 | <mkdir dir="${dist}"/> |
---|
31 | </target> |
---|
32 | |
---|
33 | <target name="clean" description="Remove generated files and directories."> |
---|
34 | <delete file="${jarfile}"/> |
---|
35 | <delete dir="${build}"/> |
---|
36 | <delete dir="${dist}"/> |
---|
37 | </target> |
---|
38 | |
---|
39 | <target name="compile_clojure" depends="init" |
---|
40 | description="Compile Clojure sources."> |
---|
41 | <java classname="clojure.lang.Compile"> |
---|
42 | <classpath> |
---|
43 | <path location="${build}"/> |
---|
44 | <path location="${src}"/> |
---|
45 | <path location="${clojure.jar}"/> |
---|
46 | <path location="${clojure-contrib.jar}"/> |
---|
47 | <path location="${ant.jar}"/> |
---|
48 | <path location="${ant-launcher.jar}"/> |
---|
49 | <path location="${maven.jar}"/> |
---|
50 | <path location="${maven-ant-tasks.jar}"/> |
---|
51 | </classpath> |
---|
52 | <sysproperty key="clojure.compile.path" value="${build}"/> |
---|
53 | <sysproperty key="java.awt.headless" value="true"/> |
---|
54 | |
---|
55 | <arg value="leiningen.clean"/> |
---|
56 | <arg value="leiningen.compile"/> |
---|
57 | <arg value="leiningen.core"/> |
---|
58 | <arg value="leiningen.deps"/> |
---|
59 | <arg value="leiningen.help"/> |
---|
60 | <arg value="leiningen.install"/> |
---|
61 | <arg value="leiningen.jar"/> |
---|
62 | <arg value="leiningen.pom"/> |
---|
63 | <arg value="leiningen.test"/> |
---|
64 | <arg value="leiningen.uberjar"/> |
---|
65 | </java> |
---|
66 | </target> |
---|
67 | |
---|
68 | <target name="jar" description="Create jar file." |
---|
69 | depends="init,compile_clojure"> |
---|
70 | <jar jarfile="${jarfile}"> |
---|
71 | <fileset dir="${src}" includes="**/*.clj"/> |
---|
72 | <fileset dir="${build}" includes="**/*.class"/> |
---|
73 | <manifest> |
---|
74 | <attribute name="Class-Path" value="."/> |
---|
75 | </manifest> |
---|
76 | </jar> |
---|
77 | </target> |
---|
78 | </project> |
---|