-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
143 lines (124 loc) · 4.8 KB
/
build.xml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<project name="mdelaurentis.com.anytable"
default="install"
xmlns:mvn="urn:maven-artifact-ant">
<property name="build.dir" location="classes"/>
<property name="test.build.dir" location="test-classes"/>
<property name="bin.dir" location="bin"/>
<property name="doc.dir" location="doc"/>
<property name="clj.src.dir" location="src/clj"/>
<property name="scripts.dir" location="scripts"/>
<property name="java.src.dir" location="src/java"/>
<property name="java.interfaces.src.dir" location="src/java-interfaces"/>
<property name="test.dir" location="test"/>
<property name="java.test.src.dir" location="${test.dir}/src/java"/>
<property name="test.lib.dir" location="${test.dir}/lib"/>
<property name="lib.dir" location="lib"/>
<path id="classpath">
<pathelement location="${clj.src.dir}"/>
<pathelement location="${build.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<path id="test.classpath">
<path refid="classpath"/>
<fileset dir="${test.lib.dir}" includes="**/*.jar"/>
<pathelement location="${test.build.dir}"/>
</path>
<path id="repl.classpath">
<path refid="test.classpath"/>
<pathelement location="/Users/mdelaurentis/src/swank-clojure"/>
</path>
<property name="repl.classpath" refid="repl.classpath"/>
<property name="test.classpath" refid="test.classpath"/>
<target name="install" depends="compile,scripts"/>
<target name="init">
<tstamp/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${bin.dir}"/>
<mkdir dir="${test.build.dir}"/>
<mkdir dir="${doc.dir}"/>
</target>
<target name="compile"
depends="init"
description="Compile Clojure and Java sources.">
<!-- The Clojure code implements the Anytable interface, so we
need to compile the interface first. -->
<javac classpathref="classpath"
srcdir="${java.interfaces.src.dir}"
destdir="${build.dir}"/>
<!-- Then compile the Clojure sources -->
<java classname="clojure.lang.Compile"
classpathref="classpath">
<sysproperty key="clojure.compile.path" value="${build.dir}"/>
<arg value="com.mdelaurentis.anytable"/>
<arg value="com.mdelaurentis.anytable.cli"/>
<arg value="com.mdelaurentis.anytable.doc"/>
<arg value="com.mdelaurentis.anytable.AnytableImpl"/>
</java>
<!-- The AnytableFactory class depends on the compiled Clojure
classes, so it needs to be compiled last. -->
<javac classpathref="classpath"
srcdir="${java.src.dir}"
destdir="${build.dir}"/>
</target>
<target name="doc" depends="init,compile">
<java classname="com.mdelaurentis.anytable.doc"
classpathref="classpath"
output="${doc.dir}/index.html"
fork="true"/>
</target>
<target name="scripts" depends="init"
description="Make a the anytable script and a repl script.">
<echo message="java -cp ${repl.classpath} clojure.main "$@""
file="bin/repl"/>
<echo message="java -cp ${repl.classpath} com.mdelaurentis.anytable.cli "$@""
file="bin/anytable"/>
<chmod file="bin/repl" perm="a+x"/>
<chmod file="bin/anytable" perm="a+x"/>
</target>
<target name="clean" description="Remove generated files">
<delete dir="${build.dir}"/>
<delete dir="${test.build.dir}"/>
<delete dir="${bin.dir}"/>
<delete file="repl"/>
<delete file="hsql.log"/>
<delete file="hsql.script"/>
<delete file="hsql.properties"/>
<delete dir="hsql.tmp"/>
<delete>
<fileset dir="${test.dir}" includes="*.diff"/>
<fileset dir="${test.dir}/actual" includes="*"/>
</delete>
</target>
<target name="compile-test" depends="compile,init"
description="Compile test sources">
<javac classpathref="test.classpath"
srcdir="${java.test.src.dir}"
destdir="test-classes"/>
</target>
<target name="test" depends="compile,compile-test"
description="Run tests (both Clojure and Java).">
<java classpathref="test.classpath" classname="clojure.main" fork="true"
failonerror="true">
<arg value="${clj.src.dir}/com/mdelaurentis/anytable/test.clj"/>
</java>
<junit>
<classpath refid="test.classpath"/>
<formatter type="plain" usefile="false"/>
<test name="AnytableTest"/>
</junit>
</target>
<target name="test-tools" depends="compile,scripts"
description="Test the command-line tools (requires make)">
<exec executable="make">
<arg value="-C"/>
<arg value="${test.dir}"/>
</exec>
</target>
<target name="clean-test-tools" depends="compile,scripts"
description="Clean up after testing command-line tools">
<exec executable="make">
<arg value="-C"/>
<arg value="${test.dir}"/>
</exec>
</target>
</project>