/
build.xml
103 lines (90 loc) · 4.01 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
<!-- ********************************************************************** -->
<!-- Copyright (c) 2008-2011 Franz Inc. -->
<!-- All rights reserved. This program and the accompanying materials -->
<!-- are made available under the terms of the Eclipse Public License v1.0 -->
<!-- which accompanies this distribution, and is available at -->
<!-- http://www.eclipse.org/legal/epl-v10.html -->
<!-- ********************************************************************** -->
<project name="agraph-clj" default="clean-build">
<!-- Override these with -Dclojure.jar=... in your Ant invocation. -->
<property name="clojure.jar" location="libs/clojure-1.2.0.jar"/>
<!-- Library. -->
<property name="lib" location="../lib"/> <!-- AG Java client. -->
<property name="jarfile" location="dist/agraph-clj.jar"/>
<target name="init">
<tstamp/>
<mkdir dir="classes"/>
<mkdir dir="dist"/>
</target>
<target name="clean" description="Remove generated files and directories.">
<delete dir="classes"/>
<delete dir="dist"/>
<!-- lib is a temp dir used by lein (project.clj) -->
<delete dir="lib"/>
</target>
<target name="clean-build" depends="clean, build"
description="clean, and build jar">
</target>
<path id="agclj-libs">
<path location="${lib}/../classes"/>
<path location="${lib}/../agraph.jar"/>
<path location="${clojure.jar}"/>
</path>
<target name="compile-clojure" depends="init"
description="Compile Clojure sources.">
<java classname="clojure.lang.Compile"
failonerror="true" fork="true" taskname="clj-c">
<!-- fork because otherwise this fails when called by ../build.xml, classpath problem -->
<classpath>
<path refid="agclj-libs"/>
<path location="src"/>
<path location="classes"/>
</classpath>
<sysproperty key="clojure.compile.warn-on-reflection" value="true"/>
<sysproperty key="clojure.compile.path" value="classes"/>
<arg value="com.franz.agraph"/>
</java>
</target>
<target name="build" depends="compile-clojure"
description="Create jar file.">
<jar jarfile="${jarfile}">
<!-- <fileset dir="${src}" includes="**/*.clj"/> -->
<fileset dir="classes" includes="**/*.class"/>
<manifest>
<attribute name="Class-Path" value="."/>
</manifest>
</jar>
</target>
<macrodef name="run-clj"
description="Run clojure expression">
<attribute name="taskname" default="clj"/>
<attribute name="expr"/>
<sequential>
<java classname="clojure.main" failonerror="true" taskname="@{taskname}"
fork="true">
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.NoOpLog"/>
<classpath>
<path refid="agclj-libs"/>
<path location="src"/>
<path location="tutorial"/>
<path location="test"/>
</classpath>
<arg value="-e"/>
<arg value="@{expr}"/>
</java>
</sequential>
</macrodef>
<target name="test"
description="Run tests">
<run-clj expr="(use 'com.franz.test) (run-tests-exit 'com.franz.agraph.agtest)"/>
</target>
<target name="prepush"
description="Tests required before git push: clean, jar (test not included at this time)"
depends="clean, build, test">
</target>
<target name="test-stress-conn"
description="Stress test connections.">
<run-clj expr="(use 'com.franz.test) (run-tests-and-exit 'com.franz.agraph.stress-conn)"/>
</target>
</project>