1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <project xmlns="antlib:org.apache.tools.ant" |
---|
3 | name="abcl-master" default="abcl.wrapper" basedir="."> |
---|
4 | <description>Compiling, testing, and packaging Armed Bear Common Lisp</description> |
---|
5 | |
---|
6 | <target name="abcl" depends="abcl.wrapper,abcl-contrib.jar"/> |
---|
7 | |
---|
8 | <target name="help"> |
---|
9 | <echo> |
---|
10 | Main Ant targets: |
---|
11 | |
---|
12 | abcl.wrapper |
---|
13 | -- [default] create executable wrapper for ABCL. |
---|
14 | abcl.compile |
---|
15 | -- compile ABCL to ${build.classes.dir}. |
---|
16 | abcl.jar |
---|
17 | -- create packaged ${abcl.jar.path}. |
---|
18 | abcl.source.zip abcl.source.tar |
---|
19 | -- create source distributions in ${dist.dir}. |
---|
20 | abcl.clean |
---|
21 | -- remove ABCL intermediate files |
---|
22 | </echo> |
---|
23 | |
---|
24 | <echo> |
---|
25 | For help on the automatic tests available, use the Ant target 'help.test'. |
---|
26 | </echo> |
---|
27 | </target> |
---|
28 | |
---|
29 | <!-- Behavior of the build system can be customized via setting |
---|
30 | properties in the 'abcl.properties' file. --> |
---|
31 | <property file="abcl.properties"/> |
---|
32 | |
---|
33 | <property name="build.dir" |
---|
34 | value="${basedir}/build"/> |
---|
35 | <property name="build.classes.dir" |
---|
36 | value="${build.dir}/classes"/> |
---|
37 | <property name="src.dir" |
---|
38 | value="${basedir}/src"/> |
---|
39 | <property name="dist.dir" |
---|
40 | value="${basedir}/dist"/> |
---|
41 | <property name="abcl.jar.path" |
---|
42 | value="${dist.dir}/abcl.jar"/> |
---|
43 | <property name="abcl-aio.jar.path" |
---|
44 | value="${dist.dir}/abcl-aio.jar"/> |
---|
45 | <property name="abcl.ext.dir" |
---|
46 | value="${basedir}/ext"/> |
---|
47 | |
---|
48 | <property name="abcl.runtime.jar.path" |
---|
49 | value="${abcl.jar.path}"/> |
---|
50 | |
---|
51 | <!-- TODO verify me --> |
---|
52 | <fail message="Please build using Ant 1.7.1 or higher."> |
---|
53 | <condition> |
---|
54 | <not> |
---|
55 | <antversion atleast="1.7.1"/> |
---|
56 | </not> |
---|
57 | </condition> |
---|
58 | </fail> |
---|
59 | |
---|
60 | <!-- Deprecated. Checks if JSR-223 support is available. Should always be true. Unused. D --> |
---|
61 | <available property="abcl.jsr-223.p" |
---|
62 | classname="javax.script.ScriptEngine"/> |
---|
63 | |
---|
64 | <patternset id="abcl.source.java"> |
---|
65 | <include name="org/armedbear/lisp/*.java"/> |
---|
66 | <include name="org/armedbear/lisp/util/*.java"/> |
---|
67 | <include name="org/armedbear/lisp/protocol/*.java"/> |
---|
68 | <include name="org/armedbear/lisp/java/**/*.java"/> |
---|
69 | <include name="org/armedbear/lisp/scripting/*.java" /> |
---|
70 | <include name="org/armedbear/lisp/scripting/util/*.java" /> |
---|
71 | <include name="org/armedbear/Main.java"/> |
---|
72 | <include name="org/abcl/**/*.java"/> |
---|
73 | </patternset> |
---|
74 | |
---|
75 | <patternset id="abcl.source.lisp"> |
---|
76 | <include name="org/armedbear/lisp/*.lisp"/> |
---|
77 | <include name="org/armedbear/lisp/java/**/*.lisp"/> |
---|
78 | <include name="org/armedbear/lisp/tests/*.lisp"/> |
---|
79 | <exclude name="org/armedbear/lisp/j.lisp"/> |
---|
80 | <include name="org/armedbear/lisp/scripting/lisp/*.lisp"/> |
---|
81 | </patternset> |
---|
82 | |
---|
83 | <!-- Lisp files required at runtime --> |
---|
84 | <patternset id="abcl.source.lisp.dist"> |
---|
85 | <include name="org/armedbear/lisp/boot.lisp"/> |
---|
86 | <include name="org/armedbear/lisp/scripting/lisp/*.lisp" /> |
---|
87 | <include if="abcl.compile.lisp.skip" |
---|
88 | name="**/*.lisp" /> |
---|
89 | </patternset> |
---|
90 | |
---|
91 | <patternset id="abcl.objects"> |
---|
92 | <!-- "system.lisp" is dynamically created by COMPILE-fSYSTEM --> |
---|
93 | <include name="org/armedbear/lisp/system.lisp"/> |
---|
94 | <include name="org/armedbear/lisp/**/*.class"/> |
---|
95 | <include name="org/armedbear/lisp/**/*.cls"/> |
---|
96 | <include name="org/armedbear/lisp/**/*.abcl"/> |
---|
97 | <include name="org/abcl/util/*.class"/> |
---|
98 | <include name="org/armedbear/lisp/version"/> |
---|
99 | <include name="org/armedbear/lisp/scripting/*.class"/> |
---|
100 | <include name="org/armedbear/lisp/scripting/util/*.class"/> |
---|
101 | <patternset refid="abcl.source.lisp.dist"/> |
---|
102 | <include name="abcl.rdf"/> |
---|
103 | <include name="abcl.asd"/> |
---|
104 | <include name="README"/> |
---|
105 | <include name="build.xml"/> |
---|
106 | <include name="abcl.properties.in"/> |
---|
107 | <include name="abcl.in"/> |
---|
108 | <include name="abcl.bat.in"/> |
---|
109 | </patternset> |
---|
110 | |
---|
111 | <path id="abcl.classpath.dist"> |
---|
112 | <pathelement location="${abcl.jar.path}"/> |
---|
113 | </path> |
---|
114 | |
---|
115 | <path id="abcl.classpath.build"> |
---|
116 | <pathelement location="${build.classes.dir}"/> |
---|
117 | </path> |
---|
118 | |
---|
119 | <target name="abcl.compile" depends="abcl.clean.maybe,abcl.compile.lisp"> |
---|
120 | <echo>Compiled ABCL with Java version: ${java.version}</echo> |
---|
121 | </target> |
---|
122 | |
---|
123 | <target name="abcl.clean.maybe" unless="abcl.build.incremental"> |
---|
124 | <echo>Cleaning all intermediate compilation artifacts.</echo> |
---|
125 | <echo>Setting 'abcl.build.incremental' enables incremental compilation.</echo> |
---|
126 | <antcall target="abcl.clean"/> |
---|
127 | </target> |
---|
128 | |
---|
129 | <target name="abcl.init"> |
---|
130 | <tstamp> |
---|
131 | <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/> |
---|
132 | </tstamp> |
---|
133 | |
---|
134 | <tstamp> |
---|
135 | <format property="build.stamp" pattern="yyyymmdd-HHmm"/> |
---|
136 | </tstamp> |
---|
137 | |
---|
138 | <property name="abcl.test.log.file" |
---|
139 | value="abcl-test-${build.stamp}.log"/> |
---|
140 | |
---|
141 | <property name="java.path" |
---|
142 | value="${java.home}/bin/java"/> |
---|
143 | |
---|
144 | <!-- Deprecated. Two main types of build environents: 'unix' or 'windows'. --> |
---|
145 | <condition property="unix"> |
---|
146 | <or> |
---|
147 | <os family="unix"/> |
---|
148 | <os family="mac"/> |
---|
149 | </or> |
---|
150 | </condition> |
---|
151 | <condition property="windows"> |
---|
152 | <os family="windows"/> |
---|
153 | </condition> |
---|
154 | |
---|
155 | <!-- Deprecated. --> |
---|
156 | <available file="${src.dir}org/armedbear/lisp/Interpreter.java" |
---|
157 | property="abcl.lisp.p"/> |
---|
158 | |
---|
159 | <echo>java.version: ${java.version}</echo> |
---|
160 | <condition property="abcl.java.version.p"> |
---|
161 | <!-- Unsupported as of abcl-1.5.0 due to lack of open jdk |
---|
162 | <matches string="${java.version}" |
---|
163 | pattern="1\.5"/> |
---|
164 | --> |
---|
165 | <or> |
---|
166 | <!-- Don't use 1.6.0_09 or earlier. --> |
---|
167 | <matches string="${java.version}" |
---|
168 | pattern="1\.6\.0_[1-9][0-9]"/> |
---|
169 | <!-- 1.7.0_04 works much better. --> |
---|
170 | <matches string="${java.version}" |
---|
171 | pattern="1\.7\.0_(0[4-9])|([1-9][0-9])"/> |
---|
172 | <matches string="${java.version}" |
---|
173 | pattern="1\.8\.0"/> |
---|
174 | </or> |
---|
175 | </condition> |
---|
176 | |
---|
177 | </target> |
---|
178 | |
---|
179 | <target name="abcl.java.warning" |
---|
180 | depends="abcl.init" |
---|
181 | unless="abcl.java.version.p"> |
---|
182 | <echo>WARNING: Use of Java version ${java.version} not recommended.</echo> |
---|
183 | </target> |
---|
184 | |
---|
185 | <!-- Deprecated. JSR-223 is always present --> |
---|
186 | <target name="abcl.jsr-223.notice" |
---|
187 | depends="abcl.init" |
---|
188 | unless="abcl.jsr-223.p"> |
---|
189 | <echo> |
---|
190 | Notice: JSR-223 support won't be built since it is not |
---|
191 | supported, neither natively by your JVM nor by |
---|
192 | libraries in the CLASSPATH. |
---|
193 | </echo> |
---|
194 | </target> |
---|
195 | |
---|
196 | <target name="abcl.compile.java" |
---|
197 | depends="abcl.init,abcl.java.warning"> |
---|
198 | <mkdir dir="${build.dir}"/> |
---|
199 | <mkdir dir="${build.classes.dir}"/> |
---|
200 | <!-- abcl-1.5.0: Stock build for Java 1.6 (aka Java 2) container --> |
---|
201 | <javac destdir="${build.classes.dir}" |
---|
202 | debug="true" |
---|
203 | target="1.6" |
---|
204 | source="1.6" |
---|
205 | includeantruntime="false" |
---|
206 | failonerror="true"> |
---|
207 | <src path="${src.dir}"/> |
---|
208 | <patternset refid="abcl.source.java"/> |
---|
209 | </javac> |
---|
210 | </target> |
---|
211 | |
---|
212 | <!-- Additional artifacts to stage relative to Ant ${basedir} --> |
---|
213 | <patternset id="abcl.stage"> |
---|
214 | <include name="README"/> |
---|
215 | <include name="COPYING"/> |
---|
216 | <include name="abcl.rdf"/> |
---|
217 | <include name="abcl.asd"/> |
---|
218 | <include name="build.xml"/> |
---|
219 | <include name="abcl.properties.in"/> <!--TODO: massage into abcl.properties at build-time --> |
---|
220 | <include name="abcl.bat"/> |
---|
221 | <include name="abcl.bat.in"/> |
---|
222 | </patternset> |
---|
223 | |
---|
224 | <target name="abcl.stage" |
---|
225 | depends="abcl.copy.lisp"> |
---|
226 | <copy todir="${build.classes.dir}" preservelastmodified="yes" |
---|
227 | verbose="true"> |
---|
228 | <fileset dir="${basedir}/"> |
---|
229 | <patternset refid="abcl.stage"/> |
---|
230 | </fileset> |
---|
231 | </copy> |
---|
232 | </target> |
---|
233 | |
---|
234 | <target name="abcl.copy.lisp"> |
---|
235 | <copy todir="${build.classes.dir}" preservelastmodified="yes"> |
---|
236 | <fileset dir="${src.dir}"> |
---|
237 | <patternset refid="abcl.source.lisp.dist"/> |
---|
238 | </fileset> |
---|
239 | </copy> |
---|
240 | </target> |
---|
241 | |
---|
242 | <!-- Adjust the patternset for ABCL source to use the much faster |
---|
243 | Ant 'uptodate' task to check if we need to compile the system |
---|
244 | fasls. Highly inter-dependent with the behavior specified in |
---|
245 | 'compile-system.lisp', i.e. files not listed in |
---|
246 | there should NOT occur here. --> |
---|
247 | <patternset id="abcl.source.lisp.fasls"> |
---|
248 | <patternset refid="abcl.source.lisp"/> |
---|
249 | <exclude name="org/armedbear/lisp/scripting/**/*.lisp"/> |
---|
250 | <exclude name="org/armedbear/lisp/boot.lisp"/> |
---|
251 | <exclude name="org/armedbear/lisp/emacs.lisp"/> |
---|
252 | <exclude name="org/armedbear/lisp/run-benchmarks.lisp"/> |
---|
253 | </patternset> |
---|
254 | |
---|
255 | <target name="abcl.fasls.uptodate"> |
---|
256 | <uptodate property="abcl.fasls.uptodate.p" value="true"> |
---|
257 | <srcfiles dir="${src.dir}"> |
---|
258 | <patternset refid="abcl.source.lisp.fasls"/> |
---|
259 | </srcfiles> |
---|
260 | <mapper type="glob" from="*.lisp" to="${build.classes.dir}/*.abcl"/> |
---|
261 | </uptodate> |
---|
262 | </target> |
---|
263 | |
---|
264 | <path id="abcl.home.dir.path"> |
---|
265 | <path location="${src.dir}/org/armedbear/lisp/"/> |
---|
266 | </path> |
---|
267 | <pathconvert property="abcl.home.dir" refid="abcl.home.dir.path"/> |
---|
268 | |
---|
269 | <path id="abcl.lisp.output.path" |
---|
270 | location="${build.classes.dir}/org/armedbear/lisp/"/> |
---|
271 | <pathconvert dirsep="/" property="abcl.lisp.output" refid="abcl.lisp.output.path"/> |
---|
272 | |
---|
273 | <property name="system.lisp.file" |
---|
274 | value="${build.classes.dir}/org/armedbear/lisp/system.lisp"/> |
---|
275 | |
---|
276 | <target name="abcl.compile.lisp" |
---|
277 | depends="abcl.stage,abcl.compile.java,abcl.system.update.maybe,abcl.fasls.uptodate" |
---|
278 | unless="abcl.fasls.uptodate.p"> |
---|
279 | <abcl.compile.lisp/> |
---|
280 | </target> |
---|
281 | |
---|
282 | <macrodef name="abcl.compile.lisp"> |
---|
283 | <element name="additional.jvmarg" optional="true"/> |
---|
284 | <sequential> |
---|
285 | <echo> |
---|
286 | Compiling Lisp system |
---|
287 | from ${abcl.home.dir} |
---|
288 | to ${abcl.lisp.output}</echo> |
---|
289 | |
---|
290 | <!-- Not good if ${abcl.home.dir} == ${abcl.lisp.output} --> |
---|
291 | <delete> |
---|
292 | <fileset dir="${abcl.home.dir}" includes="**/*.abcl **/*.cls **/*._"/> |
---|
293 | </delete> |
---|
294 | <java classpath="${build.classes.dir}" |
---|
295 | fork="true" |
---|
296 | failonerror="true" |
---|
297 | inputstring="(handler-case (compile-system :zip nil :quit t :output-path "${abcl.lisp.output}/") (t (x) (progn (format t "~A: ~A~%" (type-of x) x) (exit :status -1))))" |
---|
298 | classname="org.armedbear.lisp.Main"> |
---|
299 | <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/> |
---|
300 | <jvmarg value="-Dabcl.autoload.verbose=Y"/> |
---|
301 | <additional.jvmarg/> |
---|
302 | <arg value="--noinit"/> |
---|
303 | <arg value="--nosystem"/> |
---|
304 | <arg value="--eval"/> |
---|
305 | <arg value="(setf *load-verbose* t)"/> |
---|
306 | </java> |
---|
307 | <concat destfile="${system.lisp.file}" append="true"> |
---|
308 | <fileset file="${abcl.startup.file}"/> |
---|
309 | </concat> |
---|
310 | </sequential> |
---|
311 | </macrodef> |
---|
312 | |
---|
313 | <property name="abcl.compile.lisp.debug.jvmarg" |
---|
314 | value="-agentlib:jdwp=transport=dt_socket,server=y,address=6789,suspend=y"/> |
---|
315 | <target name="abcl.compile.lisp.debug" |
---|
316 | depends="abcl.stage,abcl.compile.java,abcl.system.update.maybe,abcl.fasls.uptodate" |
---|
317 | unless="abcl.fasls.uptodate.p"> |
---|
318 | <echo>Debugging with jvmarg ${abcl.compile.lisp.debug.jvmarg}</echo> |
---|
319 | <abcl.compile.lisp> |
---|
320 | <additional.jvmarg> |
---|
321 | <jvmarg value="${abcl.compile.lisp.debug.jvmarg}"/> |
---|
322 | </additional.jvmarg> |
---|
323 | </abcl.compile.lisp> |
---|
324 | </target> |
---|
325 | |
---|
326 | <property name="abcl.build.path" |
---|
327 | value="${build.classes.dir}/org/armedbear/lisp/build"/> |
---|
328 | <target name="abcl.stamp" |
---|
329 | depends="abcl.compile,abcl.stamp.version,abcl.stamp.hostname"> |
---|
330 | <mkdir dir="${abcl.build.path}/.."/> |
---|
331 | <loadfile property="abcl.version" |
---|
332 | srcFile="${abcl.version.path}"/> |
---|
333 | <echo message="${build}" file="${abcl.build.path}"/> |
---|
334 | </target> |
---|
335 | |
---|
336 | |
---|
337 | <!-- Environment variables may be accessed as ${env.NAME} --> |
---|
338 | <property environment="env"/> |
---|
339 | |
---|
340 | <!-- Can we derive an SVN version from the current build tree? --> |
---|
341 | <condition property="abcl.version.svn.p"> |
---|
342 | <and> |
---|
343 | <available |
---|
344 | file="${basedir}/.svn" |
---|
345 | type="dir"/> |
---|
346 | <or> |
---|
347 | <available |
---|
348 | file="svnversion.exe" |
---|
349 | filepath="${env.Path}"/> |
---|
350 | <available |
---|
351 | file="svnversion.exe" |
---|
352 | filepath="${env.PATH}"/> |
---|
353 | <available |
---|
354 | file="svnversion" |
---|
355 | filepath="${env.Path}"/> |
---|
356 | <available |
---|
357 | file="svnversion" |
---|
358 | filepath="${env.PATH}"/> |
---|
359 | </or> |
---|
360 | </and> |
---|
361 | </condition> |
---|
362 | |
---|
363 | <target name="abcl.version.src" depends="abcl.version.src.3"/> |
---|
364 | |
---|
365 | <target name="abcl.version.src.0" if="windows"> |
---|
366 | <exec |
---|
367 | executable="svnversion.exe" |
---|
368 | outputproperty="abcl.version.svn.raw" |
---|
369 | failifexecutionfails="false" |
---|
370 | searchpath="true" /> |
---|
371 | </target> |
---|
372 | |
---|
373 | <target name="abcl.version.src.1" depends="abcl.version.src.0"> |
---|
374 | <exec |
---|
375 | executable="svnversion" |
---|
376 | outputproperty="abcl.version.svn.raw" |
---|
377 | failifexecutionfails="false" |
---|
378 | searchpath="true" /> |
---|
379 | </target> |
---|
380 | |
---|
381 | <target name="abcl.version.src.2" |
---|
382 | depends="abcl.version.src.1" |
---|
383 | if="abcl.version.svn.p"> |
---|
384 | |
---|
385 | <!-- Transform all occurances of ":" ==> "-" in the version string --> |
---|
386 | <tempfile property="version-tmp.path"/> |
---|
387 | <echo message="${abcl.version.svn.raw}" |
---|
388 | file="${version-tmp.path}"/> |
---|
389 | <replace file="${version-tmp.path}" |
---|
390 | token=":" value="-"/> |
---|
391 | <loadfile property="abcl.version.svn" srcFile="${version-tmp.path}"/> |
---|
392 | <delete file="${version-tmp.path}"/> |
---|
393 | |
---|
394 | <echo>abcl.version.svn: ${abcl.version.svn}</echo> |
---|
395 | <property name="abcl.version.src" |
---|
396 | value="svn-${abcl.version.svn}"/> |
---|
397 | </target> |
---|
398 | |
---|
399 | <target name="abcl.version.src.3" |
---|
400 | depends="abcl.version.src.2" |
---|
401 | unless="abcl.version.svn.p"> |
---|
402 | <property name="abcl.version.src" |
---|
403 | value=""/> |
---|
404 | </target> |
---|
405 | |
---|
406 | <property name="abcl.home.dir" |
---|
407 | value="${src.dir}/org/armedbear/lisp/"/> |
---|
408 | <property name="abcl.version.path" |
---|
409 | value="${build.classes.dir}/org/armedbear/lisp/version"/> |
---|
410 | |
---|
411 | <target name="abcl.clean.version"> |
---|
412 | <delete file="${abcl.version.path}"/> |
---|
413 | </target> |
---|
414 | |
---|
415 | <target name="abcl.stamp.version.uptodate"> |
---|
416 | <uptodate property="abcl.stamp.version.uptodate.p" |
---|
417 | targetfile="${abcl.version.path}" |
---|
418 | srcfile="${build.classes.dir}/org/armedbear/lisp/Version.class"/> |
---|
419 | </target> |
---|
420 | |
---|
421 | <target name="abcl.stamp.version" |
---|
422 | depends="abcl.version.src,abcl.stamp.version.1,abcl.stamp.version.2" |
---|
423 | unless="abcl.stamp.version.uptodate.p"> |
---|
424 | <mkdir dir="${abcl.version.path}/.."/> |
---|
425 | <echo>ABCL implementation version: ${abcl.implementation.version}</echo> |
---|
426 | <echo file="${abcl.version.path}">${abcl.implementation.version}</echo> |
---|
427 | </target> |
---|
428 | |
---|
429 | <target name="abcl.stamp.version.generate" |
---|
430 | depends="abcl.compile.java" |
---|
431 | unless="abcl.stamp.version.uptodate.p"> |
---|
432 | <java fork="true" |
---|
433 | classpath="${build.classes.dir}" |
---|
434 | outputproperty="abcl.version" |
---|
435 | classname="org.armedbear.lisp.Version" |
---|
436 | logerror="yes"/> <!-- Don't catch stderr output --> |
---|
437 | </target> |
---|
438 | |
---|
439 | <target name="abcl.stamp.version.0" |
---|
440 | depends="abcl.stamp.version.uptodate,abcl.stamp.version.generate"> |
---|
441 | </target> |
---|
442 | |
---|
443 | <target name="abcl.stamp.version.1" |
---|
444 | depends="abcl.stamp.version.0" |
---|
445 | unless="abcl.version.svn.p"> |
---|
446 | <property name="abcl.implementation.version" |
---|
447 | value="${abcl.version}"/> |
---|
448 | </target> |
---|
449 | |
---|
450 | <target name="abcl.stamp.version.2" |
---|
451 | depends="abcl.stamp.version.0" |
---|
452 | if="abcl.version.svn.p"> |
---|
453 | <property name="abcl.implementation.version" |
---|
454 | value="${abcl.version}-${abcl.version.src}"/> |
---|
455 | </target> |
---|
456 | |
---|
457 | <target name="abcl.stamp.hostname" if="unix"> |
---|
458 | <exec executable="hostname" outputproperty="abcl.hostname"/> |
---|
459 | <echo>abcl.hostname: ${abcl.hostname}</echo> |
---|
460 | </target> |
---|
461 | |
---|
462 | <target name="abcl.system.uptodate"> |
---|
463 | <condition property="abcl.system.needs-update.p"> |
---|
464 | <and> |
---|
465 | <available file="${system.lisp.file}"/> |
---|
466 | <available file="${abcl.startup.file}"/> |
---|
467 | <uptodate |
---|
468 | srcfile="${system.lisp.file}" |
---|
469 | targetfile="${abcl.startup.file}"/> |
---|
470 | </and> |
---|
471 | </condition> |
---|
472 | </target> |
---|
473 | |
---|
474 | <target name="abcl.system.update.maybe" depends="abcl.system.uptodate" |
---|
475 | if="abcl.system.needs-update.p"> |
---|
476 | <touch file="${src.dir}/org/armedbear/lisp/compile-system.lisp"/> |
---|
477 | </target> |
---|
478 | |
---|
479 | <target name="abcl.jar.uptodate" depends="abcl.compile,abcl.stamp"> |
---|
480 | <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}"> |
---|
481 | <srcfiles dir="${build.classes.dir}"> |
---|
482 | <patternset refid="abcl.objects"/> |
---|
483 | </srcfiles> |
---|
484 | </uptodate> |
---|
485 | </target> |
---|
486 | |
---|
487 | <target name="abcl.jar" depends="abcl.jar.uptodate,abcl-contrib.jar" |
---|
488 | unless="abcl.jar.uptodate.p"> |
---|
489 | <mkdir dir="${dist.dir}"/> |
---|
490 | <jar destfile="${abcl.jar.path}" |
---|
491 | compress="true" |
---|
492 | update="true" |
---|
493 | basedir="${build.classes.dir}"> |
---|
494 | <patternset refid="abcl.objects"/> |
---|
495 | <manifest> |
---|
496 | <attribute name="Main-Class" value="org.armedbear.lisp.Main"/> |
---|
497 | <section name="org/armedbear/lisp"> |
---|
498 | <attribute name="Implementation-Title" |
---|
499 | value="ABCL"/> |
---|
500 | <attribute name="Implementation-Version" |
---|
501 | value="${abcl.implementation.version}"/> |
---|
502 | <attribute name="Implementation-Build" |
---|
503 | value="${build}"/> |
---|
504 | </section> |
---|
505 | </manifest> |
---|
506 | <metainf dir="${src.dir}/META-INF"> |
---|
507 | </metainf> |
---|
508 | </jar> |
---|
509 | </target> |
---|
510 | |
---|
511 | <target name="abcl-aio.jar" depends="abcl.compile,abcl.version"> |
---|
512 | <mkdir dir="${dist.dir}"/> |
---|
513 | <jar destfile="${abcl-aio.jar.path}" |
---|
514 | compress="true" |
---|
515 | update="true" |
---|
516 | basedir="${build.classes.dir}"> |
---|
517 | <fileset dir="${src.dir}"> |
---|
518 | <patternset refid="abcl.objects"/> |
---|
519 | <patternset refid="abcl.source.java"/> |
---|
520 | <patternset refid="abcl.source.lisp"/> |
---|
521 | </fileset> |
---|
522 | <fileset dir="${basedir}"> |
---|
523 | <patternset refid="abcl.contrib.source"/> |
---|
524 | </fileset> |
---|
525 | <!-- According to <http://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html> |
---|
526 | any attributes not specified are ignored, so we are free to make up new attributes if necessary. For now we just overload Implementation-Title and Implementation-Version. |
---|
527 | --> |
---|
528 | <manifest> |
---|
529 | <attribute name="Main-Class" value="org.armedbear.lisp.Main"/> |
---|
530 | <section name="org/armedbear/lisp"> |
---|
531 | <attribute name="Implementation-Title" |
---|
532 | value="ABCL"/> |
---|
533 | <attribute name="Implementation-Version" |
---|
534 | value="${abcl.implementation.version}"/> |
---|
535 | <attribute name="Implementation-Build" |
---|
536 | value="${build}"/> |
---|
537 | </section> |
---|
538 | <section name="contrib"> |
---|
539 | <attribute name="Implementation-Title" |
---|
540 | value="org.abcl-contrib"/> |
---|
541 | <!-- FIXME: declare separate abcl-contrib version? --> |
---|
542 | <attribute name="Implementation-Version" |
---|
543 | value="${abcl.implementation.version}"/> |
---|
544 | </section> |
---|
545 | <section name="tools"> |
---|
546 | <attribute name="Implementation-Title" |
---|
547 | value="org.abcl-tools"/> |
---|
548 | </section> |
---|
549 | <section name="src"> |
---|
550 | <attribute name="Implementation-Title" |
---|
551 | value="org.abcl-source"/> |
---|
552 | <attribute name="Implementation-Version" |
---|
553 | value="${abcl.implementation.version}"/> |
---|
554 | </section> |
---|
555 | </manifest> |
---|
556 | <metainf dir="${src.dir}/META-INF"> |
---|
557 | </metainf> |
---|
558 | </jar> |
---|
559 | </target> |
---|
560 | |
---|
561 | |
---|
562 | <target name="abcl.wrapper" |
---|
563 | depends="abcl.jar,abcl.contrib,abcl.wrapper.unix,abcl.wrapper.windows"> |
---|
564 | <description> |
---|
565 | Creates in-place executable shell wrapper in |
---|
566 | '${abcl.wrapper.file}' |
---|
567 | </description> |
---|
568 | <!-- Set from commandline or in 'build.properties' --> |
---|
569 | <property name="additional.jars" value=""/> |
---|
570 | <path id="abcl.runtime.classpath"> |
---|
571 | <pathelement location="${abcl.runtime.jar.path}"/> |
---|
572 | <pathelement path="${additional.jars}"/> |
---|
573 | </path> |
---|
574 | <!-- set via '-Djava.options=JAVA_OPTIONS' or in 'build.properties --> |
---|
575 | <property name="java.options" value=""/> |
---|
576 | |
---|
577 | <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes"> |
---|
578 | <filterset> |
---|
579 | <filter token="JAVA" |
---|
580 | value="${java.path}"/> |
---|
581 | <filter token="ABCL_JAVA_OPTIONS" |
---|
582 | value="${java.options}"/> |
---|
583 | <filter token="ABCL_CLASSPATH" |
---|
584 | value="${toString:abcl.runtime.classpath}"/> |
---|
585 | </filterset> |
---|
586 | </copy> |
---|
587 | <chmod file="${abcl.wrapper.file}" perm="a+x"/> |
---|
588 | |
---|
589 | <echo>Created executable ABCL wrapper in '${abcl.wrapper.file}'</echo> |
---|
590 | <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo> |
---|
591 | </target> |
---|
592 | |
---|
593 | <target name="abcl.wrapper.unix" if="unix"> |
---|
594 | <property name="abcl.wrapper.file" value="abcl"/> |
---|
595 | <property name="abcl.wrapper.in.file" value="abcl.in"/> |
---|
596 | </target> |
---|
597 | |
---|
598 | <target name="abcl.wrapper.windows" if="windows"> |
---|
599 | <property name="abcl.wrapper.file" value="abcl.bat"/> |
---|
600 | <property name="abcl.wrapper.in.file" value="abcl.bat.in"/> |
---|
601 | </target> |
---|
602 | |
---|
603 | <patternset id="abcl.contrib.source"> |
---|
604 | <include name="**/*.asd"/> |
---|
605 | <include name="**/*.lisp"/> |
---|
606 | <include name="**/README.markdown"/> |
---|
607 | </patternset> |
---|
608 | |
---|
609 | <patternset id="abcl.contrib.docs"> |
---|
610 | <include name="**/README.markdown"/> |
---|
611 | </patternset> |
---|
612 | |
---|
613 | <property name="abcl-contrib.jar" |
---|
614 | value="${dist.dir}/abcl-contrib.jar"/> |
---|
615 | <condition property="abcl.contrib.uptodate.p"> |
---|
616 | <uptodate targetfile="${abcl-contrib.jar}"> |
---|
617 | <srcfiles dir="contrib"> |
---|
618 | <patternset refid="abcl.contrib.source"/> |
---|
619 | </srcfiles> |
---|
620 | </uptodate> |
---|
621 | </condition> |
---|
622 | |
---|
623 | <target name="abcl-contrib.jar" depends="abcl.contrib"/> |
---|
624 | <target name="abcl.contrib" unless="abcl.contrib.uptodate.p"> |
---|
625 | <jar destfile="${abcl-contrib.jar}" |
---|
626 | compress="true" |
---|
627 | basedir="contrib"> |
---|
628 | <patternset refid="abcl.contrib.source"/> |
---|
629 | </jar> |
---|
630 | <echo> |
---|
631 | Packaged contribs in ${abcl-contrib.jar}. To use contribs, ensure that |
---|
632 | this file is in the same directory as 'abcl.jar', and then |
---|
633 | |
---|
634 | CL-USER> (require 'abcl-contrib) |
---|
635 | |
---|
636 | will place all the contribs in the ASDF registry. |
---|
637 | |
---|
638 | To load a contrib, something like |
---|
639 | |
---|
640 | CL-USER> (require 'jss) |
---|
641 | |
---|
642 | will compile (if necessary) and load JSS. |
---|
643 | </echo> |
---|
644 | </target> |
---|
645 | |
---|
646 | <target name="abcl.contrib.javadoc.jar"> |
---|
647 | <mkdir dir="${dist.dir}"/> |
---|
648 | <jar destfile="${dist.dir}/abcl-contrib-javadoc.jar" basedir="contrib"> |
---|
649 | <patternset refid="abcl.contrib.docs" /> |
---|
650 | </jar> |
---|
651 | </target> |
---|
652 | |
---|
653 | <target name="abcl.contrib.source.jar"> |
---|
654 | <mkdir dir="${dist.dir}"/> |
---|
655 | <jar destfile="${dist.dir}/abcl-contrib-sources.jar" basedir="contrib"> |
---|
656 | <patternset refid="abcl.contrib.source" /> |
---|
657 | </jar> |
---|
658 | </target> |
---|
659 | |
---|
660 | <target name="abcl.debug.jpda" depends="abcl.jar"> |
---|
661 | <description>Invoke ABCL with JPDA listener on port 6789</description> |
---|
662 | <java fork="true" |
---|
663 | classpathref="abcl.classpath.dist" |
---|
664 | classname="org.armedbear.lisp.Main"> |
---|
665 | <jvmarg |
---|
666 | value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/> |
---|
667 | </java> |
---|
668 | <echo>JPDA listening on localhost:6789</echo> |
---|
669 | </target> |
---|
670 | |
---|
671 | <target name="abcl.build.debug.jpda" depends="abcl.compile.java"> |
---|
672 | <description>Invoke ABCL with JPDA listener on port 6789</description> |
---|
673 | <java fork="true" |
---|
674 | classpathref="abcl.classpath.build" |
---|
675 | classname="org.armedbear.lisp.Main"> |
---|
676 | <jvmarg |
---|
677 | value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/> |
---|
678 | <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/> |
---|
679 | </java> |
---|
680 | <echo>JPDA listening on localhost:6789</echo> |
---|
681 | </target> |
---|
682 | |
---|
683 | <target name="abcl.run" depends="abcl.jar"> |
---|
684 | <java fork="true" |
---|
685 | classpathref="abcl.classpath.dist" |
---|
686 | classname="org.armedbear.lisp.Main"> |
---|
687 | </java> |
---|
688 | </target> |
---|
689 | |
---|
690 | <target name="abcl.clean"> |
---|
691 | <delete dir="${build.dir}"/> |
---|
692 | <delete file="${abcl.jar.path}"/> |
---|
693 | <delete file="abcl"/> |
---|
694 | <delete file="abcl.bat"/> |
---|
695 | </target> |
---|
696 | |
---|
697 | <property name="slime.fasls" |
---|
698 | value="${user.home}/.slime/"/> |
---|
699 | <property name="quicklisp.common-lisp.fasls" |
---|
700 | value="${user.home}/.cache/common-lisp/"/> |
---|
701 | <target name="abcl.clean.application.fasls"> |
---|
702 | <echo>Deleting ABCL SLIME fasls under ${slime.fasls}</echo> |
---|
703 | <delete> |
---|
704 | <fileset dir="${slime.fasls}" includes="**/*.abcl"/> |
---|
705 | </delete> |
---|
706 | <echo>Deleting ABCL Quicklisp fasls under ${quicklisp.common-lisp.fasls}</echo> |
---|
707 | <delete> |
---|
708 | <fileset dir="${quicklisp.common-lisp.fasls}" includes="**/*.abcl"/> |
---|
709 | </delete> |
---|
710 | </target> |
---|
711 | |
---|
712 | <target name="abcl.dist" depends="abcl.jar"> |
---|
713 | <copy file="${abcl.jar.path}" |
---|
714 | toFile="${dist.dir}/abcl-${abcl.version}.jar"/> |
---|
715 | </target> |
---|
716 | |
---|
717 | <target name="abcl.distclean" depends="abcl.clean"> |
---|
718 | <delete dir="${dist.dir}"/> |
---|
719 | <delete file="abcl"/> |
---|
720 | <delete file="abcl.bat"/> |
---|
721 | </target> |
---|
722 | |
---|
723 | <condition property="etags.executable" |
---|
724 | value="etags" |
---|
725 | else="c:/cygwin64/bin/ctags.exe"> |
---|
726 | <not> |
---|
727 | <os family="windows"/> |
---|
728 | </not> |
---|
729 | </condition> |
---|
730 | |
---|
731 | <target name="TAGS"> |
---|
732 | <delete file="TAGS"/> |
---|
733 | <apply executable="${etags.executable}" parallel="true" verbose="true" maxparallel="300"> |
---|
734 | <arg value="--append"/> |
---|
735 | <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/> |
---|
736 | <arg value='--regex=|[ \t]*@DocString([ \n\r\t]*name=\"\([^\"]*\)|\1|m'/> |
---|
737 | <fileset dir="${src.dir}"> |
---|
738 | <patternset refid="abcl.source.java"/> |
---|
739 | <patternset refid="abcl.source.lisp"/> |
---|
740 | </fileset> |
---|
741 | </apply> |
---|
742 | </target> |
---|
743 | |
---|
744 | <patternset id="abcl.dist.misc" |
---|
745 | description="Additional includes in the source distributions relative to basedir"> |
---|
746 | <include name="abcl.rdf"/> |
---|
747 | <include name="build.xml"/> |
---|
748 | <include name="abcl.properties.in"/> |
---|
749 | <include name="COPYING"/> |
---|
750 | <include name="README"/> |
---|
751 | <include name="CHANGES"/> |
---|
752 | <include name="abcl.in"/> |
---|
753 | <include name="abcl.bat.in"/> |
---|
754 | |
---|
755 | <include name="abcl.asd"/> |
---|
756 | |
---|
757 | <include name="examples/**"/> |
---|
758 | |
---|
759 | <include name="contrib/**"/> |
---|
760 | |
---|
761 | <include name="test/**"/> |
---|
762 | |
---|
763 | <include name="build-from-lisp.bash"/> |
---|
764 | |
---|
765 | <include name="build-abcl.lisp"/> |
---|
766 | <include name="customizations.lisp.in"/> |
---|
767 | |
---|
768 | </patternset> |
---|
769 | |
---|
770 | <!-- TODO merge with artifacts from 'abcl.stage' --> |
---|
771 | <patternset |
---|
772 | id="abcl.source.misc" |
---|
773 | description="Additional includes in the source distribution relative to source root"> |
---|
774 | <include name="org/armedbear/lisp/LICENSE"/> |
---|
775 | <include name="manifest-abcl"/> |
---|
776 | <include name="META-INF/services/javax.script.ScriptEngineFactory"/> |
---|
777 | </patternset> |
---|
778 | |
---|
779 | <target name="abcl.source.prepare" depends="abcl.stamp.version"> |
---|
780 | <property name="abcl.build.src.dir" |
---|
781 | value="${build.dir}/abcl-src-${abcl.version}"/> |
---|
782 | <mkdir dir="${abcl.build.src.dir}/src"/> |
---|
783 | <copy todir="${abcl.build.src.dir}/src" |
---|
784 | preservelastmodified="true"> |
---|
785 | <fileset dir="${src.dir}" |
---|
786 | id="abcl.source.src"> |
---|
787 | <patternset refid="abcl.source.java"/> |
---|
788 | <patternset refid="abcl.source.lisp"/> |
---|
789 | <patternset refid="abcl.source.misc"/> |
---|
790 | </fileset> |
---|
791 | </copy> |
---|
792 | <copy todir="${abcl.build.src.dir}" |
---|
793 | preservelastmodified="true"> |
---|
794 | <fileset dir="${basedir}"> |
---|
795 | <patternset refid="abcl.dist.misc"/> |
---|
796 | </fileset> |
---|
797 | </copy> |
---|
798 | </target> |
---|
799 | |
---|
800 | <!-- Files in source distribution that always get LF EOL (aka |
---|
801 | 'unix') --> |
---|
802 | <patternset id="abcl.dist.lf"> |
---|
803 | <include name="abcl.in"/> |
---|
804 | </patternset> |
---|
805 | |
---|
806 | <!-- Files in source distribution that always get CRLF EOL (aka |
---|
807 | 'dos') --> |
---|
808 | <patternset id="abcl.dist.crlf"> |
---|
809 | <include name="abcl.bat.in"/> |
---|
810 | </patternset> |
---|
811 | |
---|
812 | <target name="abcl.source.unix" depends="abcl.source.prepare"> |
---|
813 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
814 | preservelastmodified="true" |
---|
815 | eol="lf"> |
---|
816 | </fixcrlf> |
---|
817 | |
---|
818 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
819 | preservelastmodified="true" |
---|
820 | eol="crlf"> |
---|
821 | <patternset refid="abcl.dist.crlf"/> |
---|
822 | </fixcrlf> |
---|
823 | |
---|
824 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
825 | preservelastmodified="true" |
---|
826 | eol="lf"> |
---|
827 | <patternset refid="abcl.dist.lf"/> |
---|
828 | </fixcrlf> |
---|
829 | </target> |
---|
830 | |
---|
831 | <target name="abcl.source.tar" depends="abcl.source.unix"> |
---|
832 | <mkdir dir="${dist.dir}"/> |
---|
833 | <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz" |
---|
834 | compression="gzip"> |
---|
835 | <tarfileset dir="${build.dir}"> |
---|
836 | <include name="abcl-src-${abcl.version}/**"/> |
---|
837 | </tarfileset> |
---|
838 | </tar> |
---|
839 | </target> |
---|
840 | |
---|
841 | <target name="abcl.source.windows" depends="abcl.source.prepare"> |
---|
842 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
843 | preservelastmodified="true" |
---|
844 | eol="crlf"> |
---|
845 | </fixcrlf> |
---|
846 | |
---|
847 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
848 | preservelastmodified="true" |
---|
849 | eol="crlf"> |
---|
850 | <patternset refid="abcl.dist.crlf"/> |
---|
851 | </fixcrlf> |
---|
852 | |
---|
853 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
854 | preservelastmodified="true" |
---|
855 | eol="lf"> |
---|
856 | <patternset refid="abcl.dist.lf"/> |
---|
857 | </fixcrlf> |
---|
858 | </target> |
---|
859 | |
---|
860 | <target name="abcl.source.zip" depends="abcl.stamp,abcl.source.windows"> |
---|
861 | <mkdir dir="${dist.dir}"/> |
---|
862 | <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip" |
---|
863 | compress="true"> |
---|
864 | <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/> |
---|
865 | </zip> |
---|
866 | </target> |
---|
867 | |
---|
868 | <target name="abcl.source.jar" depends="abcl.stamp,abcl.source.unix"> |
---|
869 | <mkdir dir="${dist.dir}"/> |
---|
870 | <jar destfile="${dist.dir}/abcl-${abcl.version}-sources.jar"> |
---|
871 | <metainf dir="${abcl.build.src.dir}"> |
---|
872 | <include name="COPYING"/> |
---|
873 | </metainf> |
---|
874 | <fileset dir="${abcl.build.src.dir}/src"> |
---|
875 | <include name="**/*.java"/> |
---|
876 | <include name="**/*.lisp"/> |
---|
877 | </fileset> |
---|
878 | </jar> |
---|
879 | </target> |
---|
880 | |
---|
881 | <property name="abcl.javadoc.dir" value="${build.dir}/javadoc"/> |
---|
882 | |
---|
883 | <target name="abcl.javadoc" depends="abcl.stamp"> |
---|
884 | <mkdir dir="${abcl.javadoc.dir}"/> |
---|
885 | <javadoc destdir="${abcl.javadoc.dir}" |
---|
886 | sourcepath="${src.dir}"/> |
---|
887 | </target> |
---|
888 | |
---|
889 | <target name="abcl.javadoc.jar" depends="abcl.stamp.version,abcl.javadoc"> |
---|
890 | <mkdir dir="${dist.dir}"/> |
---|
891 | <jar destfile="${dist.dir}/abcl-${abcl.version}-javadoc.jar"> |
---|
892 | <fileset dir="${abcl.javadoc.dir}"/> |
---|
893 | </jar> |
---|
894 | </target> |
---|
895 | |
---|
896 | <target name="abcl.binary.prepare" depends="abcl.jar,abcl.contrib,abcl.documentation,abcl.stamp.version"> |
---|
897 | <property name="abcl.build.binary.dir" |
---|
898 | value="${build.dir}/abcl-bin-${abcl.version}"/> |
---|
899 | <mkdir dir="${abcl.build.binary.dir}"/> |
---|
900 | <copy todir="${abcl.build.binary.dir}" |
---|
901 | preservelastmodified="true"> |
---|
902 | <fileset dir="${basedir}/dist"> |
---|
903 | <patternset> |
---|
904 | <include name="abcl.jar"/> |
---|
905 | <include name="abcl-contrib.jar"/> |
---|
906 | <include name="*.pdf"/> |
---|
907 | </patternset> |
---|
908 | </fileset> |
---|
909 | <fileset dir="${basedir}"> |
---|
910 | <patternset> |
---|
911 | <include name="README"/> |
---|
912 | <include name="CHANGES"/> |
---|
913 | </patternset> |
---|
914 | </fileset> |
---|
915 | </copy> |
---|
916 | </target> |
---|
917 | |
---|
918 | <target name="abcl.binary.tar" depends="abcl.binary.prepare"> |
---|
919 | <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz" |
---|
920 | compression="gzip"> |
---|
921 | <tarfileset dir="${build.dir}"> |
---|
922 | <include name="abcl-bin-${abcl.version}/**"/> |
---|
923 | </tarfileset> |
---|
924 | </tar> |
---|
925 | </target> |
---|
926 | |
---|
927 | <target name="abcl.binary.zip" depends="abcl.binary.prepare"> |
---|
928 | <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip" |
---|
929 | compress="true"> |
---|
930 | <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/> |
---|
931 | </zip> |
---|
932 | </target> |
---|
933 | |
---|
934 | <target name="help.test"> |
---|
935 | <echo> |
---|
936 | The following Ant targets run various test suites: |
---|
937 | |
---|
938 | abcl.test |
---|
939 | -- Run all available tests. |
---|
940 | abcl.test.java |
---|
941 | -- Run the ABCL junit Java tests under ${basedir}/test/src/ |
---|
942 | abcl.test.lisp |
---|
943 | -- Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets |
---|
944 | test.ansi.compiled |
---|
945 | -- Run the compiled version of the ANSI test suite |
---|
946 | test.abcl |
---|
947 | -- Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl/ |
---|
948 | test.cl-bench |
---|
949 | -- Run the cl-bench test suite. |
---|
950 | |
---|
951 | The ANSI tests require that the [ansi-tests][1] be manually installed in |
---|
952 | ${basedir}/../ansi-tests. |
---|
953 | |
---|
954 | [1]: git+https://gitlab.common-lisp.net/ansi-test/ansi-test.git |
---|
955 | |
---|
956 | The CL-BENCH tests require that [cl-bench][2] be manually installed in |
---|
957 | ${basedir}/../cl-bench |
---|
958 | |
---|
959 | [2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz |
---|
960 | </echo> |
---|
961 | </target> |
---|
962 | |
---|
963 | <property name="abcl.test.classes.dir" |
---|
964 | value="${build.dir}/classes-test"/> |
---|
965 | |
---|
966 | <property name="abcl.test.src.dir" |
---|
967 | value="${basedir}/test/src"/> |
---|
968 | |
---|
969 | <patternset id="abcl.test.source.java"> |
---|
970 | <include name="org/armedbear/lisp/**/*.java"/> |
---|
971 | </patternset> |
---|
972 | |
---|
973 | <property name="junit.path" |
---|
974 | value="${abcl.ext.dir}/junit-4.8.1.jar"/> |
---|
975 | <property name="maven.dist.name" |
---|
976 | value="apache-maven-3.3.9-bin.zip"/> |
---|
977 | <property name="maven.dist.uri" |
---|
978 | value="http://www-eu.apache.org/dist/maven/maven-3/3.3.9/binaries/${maven.dist.name}"/> |
---|
979 | <property name="maven.local.path" |
---|
980 | value="${abcl.ext.dir}/${maven.dist.name}"/> |
---|
981 | |
---|
982 | <path id="abcl.test.compile.classpath"> |
---|
983 | <pathelement location="${junit.path}"/> |
---|
984 | <pathelement location="${build.classes.dir}"/> |
---|
985 | </path> |
---|
986 | |
---|
987 | <target name="abcl.test.pre-compile" depends="abcl.ext"/> |
---|
988 | |
---|
989 | <target name="abcl.ext.p"> |
---|
990 | <!--XXX generalize over enumeration of all contributions to |
---|
991 | abcl.ext if we get more of them. --> |
---|
992 | <condition property="abcl.ext.p"> |
---|
993 | <and> |
---|
994 | <available file="${junit.path}"/> |
---|
995 | <available file="${maven.local.path}"/> |
---|
996 | </and> |
---|
997 | </condition> |
---|
998 | </target> |
---|
999 | |
---|
1000 | <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p"> |
---|
1001 | <mkdir dir="${abcl.ext.dir}"/> |
---|
1002 | <get |
---|
1003 | src="http://cloud.github.com/downloads/KentBeck/junit/junit-4.8.1.jar" |
---|
1004 | usetimestamp="true" |
---|
1005 | dest="${junit.path}"/> |
---|
1006 | <get |
---|
1007 | src="${maven.dist.uri}" |
---|
1008 | usetimestamp="true" |
---|
1009 | dest="${maven.local.path}"/> |
---|
1010 | </target> |
---|
1011 | |
---|
1012 | <target name="abcl.ext.maven" depends="abcl.ext"> |
---|
1013 | <echo>Installing Maven for ABCL from ${maven.dist.uri}.</echo> |
---|
1014 | <unzip src="${maven.local.path}" |
---|
1015 | dest="${abcl.ext.dir}"> |
---|
1016 | </unzip> |
---|
1017 | </target> |
---|
1018 | |
---|
1019 | <target name="abcl.test.compile" |
---|
1020 | depends="abcl.test.pre-compile"> |
---|
1021 | <mkdir dir="${abcl.test.classes.dir}"/> |
---|
1022 | <javac destdir="${abcl.test.classes.dir}" |
---|
1023 | classpathref="abcl.test.compile.classpath" |
---|
1024 | debug="true" |
---|
1025 | target="1.5"> |
---|
1026 | <src path="${abcl.test.src.dir}"/> |
---|
1027 | <patternset refid="abcl.test.source.java"/> |
---|
1028 | </javac> |
---|
1029 | </target> |
---|
1030 | |
---|
1031 | <path id="abcl.test.run.classpath"> |
---|
1032 | <path refid="abcl.test.compile.classpath"/> |
---|
1033 | <pathelement location="${abcl.test.classes.dir}"/> |
---|
1034 | </path> |
---|
1035 | |
---|
1036 | <target name="abcl.test" |
---|
1037 | depends="abcl.test.java,abcl.test.lisp"/> |
---|
1038 | |
---|
1039 | <target name="abcl.test.java" depends="abcl.test.compile"> |
---|
1040 | <java fork="true" |
---|
1041 | classpathref="abcl.test.run.classpath" |
---|
1042 | classname="org.junit.runner.JUnitCore"> |
---|
1043 | <arg value="org.armedbear.lisp.PathnameTest"/> |
---|
1044 | <arg value="org.armedbear.lisp.StreamTest"/> |
---|
1045 | <arg value="org.armedbear.lisp.SeekableStringWriterTest"/> |
---|
1046 | <arg value="org.armedbear.lisp.UtilitiesTest"/> |
---|
1047 | <!-- currently hangs(!) the running process |
---|
1048 | <arg value="org.armedbear.lisp.util.HttpHeadTest"/> |
---|
1049 | --> |
---|
1050 | </java> |
---|
1051 | </target> |
---|
1052 | |
---|
1053 | <target name="abcl.test.lisp" |
---|
1054 | depends="test.ansi.compiled,test.abcl,test.cl-bench"/> |
---|
1055 | |
---|
1056 | <target name="test.ansi.interpreted" depends="abcl.jar"> |
---|
1057 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
---|
1058 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
---|
1059 | <java fork="true" dir="${basedir}" |
---|
1060 | classpathref="abcl.classpath.dist" |
---|
1061 | classname="org.armedbear.lisp.Main"> |
---|
1062 | <arg value="--noinit"/> |
---|
1063 | <arg value="--eval"/><arg value="(require (quote asdf))"/> |
---|
1064 | <arg value="--eval"/> |
---|
1065 | <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration)))"/> |
---|
1066 | <arg value="--eval"/><arg value="(asdf:test-system :abcl/test/ansi/interpreted)"/> |
---|
1067 | <arg value="--eval"/><arg value="(ext:exit)"/> |
---|
1068 | </java> |
---|
1069 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
---|
1070 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
---|
1071 | </target> |
---|
1072 | |
---|
1073 | <target name="test.ansi.compiled" depends="abcl.jar"> |
---|
1074 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
---|
1075 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
---|
1076 | <java fork="true" dir="${basedir}" |
---|
1077 | classpathref="abcl.classpath.dist" |
---|
1078 | classname="org.armedbear.lisp.Main"> |
---|
1079 | <!-- Run in 64bit mode--> |
---|
1080 | <jvmarg value="-d64"/> |
---|
1081 | |
---|
1082 | <!-- Enable JVM assertions --> |
---|
1083 | <jvmarg value="-ea"/> |
---|
1084 | |
---|
1085 | <!-- (Possibly) unload classes when reference count reaches zero --> |
---|
1086 | <jvmarg value="-XX:+CMSClassUnloadingEnabled"/> |
---|
1087 | |
---|
1088 | <!-- Increase the size of the space used to store JVM class metadata. --> |
---|
1089 | <jvmarg value="-XX:MaxPermSize=768m"/> |
---|
1090 | |
---|
1091 | <arg value="--noinit"/> |
---|
1092 | <arg value="--eval"/><arg value="(require (quote asdf))"/> |
---|
1093 | <arg value="--eval"/> |
---|
1094 | <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration)))"/> |
---|
1095 | <arg value="--eval"/><arg value="(asdf:test-system :abcl/test/ansi/compiled)"/> |
---|
1096 | <arg value="--eval"/><arg value="(ext:exit)"/> |
---|
1097 | </java> |
---|
1098 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
---|
1099 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
---|
1100 | </target> |
---|
1101 | |
---|
1102 | <target name="test.abcl" depends="abcl.jar"> |
---|
1103 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
---|
1104 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
---|
1105 | <java fork="true" dir="${basedir}" |
---|
1106 | classpathref="abcl.classpath.dist" |
---|
1107 | classname="org.armedbear.lisp.Main"> |
---|
1108 | <arg value="--noinit"/> |
---|
1109 | <arg value="--eval"/><arg value="(require (quote asdf))"/> |
---|
1110 | <arg value="--eval"/> |
---|
1111 | <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration)))"/> |
---|
1112 | <arg value="--eval"/><arg value="(asdf:test-system :abcl)"/> |
---|
1113 | <arg value="--eval"/><arg value="(ext:exit)"/> |
---|
1114 | </java> |
---|
1115 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
---|
1116 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
---|
1117 | </target> |
---|
1118 | |
---|
1119 | <target name="test.cl-bench" depends="abcl.jar"> |
---|
1120 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
---|
1121 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
---|
1122 | <java fork="true" dir="${basedir}" |
---|
1123 | classpathref="abcl.classpath.dist" |
---|
1124 | classname="org.armedbear.lisp.Main"> |
---|
1125 | <arg value="--noinit"/> |
---|
1126 | <arg value="--eval"/><arg value="(require (quote asdf))"/> |
---|
1127 | <arg value="--eval"/> |
---|
1128 | <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration))"/> |
---|
1129 | <arg value="--eval"/><arg value="(asdf:test-system :abcl/test/cl-bench)"/> |
---|
1130 | <arg value="--eval"/><arg value="(ext:exit)"/> |
---|
1131 | </java> |
---|
1132 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
---|
1133 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
---|
1134 | </target> |
---|
1135 | |
---|
1136 | |
---|
1137 | <target name="abcl.diagnostic" |
---|
1138 | description="Emit diagnostics describing available hosting JVM properties." |
---|
1139 | depends="abcl.build.diagnostic"/> |
---|
1140 | <!-- |
---|
1141 | |
---|
1142 | urn:org.abcl.build.ant.targets.diagnostic |
---|
1143 | |
---|
1144 | "Possible JVM values from" |
---|
1145 | |
---|
1146 | http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties |
---|
1147 | |
---|
1148 | . |
---|
1149 | |
---|
1150 | |
---|
1151 | java.version Java Runtime Environment version |
---|
1152 | java.vendor Java Runtime Environment vendor |
---|
1153 | java.vendor.url Java vendor URL |
---|
1154 | java.home Java installation directory |
---|
1155 | java.vm.specification.version Java Virtual Machine specification version |
---|
1156 | java.vm.specification.vendor Java Virtual Machine specification vendor |
---|
1157 | java.vm.specification.name Java Virtual Machine specification name |
---|
1158 | java.vm.version Java Virtual Machine implementation version |
---|
1159 | java.vm.vendor Java Virtual Machine implementation vendor |
---|
1160 | java.vm.name Java Virtual Machine implementation name |
---|
1161 | java.specification.version Java Runtime Environment specification version |
---|
1162 | java.specification.vendor Java Runtime Environment specification vendor |
---|
1163 | java.specification.name Java Runtime Environment specification name |
---|
1164 | java.class.version Java class format version number |
---|
1165 | java.class.path Java class path |
---|
1166 | java.library.path List of paths to search when loading libraries |
---|
1167 | java.io.tmpdir Default temp file path |
---|
1168 | java.compiler Name of JIT compiler to use |
---|
1169 | java.ext.dirs Path of extension directory or directories |
---|
1170 | os.name Operating system name |
---|
1171 | os.arch Operating system architecture |
---|
1172 | os.version Operating system version |
---|
1173 | file.separator File separator ("/" on UNIX) |
---|
1174 | path.separator Path separator (":" on UNIX) |
---|
1175 | line.separator Line separator ("\n" on UNIX) |
---|
1176 | user.name User's account name |
---|
1177 | user.home User's home directory |
---|
1178 | user.dir |
---|
1179 | |
---|
1180 | --> |
---|
1181 | |
---|
1182 | <target name="abcl.build.diagnostic" description="Emit diagnostics describing available hosting JVM properties."> |
---|
1183 | <echo>:java.version ${java.version}</echo> |
---|
1184 | <echo>:java.vendor ${java.vendor}</echo> |
---|
1185 | <echo>:java.vm.vendor ${java.vm.vendor}</echo> |
---|
1186 | <echo>:java.vm.name ${java.vm.name}</echo> |
---|
1187 | |
---|
1188 | <echo>:os.name ${os.name}</echo> |
---|
1189 | <echo>:os.arch ${os.arch}</echo> |
---|
1190 | <echo>:os.version ${os.version}</echo> |
---|
1191 | |
---|
1192 | <echo>:java.specification.version ${java.specification.version}</echo> |
---|
1193 | <echo>:java.vm.specification.version ${java.vm.specification.version}</echo> |
---|
1194 | </target> |
---|
1195 | |
---|
1196 | <target name="abcl.release" |
---|
1197 | depends="abcl.clean,abcl.binary.tar,abcl.source.tar,abcl.binary.zip,abcl.source.zip"> |
---|
1198 | <copy file="${abcl.jar.path}" |
---|
1199 | tofile="${dist.dir}/abcl-${abcl.version}.jar"/> |
---|
1200 | <copy file="${abcl-contrib.jar}" |
---|
1201 | tofile="${dist.dir}/abcl-contrib-${abcl.version}.jar"/> |
---|
1202 | </target> |
---|
1203 | |
---|
1204 | <target name="abcl.documentation" |
---|
1205 | depends="abcl.documentation.manual,abcl.documentation.asdf"/> |
---|
1206 | <target name="abcl.documentation.manual" |
---|
1207 | depends="abcl.stamp.version"> |
---|
1208 | <echo>This target requires 'make' and a LaTeX installation to be on the PATH.</echo> |
---|
1209 | <exec |
---|
1210 | executable="make" |
---|
1211 | dir="${basedir}/doc/manual"/> |
---|
1212 | <copy file="doc/manual/abcl.pdf" |
---|
1213 | tofile="${dist.dir}/abcl-${abcl.version}.pdf"/> |
---|
1214 | </target> |
---|
1215 | <target name="abcl.documentation.asdf"> |
---|
1216 | <echo>This target requires 'texi2pdf' to be on the PATH.</echo> |
---|
1217 | <exec |
---|
1218 | executable="texi2pdf" |
---|
1219 | dir="${basedir}/doc/asdf"> |
---|
1220 | <arg value="asdf.texinfo"/> |
---|
1221 | </exec> |
---|
1222 | <copy file="doc/asdf/asdf.pdf" |
---|
1223 | tofile="${dist.dir}/asdf.pdf"/> |
---|
1224 | </target> |
---|
1225 | |
---|
1226 | <import file="netbeans-build.xml" optional="true"/> |
---|
1227 | |
---|
1228 | <import file="etc/ant/build-snapshot.xml" optional="true"/> |
---|
1229 | |
---|
1230 | <import file="etc/ant/build-maven.xml" optional="true"/> |
---|
1231 | </project> |
---|