/
build.xml
205 lines (185 loc) · 8.77 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<project name="agraph-java-client" default="clean-build">
<property environment="env"/>
<!-- if these AGRAPH env vars are blank, the java test code will look elsewhere -->
<property name="env.AGRAPH_HOST" value=""/>
<property name="env.AGRAPH_PORT" value=""/>
<property name="env.root" value=""/>
<property name="env.version" value=""/>
<!-- Library. -->
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="build" location="classes"/>
<property name="jarfile" location="agraph.jar"/>
<path id="classpath">
<path location="${lib}/junit-4.8.1.jar"/>
<path location="${lib}/sesame-2.2.4/commons-codec-1.3.jar"/>
<path location="${lib}/sesame-2.2.4/commons-httpclient-3.1.jar"/>
<path location="${lib}/sesame-2.2.4/commons-logging-1.1.1.jar"/>
<path location="${lib}/sesame-2.2.4/openrdf-sesame-2.2.4-onejar.jar"/>
<path location="${lib}/sesame-2.2.4/slf4j-api-1.5.8.jar"/>
<path location="${lib}/sesame-2.2.4/slf4j-nop-1.5.8.jar"/>
<path location="${lib}/jena-2.6.0/arq-extra.jar"/>
<path location="${lib}/jena-2.6.0/arq.jar"/>
<path location="${lib}/jena-2.6.0/icu4j_3_4.jar"/>
<path location="${lib}/jena-2.6.0/iri.jar"/>
<path location="${lib}/jena-2.6.0/jena.jar"/>
<path location="${lib}/jena-2.6.0/jenatest.jar"/>
<path location="${lib}/jena-2.6.0/json.jar"/>
<path location="${lib}/jena-2.6.0/log4j-1.2.12.jar"/>
<path location="${lib}/jena-2.6.0/lucene-core-2.3.1.jar"/>
<path location="${lib}/jena-2.6.0/stax-api-1.0.jar"/>
<path location="${lib}/jena-2.6.0/wstx-asl-3.0.0.jar"/>
<path location="${lib}/jena-2.6.0/xercesImpl.jar"/>
</path>
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
</target>
<target name="clean"
description="Remove generated files and directories.">
<delete dir="${build}"/>
<delete file="${jarfile}"/>
<ant dir="clojure" target="clean" inheritall="false"/>
</target>
<target name="compile" depends="init"
description="Compile Java sources.">
<javac srcdir="${src}" destdir="${build}" encoding="utf8"
debug="true"
includes="**/*.java"
classpathref="classpath"/>
</target>
<manifestclasspath property="mf.path" jarfile="${jarfile}">
<classpath refid="classpath"/>
</manifestclasspath>
<target name="build"
description="Create jar file."
depends="clean, compile">
<tstamp prefix="jar">
<format property="datestamp" pattern="yyyy-MM-dd H:mm"/>
</tstamp>
<jar jarfile="${jarfile}">
<fileset dir="${build}" includes="**/*.class">
<exclude name="tutorial/**"/>
<exclude name="test/**"/>
<exclude name="*.class"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="AllegroGraph Java Client"/>
<attribute name="Implementation-Version" value="${env.version}"/>
<attribute name="Implementation-Vendor" value="Franz, Inc."/>
<attribute name="Implementation-URL" value="http://www.franz.com/agraph/"/>
<attribute name="Built-At" value="${jar.datestamp}"/>
<attribute name="Class-Path" value="${mf.path}"/>
</manifest>
</jar>
</target>
<target name="clean-build" depends="clean, build"
description="clean, and build jar">
</target>
<target name="prepush"
description="Tests required before git push: clean, build, and run Java and Clojure client tests"
depends="clean-build, test-prepush">
<ant dir="clojure" target="prepush" inheritall="false"/>
</target>
<macrodef name="run-java"
description="Run java class">
<attribute name="tasknamex" default="java"/>
<attribute name="classname"/>
<attribute name="arg"/>
<attribute name="maxmemory" default="128m"/>
<sequential>
<property name="log" value="info"/>
<java classname="@{classname}" failonerror="true" taskname="@{tasknamex}"
fork="true" maxmemory="@{maxmemory}">
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.SimpleLog"/>
<sysproperty key="org.apache.commons.logging.simplelog.defaultlog"
value="${log}"/>
<sysproperty key="org.apache.commons.logging.simplelog.log.org"
value="info"/>
<sysproperty key="org.apache.commons.logging.simplelog.log.httpclient"
value="info"/>
<sysproperty key="org.apache.commons.logging.simplelog.showlogname"
value="true"/>
<sysproperty key="AGRAPH_HOST" value="${env.AGRAPH_HOST}"/>
<sysproperty key="AGRAPH_PORT" value="${env.AGRAPH_PORT}"/>
<sysproperty key="AGRAPH_ROOT" value="${env.root}"/>
<classpath>
<path refid="classpath"/>
<path location="classes"/>
</classpath>
<arg value="@{arg}"/>
</java>
</sequential>
</macrodef>
<target name="test-junit"
depends="compile"
description="Run unit tests (use -Dcat=Prepush, Broken, or Stress)
(or use -Dtest=test.stress.TransactionStressTest)">
<property name="cat" value="Prepush"/>
<property name="prefix" value="test.TestSuites$"/>
<property name="test" value="${prefix}${cat}"/>
<property name="log" value="warn"/>
<junit printsummary="no" haltonfailure="yes">
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.SimpleLog"/>
<sysproperty key="org.apache.commons.logging.simplelog.defaultlog"
value="${log}"/>
<sysproperty key="org.apache.commons.logging.simplelog.log.org"
value="warn"/>
<sysproperty key="org.apache.commons.logging.simplelog.log.httpclient"
value="warn"/>
<sysproperty key="org.apache.commons.logging.simplelog.showlogname"
value="true"/>
<sysproperty key="AGRAPH_HOST" value="${env.AGRAPH_HOST}"/>
<sysproperty key="AGRAPH_PORT" value="${env.AGRAPH_PORT}"/>
<sysproperty key="AGRAPH_ROOT" value="${env.root}"/>
<classpath>
<path refid="classpath"/>
<path location="classes"/>
</classpath>
<formatter type="plain" usefile="no"/>
<test name="${test}"/>
</junit>
</target>
<target name="test-prepush"
depends="compile"
description="run prepush tests">
<run-java tasknamex="test" classname="test.TestRunner" arg="test.TestSuites$Prepush"/>
</target>
<target name="test-broken"
depends="compile"
description="run tests known to be broken">
<run-java tasknamex="test" classname="org.junit.runner.JUnitCore" arg="test.TestSuites$Broken"/>
</target>
<target name="test-stress"
depends="compile"
description="long-running stress tests">
<run-java tasknamex="test" classname="org.junit.runner.JUnitCore" arg="test.TestSuites$Stress"/>
</target>
<target name="test-temp"
depends="compile"
description="">
<property name="cat" value="Temp"/>
<property name="prefix" value="test.TestSuites$"/>
<property name="test" value="${prefix}${cat}"/>
<run-java tasknamex="test" classname="test.TestRunner" arg="${test}"/>
</target>
<target name="test-stress-events"
depends="compile"
description="Run test.stress.Events">
<run-java tasknamex="ev" classname="test.stress.Events" arg="" maxmemory="512m"/>
</target>
<target name="tutorial"
depends="compile"
description="Run tutorial example. Use -Dexample=5 for a specific example, default is all">
<property name="example" value="all"/>
<run-java tasknamex="tutorial" classname="tutorial.TutorialExamples" arg="${example}"/>
</target>
<target name="jena-tutorial"
depends="compile"
description="Run jena examples. Use -Dexample=5 for a specific example, default is all">
<property name="example" value="all"/>
<run-java tasknamex="jena-tutorial" classname="tutorial.JenaTutorialExamples" arg="${example}"/>
</target>
</project>