-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathbuild.xml
256 lines (211 loc) · 11.7 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?xml version="1.0"?>
<project name="neo4j-tutorial" default="run.koans" basedir=".">
<property name="settings.dir" location="settings"/>
<import file="${settings.dir}/install-ant-eclipse.xml"/>
<import file="${settings.dir}/path.xml"/>
<import file="${settings.dir}/test.xml"/>
<import file="${settings.dir}/koan.xml"/>
<condition property="isWindows">
<os family="windows"/>
</condition>
<condition property="isUnix">
<os family="unix"/>
</condition>
<target name="-download.check">
<available property="neo4j.already.downloaded" file="${neo4j.download.dir}/${neo4j.unix.distribution}"/>
<available property="neo4j.already.downloaded" file="${neo4j.download.dir}/${neo4j.windows.distribution}"/>
<available property="jars.already.downloaded" file="${additional.jars.dir}"/>
</target>
<target name="-make.download.dirs">
<mkdir dir="${neo4j.download.dir}"/>
<mkdir dir="${additional.jars.dir}"/>
</target>
<target name="-download.additional.jars" unless="jars.already.downloaded">
<get src="http://repo.maven.apache.org/maven2/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/com/sun/jersey/jersey-bundle/1.9.1/jersey-bundle-1.9.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/commons-cli/commons-cli/1.0/commons-cli-1.0.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-filtering/1.1/maven-filtering-1.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/1.9.1/plexus-compiler-manager-1.9.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.9.1/plexus-compiler-javac-1.9.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/1.9.1/plexus-compiler-api-1.9.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar" dest="${additional.jars.dir}/"/>
<get src="http://central.maven.org/maven2/org/neo4j/test/neo4j-harness/${neo4j.version}/neo4j-harness-${neo4j.version}.jar" dest="${additional.jars.dir}/"/>
<get src="http://central.maven.org/maven2/org/neo4j/neo4j-kernel/${neo4j.version}/neo4j-kernel-${neo4j.version}-tests.jar" dest="${additional.jars.dir}/"/>
<get src="http://central.maven.org/maven2/org/neo4j/neo4j-io/${neo4j.version}/neo4j-io-${neo4j.version}-tests.jar" dest="${additional.jars.dir}/"/>
<get src="http://central.maven.org/maven2/asm/asm/3.1/asm-3.1.jar" dest="${additional.jars.dir}/"/>
</target>
<target name="-download.and.unzip.neo4j.windows" if="isWindows" depends="-make.download.dirs"
unless="neo4j.already.downloaded">
<get dest="${neo4j.download.dir}" src="http://dist.neo4j.org/${neo4j.windows.distribution}"/>
<unzip src="${neo4j.download.dir}/${neo4j.windows.distribution}" dest="${neo4j.download.dir}/"/>
</target>
<target name="-download.and.uncompress.neo4j.unix" if="isUnix" depends="-make.download.dirs"
unless="neo4j.already.downloaded">
<get dest="${neo4j.download.dir}" src="http://dist.neo4j.org/${neo4j.unix.distribution}"/>
<gunzip src="${neo4j.download.dir}/${neo4j.unix.distribution}" dest="${neo4j.download.dir}/"/>
<untar src="${neo4j.download.dir}/neo4j-community-${neo4j.version}-unix.tar" dest="${neo4j.download.dir}"/>
</target>
<target name="download.neo4j.and.test.dependencies"
depends="-download.check, -download.and.unzip.neo4j.windows, -download.and.uncompress.neo4j.unix, -download.additional.jars"
description="Downloads the most appropriate Neo4j version for the current platform">
<copy todir="${lib.dir}">
<fileset dir="${neo4j.install.dir}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${neo4j.install.dir}/system/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${additional.jars.dir}">
<include name="**/*.jar"/>
</fileset>
</copy>
</target>
<target name="clean" description="Cleans the build, but leaves binary dependencies">
<delete dir="target"/>
<delete dir="build"/>
<delete dir="out"/>
</target>
<target name="really.clean"
description="Cleans the build, removes the cached database, and removes the Neo4j binaries (but not the download)."
depends="clean">
<delete dir="${neo4j.install.dir}"/>
<delete dir="${cached.db.dir}"/>
</target>
<target name="nuke"
description="Removes everything, except sources. Use with caution, you'll have to download Neo4j again."
depends="really.clean">
<delete dir="${download.dir}"/>
<delete dir="${lib.dir}"/>
</target>
<target name="compile" description="Compile koans" depends="download.neo4j.and.test.dependencies">
<mkdir dir="${main.target}"/>
<javac srcdir="${main.src}" destdir="${main.target}" classpathref="path.libs" source="1.7"/>
<tstamp>
<format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss"/>
</tstamp>
</target>
<target name="compile.tests" description="Compile unit test classes" depends="compile">
<mkdir dir="${test.target}"/>
<javac srcdir="${test.src}" destdir="${test.target}" classpathref="path.testing" debug="true" target="1.7"/>
</target>
<target name="test" depends="compile, compile.tests">
<fileset id="unittest.source.files" dir="${test.src}">
<include name="**/*Test*.java"/>
</fileset>
<run_junit_tests testclasspath="path.testing" testfileset="unittest.source.files" outputdir="${test.reports}"/>
<fail if="tests.failed.or.errored" message="Build failed due to Unit test failures or errors"/>
</target>
<target name="compile.koans" description="Compile koans">
<mkdir dir="${koan.target}"/>
<javac srcdir="${koan.src}" destdir="${koan.target}" classpathref="path.koan" debug="true" target="1.7"/>
</target>
<target name="run.koans"
depends="test, compile.koans, run.koan1, run.koan2, run.koan3, run.koan4, run.koan5, run.koan6, run.koan7, run.koan8, run.koan9, run.koan1, run.koan11, run.koan12, run.koan13, run.koan14, run.koan15, run.advancedkoan02, run.advancedkoan03, run.advancedkoan04, run.advancedkoan05, run.advancedkoan07, run.advancedkoan09, run.advancedkoan10, run.advancedkoan11, run.advancedkoan12, run.advancedkoan13"/>
<target name="run.koan1" depends="test, compile.koans">
<koan number="1"/>
</target>
<target name="run.koan2" depends="test, compile.koans">
<koan number="2"/>
</target>
<target name="run.koan3" depends="test, compile.koans">
<koan number="3"/>
</target>
<target name="run.koan4" depends="test, compile.koans">
<koan number="4"/>
</target>
<target name="run.koan5" depends="test, compile.koans">
<koan number="5"/>
</target>
<target name="run.koan6" depends="test, compile.koans">
<koan number="6"/>
</target>
<target name="run.koan7" depends="test, compile.koans">
<koan number="7"/>
</target>
<target name="run.koan8" depends="test, compile.koans">
<koan number="8"/>
</target>
<target name="run.koan9" depends="test, compile.koans">
<koan number="9"/>
</target>
<target name="run.koan10" depends="test, compile.koans">
<koan number="10"/>
</target>
<target name="run.koan11" depends="test, compile.koans">
<koan number="11"/>
</target>
<target name="run.koan12" depends="test, compile.koans">
<koan number="12"/>
</target>
<target name="run.koan13" depends="test, compile.koans">
<koan number="13"/>
</target>
<target name="run.koan14" depends="test, compile.koans">
<koan number="14"/>
</target>
<target name="run.koan15" depends="test, compile.koans">
<koan number="15"/>
</target>
<target name="run.advancedkoan02" depends="test, compile.koans">
<advancedkoan number="02"/>
</target>
<target name="run.advancedkoan03" depends="test, compile.koans">
<advancedkoan number="03"/>
</target>
<target name="run.advancedkoan04" depends="test, compile.koans">
<advancedkoan number="04"/>
</target>
<target name="run.advancedkoan05" depends="test, compile.koans">
<advancedkoan number="05"/>
</target>
<target name="run.advancedkoan07" depends="test, compile.koans">
<advancedkoan number="07"/>
</target>
<target name="run.advancedkoan09" depends="test, compile.koans">
<advancedkoan number="09"/>
</target>
<target name="run.advancedkoan10" depends="test, compile.koans">
<advancedkoan number="10"/>
</target>
<target name="run.advancedkoan11" depends="test, compile.koans">
<advancedkoan number="11"/>
</target>
<target name="run.advancedkoan12" depends="test, compile.koans">
<advancedkoan number="12"/>
</target>
<target name="run.advancedkoan13" depends="test, compile.koans">
<advancedkoan number="13"/>
</target>
<target name="generate.eclipse.project" depends="-install.ant-eclipse">
<mkdir dir="${main.target}"/>
<mkdir dir="${test.target}"/>
<mkdir dir="${koan.target}"/>
<eclipse mode="java">
<settings>
<jdtcore compilercompliance="6.0"/>
</settings>
<project name="neo4j-tutorial"/>
<classpath>
<library pathref="path.libs"/>
<source path="${main.src}"/>
<source path="${test.src}"/>
<source path="${koan.src}"/>
<source path="${koan.resource}"/>
<output path="${target}"/>
</classpath>
</eclipse>
</target>
<target name="remove.snippets" description="Remove the snippets">
<replaceregexp match="// SNIPPET_START(.+?)// SNIPPET_END" replace="" flags="gis">
<fileset dir="${koan.src}" includes="**/*.java"/>
</replaceregexp>
</target>
</project>