Skip to content

Commit b855c43

Browse files
committed
Added simple build.xml file that generates jar.
Generates clojure-http-client.jar, with source & compiled code. Expects the paths to clojure.jar & clojure-contrib.jar to be specified in local.properties (which is excluded in the .gitignore, along with classes dir & the resulting jar).
1 parent 00f6ed8 commit b855c43

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
target
1+
target
2+
local.properties
3+
classes
4+
*.jar

build.xml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<project name="saxon" default="jar">
2+
<description>
3+
Clojure HTTP Client.
4+
</description>
5+
6+
<property name="build.dir" location="classes"/>
7+
<property name="source.dir" location="src"/>
8+
<property name="jar.name" location="clojure-http-client.jar"/>
9+
<property file="local.properties"/>
10+
<available property="hasclojure" file="${clojure.jar}"/>
11+
<available property="hascontrib" file="${contrib.jar}"/>
12+
13+
<target name="checkforjars" depends="init">
14+
<condition property="hasjars">
15+
<and>
16+
<isset property="hasclojure"/>
17+
<isset property="hascontrib"/>
18+
</and>
19+
</condition>
20+
</target>
21+
22+
<target name="clean" description="Remove generated classfiles">
23+
<delete dir="${build.dir}"/>
24+
</target>
25+
26+
<target name="init" depends="clean">
27+
<tstamp/>
28+
<mkdir dir="${build.dir}"/>
29+
</target>
30+
31+
<target name="compile" depends="checkforjars" description="Compile sources" if="hasjars">
32+
<java classname="clojure.lang.Compile">
33+
<classpath>
34+
<path location="${clojure.jar}"/>
35+
<path location="${contrib.jar}"/>
36+
<path location="${build.dir}"/>
37+
<path location="${source.dir}"/>
38+
</classpath>
39+
<sysproperty key="clojure.compile.path" value="${build.dir}"/>
40+
<arg value="clojure.http.client"/>
41+
<arg value="clojure.http.resourcefully"/>
42+
</java>
43+
</target>
44+
45+
<target name="jar" description="Create jar file" depends="compile">
46+
<jar jarfile="${jar.name}" index="true">
47+
<path location="MIT.txt"/>
48+
<fileset dir="${source.dir}" includes="**/*.clj"/>
49+
<fileset dir="${build.dir}" includes="**/*.class"/>
50+
</jar>
51+
</target>
52+
53+
</project>

0 commit comments

Comments
 (0)