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 | <!-- The Java compilation options are perhaps underspecified in |
---|
197 | terms of the target JVM in order to support a developer who |
---|
198 | simply wants to compile and run locally with least hassles. |
---|
199 | |
---|
200 | When preparing ABCL binaries for wider distribution, the |
---|
201 | values of the abcl.build.target.javac and |
---|
202 | abcl.build.source.java become more important. |
---|
203 | |
---|
204 | The 'abcl.properties.autoconfigure.*' targets use the |
---|
205 | ci/create-build-properties.bash script to set these options |
---|
206 | for various openjdk platforms. |
---|
207 | --> |
---|
208 | |
---|
209 | <target name="abcl.compile.java" |
---|
210 | depends="abcl.init,abcl.java.warning"> |
---|
211 | <mkdir dir="${build.dir}"/> |
---|
212 | <mkdir dir="${build.classes.dir}"/> |
---|
213 | <javac destdir="${build.classes.dir}" |
---|
214 | debug="true" |
---|
215 | includeantruntime="false" |
---|
216 | encoding="UTF-8" |
---|
217 | failonerror="true"> |
---|
218 | <src path="${src.dir}"/> |
---|
219 | <patternset refid="abcl.source.java"/> |
---|
220 | </javac> |
---|
221 | </target> |
---|
222 | |
---|
223 | <!-- Additional artifacts to stage relative to Ant ${basedir} --> |
---|
224 | <patternset id="abcl.stage"> |
---|
225 | <include name="README"/> |
---|
226 | <include name="COPYING"/> |
---|
227 | <include name="abcl.rdf"/> |
---|
228 | <include name="abcl.asd"/> |
---|
229 | <include name="build.xml"/> |
---|
230 | <include name="abcl.properties.in"/> <!--TODO: massage into abcl.properties at build-time --> |
---|
231 | <include name="abcl.in"/> |
---|
232 | <include name="abcl.bat.in"/> |
---|
233 | <include name="etc/ant/*.xml"/> |
---|
234 | </patternset> |
---|
235 | |
---|
236 | <target name="abcl.stage" |
---|
237 | depends="abcl.copy.lisp"> |
---|
238 | <copy todir="${build.classes.dir}" preservelastmodified="yes" |
---|
239 | verbose="true"> |
---|
240 | <fileset dir="${basedir}/"> |
---|
241 | <patternset refid="abcl.stage"/> |
---|
242 | </fileset> |
---|
243 | </copy> |
---|
244 | </target> |
---|
245 | |
---|
246 | <target name="abcl.copy.lisp"> |
---|
247 | <copy todir="${build.classes.dir}" preservelastmodified="yes"> |
---|
248 | <fileset dir="${src.dir}"> |
---|
249 | <patternset refid="abcl.source.lisp.dist"/> |
---|
250 | </fileset> |
---|
251 | </copy> |
---|
252 | </target> |
---|
253 | |
---|
254 | <!-- Adjust the patternset for ABCL source to use the much faster |
---|
255 | Ant 'uptodate' task to check if we need to compile the system |
---|
256 | fasls. Highly inter-dependent with the behavior specified in |
---|
257 | 'compile-system.lisp', i.e. files not listed in |
---|
258 | there should NOT occur here. --> |
---|
259 | <patternset id="abcl.source.lisp.fasls"> |
---|
260 | <patternset refid="abcl.source.lisp"/> |
---|
261 | <exclude name="org/armedbear/lisp/scripting/**/*.lisp"/> |
---|
262 | <exclude name="org/armedbear/lisp/boot.lisp"/> |
---|
263 | <exclude name="org/armedbear/lisp/emacs.lisp"/> |
---|
264 | <exclude name="org/armedbear/lisp/run-benchmarks.lisp"/> |
---|
265 | </patternset> |
---|
266 | |
---|
267 | <target name="abcl.fasls.uptodate"> |
---|
268 | <uptodate property="abcl.fasls.uptodate.p" value="true"> |
---|
269 | <srcfiles dir="${src.dir}"> |
---|
270 | <patternset refid="abcl.source.lisp.fasls"/> |
---|
271 | </srcfiles> |
---|
272 | <mapper type="glob" from="*.lisp" to="${build.classes.dir}/*.abcl"/> |
---|
273 | </uptodate> |
---|
274 | </target> |
---|
275 | |
---|
276 | <path id="abcl.home.dir.path"> |
---|
277 | <path location="${src.dir}/org/armedbear/lisp/"/> |
---|
278 | </path> |
---|
279 | <pathconvert property="abcl.home.dir" refid="abcl.home.dir.path"/> |
---|
280 | |
---|
281 | <path id="abcl.lisp.output.path" |
---|
282 | location="${build.classes.dir}/org/armedbear/lisp/"/> |
---|
283 | <pathconvert dirsep="/" property="abcl.lisp.output" refid="abcl.lisp.output.path"/> |
---|
284 | |
---|
285 | <property name="system.lisp.file" |
---|
286 | value="${build.classes.dir}/org/armedbear/lisp/system.lisp"/> |
---|
287 | |
---|
288 | <target name="abcl.compile.lisp" |
---|
289 | depends="abcl.stage,abcl.compile.java,abcl.system.update.maybe,abcl.fasls.uptodate" |
---|
290 | unless="abcl.fasls.uptodate.p"> |
---|
291 | <abcl.compile.lisp/> |
---|
292 | </target> |
---|
293 | |
---|
294 | <macrodef name="abcl.compile.lisp"> |
---|
295 | <element name="additional.jvmarg" optional="true"/> |
---|
296 | <sequential> |
---|
297 | <echo> |
---|
298 | Compiling Lisp system |
---|
299 | from ${abcl.home.dir} |
---|
300 | to ${abcl.lisp.output}</echo> |
---|
301 | |
---|
302 | <!-- Not good if ${abcl.home.dir} == ${abcl.lisp.output} --> |
---|
303 | <delete> |
---|
304 | <fileset dir="${abcl.home.dir}" includes="**/*.abcl **/*.cls **/*._"/> |
---|
305 | </delete> |
---|
306 | <java classpath="${build.classes.dir}" |
---|
307 | fork="true" |
---|
308 | failonerror="true" |
---|
309 | 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))))" |
---|
310 | classname="org.armedbear.lisp.Main"> |
---|
311 | <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/> |
---|
312 | <jvmarg value="-Dabcl.autoload.verbose=Y"/> |
---|
313 | <additional.jvmarg/> |
---|
314 | <arg value="--noinit"/> |
---|
315 | <arg value="--nosystem"/> |
---|
316 | <arg value="--eval"/> |
---|
317 | <arg value="(setf *load-verbose* t)"/> |
---|
318 | </java> |
---|
319 | <concat destfile="${system.lisp.file}" append="true"> |
---|
320 | <fileset file="${abcl.startup.file}"/> |
---|
321 | </concat> |
---|
322 | </sequential> |
---|
323 | </macrodef> |
---|
324 | |
---|
325 | <property name="abcl.compile.lisp.debug.jvmarg" |
---|
326 | value="-agentlib:jdwp=transport=dt_socket,server=y,address=6789,suspend=y"/> |
---|
327 | <target name="abcl.compile.lisp.debug" |
---|
328 | depends="abcl.stage,abcl.compile.java,abcl.system.update.maybe,abcl.fasls.uptodate" |
---|
329 | unless="abcl.fasls.uptodate.p"> |
---|
330 | <echo>Debugging with jvmarg ${abcl.compile.lisp.debug.jvmarg}</echo> |
---|
331 | <abcl.compile.lisp> |
---|
332 | <additional.jvmarg> |
---|
333 | <jvmarg value="${abcl.compile.lisp.debug.jvmarg}"/> |
---|
334 | </additional.jvmarg> |
---|
335 | </abcl.compile.lisp> |
---|
336 | </target> |
---|
337 | |
---|
338 | <property name="abcl.build.path" |
---|
339 | value="${build.classes.dir}/org/armedbear/lisp/build"/> |
---|
340 | <target name="abcl.stamp" |
---|
341 | depends="abcl.compile,abcl.stamp.version,abcl.stamp.hostname"> |
---|
342 | <mkdir dir="${abcl.build.path}/.."/> |
---|
343 | <loadfile property="abcl.version" |
---|
344 | srcFile="${abcl.version.path}"/> |
---|
345 | <echo message="${build}" file="${abcl.build.path}"/> |
---|
346 | </target> |
---|
347 | |
---|
348 | |
---|
349 | <!-- Environment variables may be accessed as ${env.NAME} --> |
---|
350 | <property environment="env"/> |
---|
351 | |
---|
352 | <!-- Can we derive an SVN version from the current build tree? --> |
---|
353 | <condition property="abcl.version.svn.p"> |
---|
354 | <and> |
---|
355 | <available |
---|
356 | file="${basedir}/.svn" |
---|
357 | type="dir"/> |
---|
358 | <or> |
---|
359 | <available |
---|
360 | file="svnversion.exe" |
---|
361 | filepath="${env.Path}"/> |
---|
362 | <available |
---|
363 | file="svnversion.exe" |
---|
364 | filepath="${env.PATH}"/> |
---|
365 | <available |
---|
366 | file="svnversion" |
---|
367 | filepath="${env.Path}"/> |
---|
368 | <available |
---|
369 | file="svnversion" |
---|
370 | filepath="${env.PATH}"/> |
---|
371 | </or> |
---|
372 | </and> |
---|
373 | </condition> |
---|
374 | |
---|
375 | <target name="abcl.version.src" depends="abcl.version.src.3"/> |
---|
376 | |
---|
377 | <target name="abcl.version.src.0" if="windows"> |
---|
378 | <exec |
---|
379 | executable="svnversion.exe" |
---|
380 | outputproperty="abcl.version.svn.raw" |
---|
381 | failifexecutionfails="false" |
---|
382 | searchpath="true" /> |
---|
383 | </target> |
---|
384 | |
---|
385 | <target name="abcl.version.src.1" depends="abcl.version.src.0"> |
---|
386 | <exec |
---|
387 | executable="svnversion" |
---|
388 | outputproperty="abcl.version.svn.raw" |
---|
389 | failifexecutionfails="false" |
---|
390 | searchpath="true" /> |
---|
391 | </target> |
---|
392 | |
---|
393 | <target name="abcl.version.src.2" |
---|
394 | depends="abcl.version.src.1" |
---|
395 | if="abcl.version.svn.p"> |
---|
396 | |
---|
397 | <!-- Transform all occurances of ":" ==> "-" in the version string --> |
---|
398 | <tempfile property="version-tmp.path"/> |
---|
399 | <echo message="${abcl.version.svn.raw}" |
---|
400 | file="${version-tmp.path}"/> |
---|
401 | <replace file="${version-tmp.path}" |
---|
402 | token=":" value="-"/> |
---|
403 | <loadfile property="abcl.version.svn" srcFile="${version-tmp.path}"/> |
---|
404 | <delete file="${version-tmp.path}"/> |
---|
405 | |
---|
406 | <echo>abcl.version.svn: ${abcl.version.svn}</echo> |
---|
407 | <property name="abcl.version.src" |
---|
408 | value="svn-${abcl.version.svn}"/> |
---|
409 | </target> |
---|
410 | |
---|
411 | <target name="abcl.version.src.3" |
---|
412 | depends="abcl.version.src.2" |
---|
413 | unless="abcl.version.svn.p"> |
---|
414 | <property name="abcl.version.src" |
---|
415 | value=""/> |
---|
416 | </target> |
---|
417 | |
---|
418 | <property name="abcl.home.dir" |
---|
419 | value="${src.dir}/org/armedbear/lisp/"/> |
---|
420 | <property name="abcl.version.path" |
---|
421 | value="${build.classes.dir}/org/armedbear/lisp/version"/> |
---|
422 | |
---|
423 | <target name="abcl.clean.version"> |
---|
424 | <delete file="${abcl.version.path}"/> |
---|
425 | </target> |
---|
426 | |
---|
427 | <target name="abcl.stamp.version.uptodate"> |
---|
428 | <uptodate property="abcl.stamp.version.uptodate.p" |
---|
429 | targetfile="${abcl.version.path}" |
---|
430 | srcfile="${build.classes.dir}/org/armedbear/lisp/Version.class"/> |
---|
431 | </target> |
---|
432 | |
---|
433 | <!-- |
---|
434 | The usage of abcl.implementation.version is deprecated as not working. |
---|
435 | The intention of this value was that if a given source tree could be |
---|
436 | unidentified as being under source control by the presence of given |
---|
437 | revision control system artifacts, the abcl.implementation.version |
---|
438 | would contain a version derived from the revision control system. |
---|
439 | |
---|
440 | To hack around the non-prescriptive nature of Ant, chains of |
---|
441 | conditional targets had to be created that while might have once |
---|
442 | worked for Subversion, were going to get increasingly hairy for |
---|
443 | Mercurial and Git. |
---|
444 | --> |
---|
445 | |
---|
446 | <target name="abcl.stamp.version" |
---|
447 | depends="abcl.version.src,abcl.stamp.version.1,abcl.stamp.version.2" |
---|
448 | unless="abcl.stamp.version.uptodate.p"> |
---|
449 | <mkdir dir="${abcl.version.path}/.."/> |
---|
450 | <echo>ABCL implementation version: ${abcl.implementation.version}</echo> |
---|
451 | <echo file="${abcl.version.path}">${abcl.implementation.version}</echo> |
---|
452 | </target> |
---|
453 | |
---|
454 | <target name="abcl.stamp.version.generate" |
---|
455 | depends="abcl.compile.java" |
---|
456 | unless="abcl.stamp.version.uptodate.p"> |
---|
457 | <java fork="true" |
---|
458 | classpath="${build.classes.dir}" |
---|
459 | outputproperty="abcl.version" |
---|
460 | classname="org.armedbear.lisp.Version" |
---|
461 | logerror="yes"/> <!-- Don't catch stderr output --> |
---|
462 | </target> |
---|
463 | |
---|
464 | <target name="abcl.stamp.version.0" |
---|
465 | depends="abcl.stamp.version.uptodate,abcl.stamp.version.generate"> |
---|
466 | </target> |
---|
467 | |
---|
468 | <target name="abcl.stamp.version.1" |
---|
469 | depends="abcl.stamp.version.0" |
---|
470 | unless="abcl.version.svn.p"> |
---|
471 | <property name="abcl.implementation.version" |
---|
472 | value="${abcl.version}"/> |
---|
473 | </target> |
---|
474 | |
---|
475 | <target name="abcl.stamp.version.2" |
---|
476 | depends="abcl.stamp.version.0" |
---|
477 | if="abcl.version.svn.p"> |
---|
478 | <property name="abcl.implementation.version" |
---|
479 | value="${abcl.version}-${abcl.version.src}"/> |
---|
480 | </target> |
---|
481 | |
---|
482 | <target name="abcl.stamp.hostname" if="unix"> |
---|
483 | <exec executable="hostname" outputproperty="abcl.hostname"/> |
---|
484 | <echo>abcl.hostname: ${abcl.hostname}</echo> |
---|
485 | </target> |
---|
486 | |
---|
487 | <target name="abcl.system.uptodate"> |
---|
488 | <condition property="abcl.system.needs-update.p"> |
---|
489 | <and> |
---|
490 | <available file="${system.lisp.file}"/> |
---|
491 | <available file="${abcl.startup.file}"/> |
---|
492 | <uptodate |
---|
493 | srcfile="${system.lisp.file}" |
---|
494 | targetfile="${abcl.startup.file}"/> |
---|
495 | </and> |
---|
496 | </condition> |
---|
497 | </target> |
---|
498 | |
---|
499 | <target name="abcl.system.update.maybe" depends="abcl.system.uptodate" |
---|
500 | if="abcl.system.needs-update.p"> |
---|
501 | <touch file="${src.dir}/org/armedbear/lisp/compile-system.lisp"/> |
---|
502 | </target> |
---|
503 | |
---|
504 | <target name="abcl.jar.uptodate" depends="abcl.compile,abcl.stamp"> |
---|
505 | <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}"> |
---|
506 | <srcfiles dir="${build.classes.dir}"> |
---|
507 | <patternset refid="abcl.objects"/> |
---|
508 | </srcfiles> |
---|
509 | </uptodate> |
---|
510 | </target> |
---|
511 | |
---|
512 | <target name="abcl.jar" depends="abcl.jar.uptodate,abcl-contrib.jar" |
---|
513 | unless="abcl.jar.uptodate.p"> |
---|
514 | <mkdir dir="${dist.dir}"/> |
---|
515 | <jar destfile="${abcl.jar.path}" |
---|
516 | compress="true" |
---|
517 | update="true" |
---|
518 | basedir="${build.classes.dir}"> |
---|
519 | <patternset refid="abcl.objects"/> |
---|
520 | <manifest> |
---|
521 | <attribute name="Main-Class" value="org.armedbear.lisp.Main"/> |
---|
522 | <section name="org/armedbear/lisp"> |
---|
523 | <attribute name="Implementation-Title" |
---|
524 | value="ABCL"/> |
---|
525 | <attribute name="Implementation-Version" |
---|
526 | value="${abcl.version}"/> |
---|
527 | <attribute name="Implementation-Build" |
---|
528 | value="${build}"/> |
---|
529 | </section> |
---|
530 | </manifest> |
---|
531 | <metainf dir="${src.dir}/META-INF"> |
---|
532 | </metainf> |
---|
533 | </jar> |
---|
534 | </target> |
---|
535 | |
---|
536 | <target name="abcl-aio.jar" |
---|
537 | depends="abcl.jar.uptodate"> |
---|
538 | <mkdir dir="${dist.dir}"/> |
---|
539 | <jar destfile="${abcl-aio.jar.path}" |
---|
540 | compress="true" |
---|
541 | update="true" |
---|
542 | basedir="${build.classes.dir}"> |
---|
543 | <fileset dir="${src.dir}"> |
---|
544 | <patternset refid="abcl.objects"/> |
---|
545 | <patternset refid="abcl.source.java"/> |
---|
546 | <patternset refid="abcl.source.lisp"/> |
---|
547 | </fileset> |
---|
548 | <fileset dir="${basedir}"> |
---|
549 | <patternset refid="abcl.contrib.source"/> |
---|
550 | </fileset> |
---|
551 | <!-- According to <http://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html> |
---|
552 | 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. |
---|
553 | --> |
---|
554 | <manifest> |
---|
555 | <attribute name="Main-Class" value="org.armedbear.lisp.Main"/> |
---|
556 | <section name="org/armedbear/lisp"> |
---|
557 | <attribute name="Implementation-Title" |
---|
558 | value="ABCL"/> |
---|
559 | <attribute name="Implementation-Version" |
---|
560 | value="${abcl.version}"/> |
---|
561 | <attribute name="Implementation-Build" |
---|
562 | value="${build}"/> |
---|
563 | </section> |
---|
564 | <section name="contrib"> |
---|
565 | <attribute name="Implementation-Title" |
---|
566 | value="org.abcl-contrib"/> |
---|
567 | <!-- FIXME: declare separate abcl-contrib version? --> |
---|
568 | <attribute name="Implementation-Version" |
---|
569 | value="${abcl.version}"/> |
---|
570 | </section> |
---|
571 | <section name="tools"> |
---|
572 | <attribute name="Implementation-Title" |
---|
573 | value="org.abcl-tools"/> |
---|
574 | </section> |
---|
575 | <section name="src"> |
---|
576 | <attribute name="Implementation-Title" |
---|
577 | value="org.abcl-source"/> |
---|
578 | <attribute name="Implementation-Version" |
---|
579 | value="${abcl.version}"/> |
---|
580 | </section> |
---|
581 | </manifest> |
---|
582 | <metainf dir="${src.dir}/META-INF"> |
---|
583 | </metainf> |
---|
584 | </jar> |
---|
585 | </target> |
---|
586 | |
---|
587 | |
---|
588 | <target name="abcl.wrapper" |
---|
589 | depends="abcl.jar,abcl.contrib,abcl.wrapper.unix,abcl.wrapper.windows"> |
---|
590 | <description> |
---|
591 | Creates in-place executable shell/batch invocation wrapper for ABCL in |
---|
592 | '${abcl.wrapper.file}' |
---|
593 | </description> |
---|
594 | <!-- Set from commandline or in 'build.properties' --> |
---|
595 | <property name="additional.jars" value=""/> |
---|
596 | <path id="abcl.runtime.classpath"> |
---|
597 | <pathelement location="${abcl.runtime.jar.path}"/> |
---|
598 | <pathelement path="${additional.jars}"/> |
---|
599 | </path> |
---|
600 | |
---|
601 | <!-- |
---|
602 | set via '-Djava.options=JAVA_OPTIONS' or in <file:abcl.properties> |
---|
603 | |
---|
604 | See 'abcl.properties.autoconfigure.openjdk.*' targets for |
---|
605 | creation of <file:abcl.properties> for a given JVM invocation. |
---|
606 | --> |
---|
607 | <property name="java.options" value=""/> |
---|
608 | |
---|
609 | <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes"> |
---|
610 | <filterset> |
---|
611 | <filter token="JAVA" |
---|
612 | value="${java.path}"/> |
---|
613 | <filter token="ABCL_JAVA_OPTIONS" |
---|
614 | value="${java.options}"/> |
---|
615 | <filter token="ABCL_CLASSPATH" |
---|
616 | value="${toString:abcl.runtime.classpath}"/> |
---|
617 | </filterset> |
---|
618 | </copy> |
---|
619 | <chmod file="${abcl.wrapper.file}" perm="a+x"/> |
---|
620 | |
---|
621 | <echo>Created an executable ABCL wrapper at</echo> |
---|
622 | <echo/> |
---|
623 | <echo> ${basedir}/${abcl.wrapper.file}</echo> |
---|
624 | <echo/> |
---|
625 | <echo>with the options</echo> |
---|
626 | <echo/> |
---|
627 | <echo> ${java.options}</echo> |
---|
628 | <echo/> |
---|
629 | <echo>N.b. This wrapper requires '${abcl.jar.path}' not be moved.</echo> |
---|
630 | </target> |
---|
631 | |
---|
632 | <target name="abcl.wrapper.unix" if="unix"> |
---|
633 | <property name="abcl.wrapper.file" value="abcl"/> |
---|
634 | <property name="abcl.wrapper.in.file" value="abcl.in"/> |
---|
635 | </target> |
---|
636 | |
---|
637 | <target name="abcl.wrapper.windows" if="windows"> |
---|
638 | <property name="abcl.wrapper.file" value="abcl.bat"/> |
---|
639 | <property name="abcl.wrapper.in.file" value="abcl.bat.in"/> |
---|
640 | </target> |
---|
641 | |
---|
642 | <patternset id="abcl.contrib.source"> |
---|
643 | <include name="**/*.asd"/> |
---|
644 | <include name="**/*.lisp"/> |
---|
645 | <include name="**/README.markdown"/> |
---|
646 | </patternset> |
---|
647 | |
---|
648 | <patternset id="abcl.contrib.docs"> |
---|
649 | <include name="**/README.markdown"/> |
---|
650 | </patternset> |
---|
651 | |
---|
652 | <property name="abcl-contrib.jar" |
---|
653 | value="${dist.dir}/abcl-contrib.jar"/> |
---|
654 | <condition property="abcl.contrib.uptodate.p"> |
---|
655 | <uptodate targetfile="${abcl-contrib.jar}"> |
---|
656 | <srcfiles dir="contrib"> |
---|
657 | <patternset refid="abcl.contrib.source"/> |
---|
658 | </srcfiles> |
---|
659 | </uptodate> |
---|
660 | </condition> |
---|
661 | |
---|
662 | <target name="abcl-contrib.jar" depends="abcl.contrib"/> |
---|
663 | <target name="abcl.contrib" unless="abcl.contrib.uptodate.p"> |
---|
664 | <jar destfile="${abcl-contrib.jar}" |
---|
665 | compress="true" |
---|
666 | basedir="contrib"> |
---|
667 | <patternset refid="abcl.contrib.source"/> |
---|
668 | </jar> |
---|
669 | <echo> |
---|
670 | Packaged contribs in ${abcl-contrib.jar}. To use contribs, ensure that |
---|
671 | this file is in the same directory as 'abcl.jar', and then |
---|
672 | |
---|
673 | CL-USER> (require 'abcl-contrib) |
---|
674 | |
---|
675 | will place all the contribs in the ASDF registry. |
---|
676 | |
---|
677 | To load a contrib, something like |
---|
678 | |
---|
679 | CL-USER> (require 'jss) |
---|
680 | |
---|
681 | will compile (if necessary) and load JSS. |
---|
682 | </echo> |
---|
683 | </target> |
---|
684 | |
---|
685 | <target name="abcl.contrib.javadoc.jar"> |
---|
686 | <mkdir dir="${dist.dir}"/> |
---|
687 | <jar destfile="${dist.dir}/abcl-contrib-javadoc.jar" basedir="contrib"> |
---|
688 | <patternset refid="abcl.contrib.docs" /> |
---|
689 | </jar> |
---|
690 | </target> |
---|
691 | |
---|
692 | <target name="abcl.contrib.source.jar"> |
---|
693 | <mkdir dir="${dist.dir}"/> |
---|
694 | <jar destfile="${dist.dir}/abcl-contrib-sources.jar" basedir="contrib"> |
---|
695 | <patternset refid="abcl.contrib.source" /> |
---|
696 | </jar> |
---|
697 | </target> |
---|
698 | |
---|
699 | <target name="abcl.debug.jpda" depends="abcl.jar"> |
---|
700 | <description>Invoke ABCL with JPDA listener on port 6789</description> |
---|
701 | <java fork="true" |
---|
702 | classpathref="abcl.classpath.dist" |
---|
703 | classname="org.armedbear.lisp.Main"> |
---|
704 | <jvmarg |
---|
705 | value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/> |
---|
706 | </java> |
---|
707 | <echo>JPDA listening on localhost:6789</echo> |
---|
708 | </target> |
---|
709 | |
---|
710 | <target name="abcl.build.debug.jpda" depends="abcl.compile.java"> |
---|
711 | <description>Invoke ABCL with JPDA listener on port 6789</description> |
---|
712 | <java fork="true" |
---|
713 | classpathref="abcl.classpath.build" |
---|
714 | classname="org.armedbear.lisp.Main"> |
---|
715 | <jvmarg |
---|
716 | value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/> |
---|
717 | <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/> |
---|
718 | </java> |
---|
719 | <echo>JPDA listening on localhost:6789</echo> |
---|
720 | </target> |
---|
721 | |
---|
722 | <target name="abcl.run" depends="abcl.jar"> |
---|
723 | <java fork="true" |
---|
724 | classpathref="abcl.classpath.dist" |
---|
725 | classname="org.armedbear.lisp.Main"> |
---|
726 | </java> |
---|
727 | </target> |
---|
728 | |
---|
729 | <target name="abcl.clean"> |
---|
730 | <delete dir="${build.dir}"/> |
---|
731 | <delete file="${abcl.jar.path}"/> |
---|
732 | <delete file="abcl"/> |
---|
733 | <delete file="abcl.bat"/> |
---|
734 | </target> |
---|
735 | |
---|
736 | <property name="slime.fasls" |
---|
737 | value="${user.home}/.slime/"/> |
---|
738 | <property name="quicklisp.common-lisp.fasls" |
---|
739 | value="${user.home}/.cache/common-lisp/"/> |
---|
740 | <target name="abcl.clean.application.fasls"> |
---|
741 | <echo>Deleting ABCL SLIME fasls under ${slime.fasls}</echo> |
---|
742 | <delete> |
---|
743 | <fileset dir="${slime.fasls}" includes="**/*.abcl"/> |
---|
744 | </delete> |
---|
745 | <echo>Deleting ABCL Quicklisp fasls under ${quicklisp.common-lisp.fasls}</echo> |
---|
746 | <delete> |
---|
747 | <fileset dir="${quicklisp.common-lisp.fasls}" includes="**/*.abcl"/> |
---|
748 | </delete> |
---|
749 | </target> |
---|
750 | |
---|
751 | <target name="abcl.dist" depends="abcl.jar"> |
---|
752 | <copy file="${abcl.jar.path}" |
---|
753 | toFile="${dist.dir}/abcl-${abcl.version}.jar"/> |
---|
754 | </target> |
---|
755 | |
---|
756 | <target name="abcl.distclean" depends="abcl.clean"> |
---|
757 | <delete dir="${dist.dir}"/> |
---|
758 | <delete file="abcl"/> |
---|
759 | <delete file="abcl.bat"/> |
---|
760 | </target> |
---|
761 | |
---|
762 | <condition property="etags.executable" |
---|
763 | value="etags" |
---|
764 | else="c:/cygwin64/bin/ctags.exe"> |
---|
765 | <not> |
---|
766 | <os family="windows"/> |
---|
767 | </not> |
---|
768 | </condition> |
---|
769 | |
---|
770 | <target name="TAGS"> |
---|
771 | <delete file="TAGS"/> |
---|
772 | <apply executable="${etags.executable}" parallel="true" verbose="true" maxparallel="300"> |
---|
773 | <arg value="--append"/> |
---|
774 | <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/> |
---|
775 | <arg value='--regex=|[ \t]*@DocString([ \n\r\t]*name=\"\([^\"]*\)|\1|m'/> |
---|
776 | <fileset dir="${src.dir}"> |
---|
777 | <patternset refid="abcl.source.java"/> |
---|
778 | <patternset refid="abcl.source.lisp"/> |
---|
779 | </fileset> |
---|
780 | </apply> |
---|
781 | </target> |
---|
782 | |
---|
783 | <patternset id="abcl.dist.misc" |
---|
784 | description="Additional includes in the source distributions relative to basedir"> |
---|
785 | <include name="abcl.rdf"/> |
---|
786 | <include name="build.xml"/> |
---|
787 | <include name="abcl.properties.in"/> |
---|
788 | <include name="COPYING"/> |
---|
789 | <include name="README"/> |
---|
790 | <include name="CHANGES"/> |
---|
791 | <include name="abcl.in"/> |
---|
792 | <include name="abcl.bat.in"/> |
---|
793 | |
---|
794 | <include name="abcl.asd"/> |
---|
795 | |
---|
796 | <include name="examples/**"/> |
---|
797 | |
---|
798 | <include name="contrib/**"/> |
---|
799 | |
---|
800 | <include name="test/**"/> |
---|
801 | |
---|
802 | <include name="build-from-lisp.bash"/> |
---|
803 | |
---|
804 | <include name="build-abcl.lisp"/> |
---|
805 | <include name="customizations.lisp.in"/> |
---|
806 | |
---|
807 | <include name="etc/ant/*.xml"/> |
---|
808 | |
---|
809 | <include name="doc/**/*"/> |
---|
810 | |
---|
811 | <include name="ci/**/*"/> |
---|
812 | |
---|
813 | <!-- FIXME: currently necessary to build from our source archives --> |
---|
814 | <include name="nbproject/**/*"/> |
---|
815 | </patternset> |
---|
816 | |
---|
817 | <!-- TODO merge with artifacts from 'abcl.stage' --> |
---|
818 | <patternset |
---|
819 | id="abcl.source.misc" |
---|
820 | description="Additional includes in the source distribution relative to source root"> |
---|
821 | <include name="org/armedbear/lisp/LICENSE"/> |
---|
822 | <include name="manifest-abcl"/> |
---|
823 | <include name="META-INF/services/javax.script.ScriptEngineFactory"/> |
---|
824 | </patternset> |
---|
825 | |
---|
826 | <target name="abcl.source.prepare" depends="abcl.stamp"> |
---|
827 | <property name="abcl.build.src.dir" |
---|
828 | value="${build.dir}/abcl-src-${abcl.version}"/> |
---|
829 | <mkdir dir="${abcl.build.src.dir}/src"/> |
---|
830 | <copy todir="${abcl.build.src.dir}/src" |
---|
831 | preservelastmodified="true"> |
---|
832 | <fileset dir="${src.dir}" |
---|
833 | id="abcl.source.src"> |
---|
834 | <patternset refid="abcl.source.java"/> |
---|
835 | <patternset refid="abcl.source.lisp"/> |
---|
836 | <patternset refid="abcl.source.misc"/> |
---|
837 | </fileset> |
---|
838 | </copy> |
---|
839 | <copy todir="${abcl.build.src.dir}" |
---|
840 | preservelastmodified="true"> |
---|
841 | <fileset dir="${basedir}"> |
---|
842 | <patternset refid="abcl.dist.misc"/> |
---|
843 | </fileset> |
---|
844 | </copy> |
---|
845 | </target> |
---|
846 | |
---|
847 | <!-- Files in source distribution that always get LF EOL (aka |
---|
848 | 'unix') --> |
---|
849 | <patternset id="abcl.dist.lf"> |
---|
850 | <include name="abcl.in"/> |
---|
851 | </patternset> |
---|
852 | |
---|
853 | <!-- Files in source distribution that always get CRLF EOL (aka |
---|
854 | 'dos') --> |
---|
855 | <patternset id="abcl.dist.crlf"> |
---|
856 | <include name="abcl.bat.in"/> |
---|
857 | </patternset> |
---|
858 | |
---|
859 | <target name="abcl.source.unix" depends="abcl.source.prepare"> |
---|
860 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
861 | preservelastmodified="true" |
---|
862 | eol="lf"> |
---|
863 | </fixcrlf> |
---|
864 | |
---|
865 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
866 | preservelastmodified="true" |
---|
867 | eol="crlf"> |
---|
868 | <patternset refid="abcl.dist.crlf"/> |
---|
869 | </fixcrlf> |
---|
870 | |
---|
871 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
872 | preservelastmodified="true" |
---|
873 | eol="lf"> |
---|
874 | <patternset refid="abcl.dist.lf"/> |
---|
875 | </fixcrlf> |
---|
876 | </target> |
---|
877 | |
---|
878 | <target name="abcl.source.tar" depends="abcl.source.unix"> |
---|
879 | <mkdir dir="${dist.dir}"/> |
---|
880 | <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz" |
---|
881 | compression="gzip"> |
---|
882 | <tarfileset dir="${build.dir}"> |
---|
883 | <include name="abcl-src-${abcl.version}/**"/> |
---|
884 | </tarfileset> |
---|
885 | </tar> |
---|
886 | </target> |
---|
887 | |
---|
888 | <target name="abcl.source.windows" depends="abcl.source.prepare"> |
---|
889 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
890 | preservelastmodified="true" |
---|
891 | eol="crlf"> |
---|
892 | </fixcrlf> |
---|
893 | |
---|
894 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
895 | preservelastmodified="true" |
---|
896 | eol="crlf"> |
---|
897 | <patternset refid="abcl.dist.crlf"/> |
---|
898 | </fixcrlf> |
---|
899 | |
---|
900 | <fixcrlf srcdir="${abcl.build.src.dir}" |
---|
901 | preservelastmodified="true" |
---|
902 | eol="lf"> |
---|
903 | <patternset refid="abcl.dist.lf"/> |
---|
904 | </fixcrlf> |
---|
905 | </target> |
---|
906 | |
---|
907 | <target name="abcl.source.zip" depends="abcl.stamp,abcl.source.windows"> |
---|
908 | <mkdir dir="${dist.dir}"/> |
---|
909 | <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip" |
---|
910 | compress="true"> |
---|
911 | <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/> |
---|
912 | </zip> |
---|
913 | </target> |
---|
914 | |
---|
915 | <target name="abcl.source.jar" depends="abcl.stamp,abcl.source.unix"> |
---|
916 | <mkdir dir="${dist.dir}"/> |
---|
917 | <jar destfile="${dist.dir}/abcl-${abcl.version}-sources.jar"> |
---|
918 | <metainf dir="${abcl.build.src.dir}"> |
---|
919 | <include name="COPYING"/> |
---|
920 | </metainf> |
---|
921 | <fileset dir="${abcl.build.src.dir}/src"> |
---|
922 | <include name="**/*.java"/> |
---|
923 | <include name="**/*.lisp"/> |
---|
924 | </fileset> |
---|
925 | </jar> |
---|
926 | </target> |
---|
927 | |
---|
928 | <property name="abcl.javadoc.dir" value="${build.dir}/javadoc"/> |
---|
929 | |
---|
930 | <target name="abcl.javadoc" depends="abcl.stamp"> |
---|
931 | <mkdir dir="${abcl.javadoc.dir}"/> |
---|
932 | <javadoc destdir="${abcl.javadoc.dir}" |
---|
933 | sourcepath="${src.dir}"/> |
---|
934 | </target> |
---|
935 | |
---|
936 | <target name="abcl.javadoc.jar" depends="abcl.stamp.version,abcl.javadoc"> |
---|
937 | <mkdir dir="${dist.dir}"/> |
---|
938 | <jar destfile="${dist.dir}/abcl-${abcl.version}-javadoc.jar"> |
---|
939 | <fileset dir="${abcl.javadoc.dir}"/> |
---|
940 | </jar> |
---|
941 | </target> |
---|
942 | |
---|
943 | <target name="abcl.binary.prepare" depends="abcl.jar,abcl.contrib,abcl.documentation,abcl.stamp.version"> |
---|
944 | <property name="abcl.build.binary.dir" |
---|
945 | value="${build.dir}/abcl-bin-${abcl.version}"/> |
---|
946 | <mkdir dir="${abcl.build.binary.dir}"/> |
---|
947 | <copy todir="${abcl.build.binary.dir}" |
---|
948 | preservelastmodified="true"> |
---|
949 | <fileset dir="${basedir}/dist"> |
---|
950 | <patternset> |
---|
951 | <include name="abcl.jar"/> |
---|
952 | <include name="abcl-contrib.jar"/> |
---|
953 | <include name="*.pdf"/> |
---|
954 | </patternset> |
---|
955 | </fileset> |
---|
956 | <fileset dir="${basedir}"> |
---|
957 | <patternset> |
---|
958 | <include name="README"/> |
---|
959 | <include name="CHANGES"/> |
---|
960 | </patternset> |
---|
961 | </fileset> |
---|
962 | </copy> |
---|
963 | </target> |
---|
964 | |
---|
965 | <target name="abcl.binary.tar" depends="abcl.binary.prepare"> |
---|
966 | <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz" |
---|
967 | compression="gzip"> |
---|
968 | <tarfileset dir="${build.dir}"> |
---|
969 | <include name="abcl-bin-${abcl.version}/**"/> |
---|
970 | </tarfileset> |
---|
971 | </tar> |
---|
972 | </target> |
---|
973 | |
---|
974 | <target name="abcl.binary.zip" depends="abcl.binary.prepare"> |
---|
975 | <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip" |
---|
976 | compress="true"> |
---|
977 | <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/> |
---|
978 | </zip> |
---|
979 | </target> |
---|
980 | |
---|
981 | <target name="help.test"> |
---|
982 | <echo> |
---|
983 | The following Ant targets run various test suites: |
---|
984 | |
---|
985 | abcl.test |
---|
986 | -- Run all available tests. |
---|
987 | abcl.test.java |
---|
988 | -- Run the ABCL junit Java tests under ${basedir}/test/src/ |
---|
989 | abcl.test.lisp |
---|
990 | -- Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets |
---|
991 | test.ansi.compiled |
---|
992 | -- Run the compiled version of the ANSI test suite |
---|
993 | test.abcl |
---|
994 | -- Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl/ |
---|
995 | test.cl-bench |
---|
996 | -- Run the cl-bench test suite. |
---|
997 | |
---|
998 | The ANSI tests require that the [ANSI tests][1] be manually installed in |
---|
999 | ${basedir}/../ansi-test/. |
---|
1000 | |
---|
1001 | [1]: git+https://gitlab.common-lisp.net/ansi-test/ansi-test.git |
---|
1002 | |
---|
1003 | The CL-BENCH tests require that [cl-bench][2] be manually installed in |
---|
1004 | ${basedir}/../cl-bench |
---|
1005 | |
---|
1006 | [2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz |
---|
1007 | </echo> |
---|
1008 | </target> |
---|
1009 | |
---|
1010 | <property name="abcl.test.classes.dir" |
---|
1011 | value="${build.dir}/classes-test"/> |
---|
1012 | |
---|
1013 | <property name="abcl.test.src.dir" |
---|
1014 | value="${basedir}/test/src"/> |
---|
1015 | |
---|
1016 | <patternset id="abcl.test.source.java"> |
---|
1017 | <include name="org/armedbear/lisp/**/*.java"/> |
---|
1018 | </patternset> |
---|
1019 | |
---|
1020 | <property name="junit.path" |
---|
1021 | value="${abcl.ext.dir}/junit-4.8.1.jar"/> |
---|
1022 | <property name="maven.dist.name" |
---|
1023 | value="apache-maven-3.3.9-bin.zip"/> |
---|
1024 | <property name="maven.dist.uri" |
---|
1025 | value="http://www-eu.apache.org/dist/maven/maven-3/3.3.9/binaries/${maven.dist.name}"/> |
---|
1026 | <property name="maven.local.path" |
---|
1027 | value="${abcl.ext.dir}/${maven.dist.name}"/> |
---|
1028 | |
---|
1029 | <path id="abcl.test.compile.classpath"> |
---|
1030 | <pathelement location="${junit.path}"/> |
---|
1031 | <pathelement location="${build.classes.dir}"/> |
---|
1032 | </path> |
---|
1033 | |
---|
1034 | <target name="abcl.test.pre-compile" depends="abcl.ext"/> |
---|
1035 | |
---|
1036 | <target name="abcl.ext.p"> |
---|
1037 | <!--XXX generalize over enumeration of all contributions to |
---|
1038 | abcl.ext if we get more of them. --> |
---|
1039 | <condition property="abcl.ext.p"> |
---|
1040 | <and> |
---|
1041 | <available file="${junit.path}"/> |
---|
1042 | <available file="${maven.local.path}"/> |
---|
1043 | </and> |
---|
1044 | </condition> |
---|
1045 | </target> |
---|
1046 | |
---|
1047 | <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p"> |
---|
1048 | <mkdir dir="${abcl.ext.dir}"/> |
---|
1049 | <get |
---|
1050 | src="https://repo1.maven.org/maven2/junit/junit/4.8.1/junit-4.8.1.jar" |
---|
1051 | usetimestamp="true" |
---|
1052 | dest="${junit.path}"/> |
---|
1053 | <get |
---|
1054 | src="${maven.dist.uri}" |
---|
1055 | usetimestamp="true" |
---|
1056 | dest="${maven.local.path}"/> |
---|
1057 | </target> |
---|
1058 | |
---|
1059 | <target name="abcl.ext.maven" depends="abcl.ext"> |
---|
1060 | <echo>Installing Maven for ABCL from ${maven.dist.uri}.</echo> |
---|
1061 | <unzip src="${maven.local.path}" |
---|
1062 | dest="${abcl.ext.dir}"> |
---|
1063 | </unzip> |
---|
1064 | </target> |
---|
1065 | |
---|
1066 | <target name="abcl.test.compile" |
---|
1067 | depends="abcl.test.pre-compile"> |
---|
1068 | <mkdir dir="${abcl.test.classes.dir}"/> |
---|
1069 | <javac destdir="${abcl.test.classes.dir}" |
---|
1070 | classpathref="abcl.test.compile.classpath" |
---|
1071 | debug="true" |
---|
1072 | target="1.5"> |
---|
1073 | <src path="${abcl.test.src.dir}"/> |
---|
1074 | <patternset refid="abcl.test.source.java"/> |
---|
1075 | </javac> |
---|
1076 | </target> |
---|
1077 | |
---|
1078 | <path id="abcl.test.run.classpath"> |
---|
1079 | <path refid="abcl.test.compile.classpath"/> |
---|
1080 | <pathelement location="${abcl.test.classes.dir}"/> |
---|
1081 | </path> |
---|
1082 | |
---|
1083 | <target name="abcl.test" |
---|
1084 | depends="abcl.test.java,abcl.test.lisp"/> |
---|
1085 | |
---|
1086 | <target name="abcl.test.java" depends="abcl.test.compile"> |
---|
1087 | <java fork="true" |
---|
1088 | classpathref="abcl.test.run.classpath" |
---|
1089 | classname="org.junit.runner.JUnitCore"> |
---|
1090 | <arg value="org.armedbear.lisp.PathnameTest"/> |
---|
1091 | <arg value="org.armedbear.lisp.StreamTest"/> |
---|
1092 | <arg value="org.armedbear.lisp.SeekableStringWriterTest"/> |
---|
1093 | <arg value="org.armedbear.lisp.UtilitiesTest"/> |
---|
1094 | <arg value="org.armedbear.lisp.serialization.SerializationTest"/> |
---|
1095 | <!-- currently hangs(!) the running process |
---|
1096 | <arg value="org.armedbear.lisp.util.HttpHeadTest"/> |
---|
1097 | --> |
---|
1098 | </java> |
---|
1099 | </target> |
---|
1100 | |
---|
1101 | <target name="abcl.test.lisp" |
---|
1102 | depends="test.ansi.compiled,test.abcl,test.cl-bench"/> |
---|
1103 | |
---|
1104 | <target name="test.ansi.interpreted" depends="abcl.jar"> |
---|
1105 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
---|
1106 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
---|
1107 | <java fork="true" dir="${basedir}" |
---|
1108 | classpathref="abcl.classpath.dist" |
---|
1109 | classname="org.armedbear.lisp.Main"> |
---|
1110 | <arg value="--noinit"/> |
---|
1111 | <arg value="--eval"/><arg value="(require (quote asdf))"/> |
---|
1112 | <arg value="--eval"/> |
---|
1113 | <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration)))"/> |
---|
1114 | <arg value="--eval"/><arg value="(asdf:test-system :abcl/test/ansi/interpreted)"/> |
---|
1115 | <arg value="--eval"/><arg value="(ext:exit)"/> |
---|
1116 | </java> |
---|
1117 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
---|
1118 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
---|
1119 | </target> |
---|
1120 | |
---|
1121 | <target name="test.ansi.compiled" depends="abcl.jar"> |
---|
1122 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
---|
1123 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
---|
1124 | <java fork="true" dir="${basedir}" |
---|
1125 | classpathref="abcl.classpath.dist" |
---|
1126 | classname="org.armedbear.lisp.Main"> |
---|
1127 | |
---|
1128 | <arg value="--noinit"/> |
---|
1129 | <arg value="--eval"/><arg value="(require (quote asdf))"/> |
---|
1130 | <arg value="--eval"/> |
---|
1131 | <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration)))"/> |
---|
1132 | <arg value="--eval"/><arg value="(asdf:test-system :abcl/test/ansi/compiled)"/> |
---|
1133 | <arg value="--eval"/><arg value="(ext:exit)"/> |
---|
1134 | </java> |
---|
1135 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
---|
1136 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
---|
1137 | </target> |
---|
1138 | |
---|
1139 | <target name="test.abcl" depends="abcl.jar"> |
---|
1140 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
---|
1141 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
---|
1142 | <java fork="true" dir="${basedir}" |
---|
1143 | classpathref="abcl.classpath.dist" |
---|
1144 | classname="org.armedbear.lisp.Main"> |
---|
1145 | <arg value="--noinit"/> |
---|
1146 | <arg value="--eval"/><arg value="(require (quote asdf))"/> |
---|
1147 | <arg value="--eval"/> |
---|
1148 | <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration)))"/> |
---|
1149 | <arg value="--eval"/><arg value="(asdf:test-system :abcl)"/> |
---|
1150 | <arg value="--eval"/><arg value="(ext:exit)"/> |
---|
1151 | </java> |
---|
1152 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
---|
1153 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
---|
1154 | </target> |
---|
1155 | |
---|
1156 | <target name="test.cl-bench" depends="abcl.jar"> |
---|
1157 | <echo>Recording test output in ${abcl.test.log.file}.</echo> |
---|
1158 | <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/> |
---|
1159 | <java fork="true" dir="${basedir}" |
---|
1160 | classpathref="abcl.classpath.dist" |
---|
1161 | classname="org.armedbear.lisp.Main"> |
---|
1162 | <arg value="--noinit"/> |
---|
1163 | <arg value="--eval"/><arg value="(require (quote asdf))"/> |
---|
1164 | <arg value="--eval"/><arg value="(require (quote abcl-contrib))"/> |
---|
1165 | <arg value="--eval"/><arg value="(asdf:make :quicklisp-abcl)"/> |
---|
1166 | <arg value="--eval"/> |
---|
1167 | <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration))"/> |
---|
1168 | <arg value="--eval"/><arg value="(asdf:test-system :abcl/test/cl-bench)"/> |
---|
1169 | <arg value="--eval"/><arg value="(ext:exit)"/> |
---|
1170 | </java> |
---|
1171 | <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/> |
---|
1172 | <echo>Finished recording test output in ${abcl.test.log.file}.</echo> |
---|
1173 | </target> |
---|
1174 | |
---|
1175 | |
---|
1176 | <target name="abcl.diagnostic" |
---|
1177 | description="Emit diagnostics describing available hosting JVM properties." |
---|
1178 | depends="abcl.build.diagnostic"/> |
---|
1179 | <!-- |
---|
1180 | |
---|
1181 | urn:org.abcl.build.ant.targets.diagnostic |
---|
1182 | |
---|
1183 | "Possible JVM values from" |
---|
1184 | |
---|
1185 | http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties |
---|
1186 | |
---|
1187 | . |
---|
1188 | |
---|
1189 | |
---|
1190 | java.version Java Runtime Environment version |
---|
1191 | java.vendor Java Runtime Environment vendor |
---|
1192 | java.vendor.url Java vendor URL |
---|
1193 | java.home Java installation directory |
---|
1194 | java.vm.specification.version Java Virtual Machine specification version |
---|
1195 | java.vm.specification.vendor Java Virtual Machine specification vendor |
---|
1196 | java.vm.specification.name Java Virtual Machine specification name |
---|
1197 | java.vm.version Java Virtual Machine implementation version |
---|
1198 | java.vm.vendor Java Virtual Machine implementation vendor |
---|
1199 | java.vm.name Java Virtual Machine implementation name |
---|
1200 | java.specification.version Java Runtime Environment specification version |
---|
1201 | java.specification.vendor Java Runtime Environment specification vendor |
---|
1202 | java.specification.name Java Runtime Environment specification name |
---|
1203 | java.class.version Java class format version number |
---|
1204 | java.class.path Java class path |
---|
1205 | java.library.path List of paths to search when loading libraries |
---|
1206 | java.io.tmpdir Default temp file path |
---|
1207 | java.compiler Name of JIT compiler to use |
---|
1208 | java.ext.dirs Path of extension directory or directories |
---|
1209 | os.name Operating system name |
---|
1210 | os.arch Operating system architecture |
---|
1211 | os.version Operating system version |
---|
1212 | file.separator File separator ("/" on UNIX) |
---|
1213 | path.separator Path separator (":" on UNIX) |
---|
1214 | line.separator Line separator ("\n" on UNIX) |
---|
1215 | user.name User's account name |
---|
1216 | user.home User's home directory |
---|
1217 | user.dir |
---|
1218 | |
---|
1219 | --> |
---|
1220 | |
---|
1221 | <target name="abcl.build.diagnostic" description="Emit diagnostics describing available hosting JVM properties."> |
---|
1222 | <echo> |
---|
1223 | JVM System Properties |
---|
1224 | ===================== |
---|
1225 | :java.version ${java.version} |
---|
1226 | :java.vendor ${java.vendor} |
---|
1227 | :java.vm.vendor ${java.vm.vendor} |
---|
1228 | :java.vm.name ${java.vm.name} |
---|
1229 | |
---|
1230 | :os.name ${os.name} |
---|
1231 | :os.arch ${os.arch} |
---|
1232 | :os.version ${os.version} |
---|
1233 | |
---|
1234 | :java.specification.version |
---|
1235 | ${java.specification.version} |
---|
1236 | :java.vm.specification.version |
---|
1237 | ${java.vm.specification.version} |
---|
1238 | </echo> |
---|
1239 | |
---|
1240 | <echoproperties/> |
---|
1241 | </target> |
---|
1242 | |
---|
1243 | <target name="abcl.release" |
---|
1244 | depends="abcl.clean,abcl.properties.autoconfigure.openjdk.8,abcl.binary.tar,abcl.source.tar,abcl.binary.zip,abcl.source.zip,abcl.wrapper"> |
---|
1245 | <copy file="${abcl.jar.path}" |
---|
1246 | tofile="${dist.dir}/abcl-${abcl.version}.jar"/> |
---|
1247 | <copy file="${abcl-contrib.jar}" |
---|
1248 | tofile="${dist.dir}/abcl-contrib-${abcl.version}.jar"/> |
---|
1249 | </target> |
---|
1250 | |
---|
1251 | <target name="abcl.documentation" |
---|
1252 | depends="abcl.stamp.version.generate,abcl.documentation.manual,abcl.documentation.asdf"/> |
---|
1253 | <target name="abcl.documentation.manual" |
---|
1254 | depends="abcl.stamp.version"> |
---|
1255 | <echo>This target requires 'make' and a LaTeX installation to be on the PATH.</echo> |
---|
1256 | <exec |
---|
1257 | executable="make" |
---|
1258 | dir="${basedir}/doc/manual"/> |
---|
1259 | <copy file="doc/manual/abcl.pdf" |
---|
1260 | tofile="${dist.dir}/abcl-${abcl.version}.pdf"/> |
---|
1261 | </target> |
---|
1262 | <target name="abcl.documentation.asdf"> |
---|
1263 | <echo>This target requires 'texi2pdf' to be on the PATH.</echo> |
---|
1264 | <exec |
---|
1265 | executable="texi2pdf" |
---|
1266 | dir="${basedir}/doc/asdf"> |
---|
1267 | <arg value="asdf.texinfo"/> |
---|
1268 | </exec> |
---|
1269 | <copy file="doc/asdf/asdf.pdf" |
---|
1270 | tofile="${dist.dir}/asdf.pdf"/> |
---|
1271 | </target> |
---|
1272 | |
---|
1273 | <target name="abcl.properties.autoconfigure.openjdk.6"> |
---|
1274 | <exec executable="/usr/bin/env"> |
---|
1275 | <arg value="bash"/> |
---|
1276 | <arg value="ci/create-abcl-properties.bash"/> |
---|
1277 | <arg value="openjdk6"/> |
---|
1278 | </exec> |
---|
1279 | </target> |
---|
1280 | |
---|
1281 | |
---|
1282 | <target name="abcl.properties.autoconfigure.openjdk.7"> |
---|
1283 | <exec executable="/usr/bin/env"> |
---|
1284 | <arg value="bash"/> |
---|
1285 | <arg value="ci/create-abcl-properties.bash"/> |
---|
1286 | <arg value="openjdk7"/> |
---|
1287 | </exec> |
---|
1288 | </target> |
---|
1289 | |
---|
1290 | |
---|
1291 | <target name="abcl.properties.autoconfigure.openjdk.8"> |
---|
1292 | <exec executable="/usr/bin/env"> |
---|
1293 | <arg value="bash"/> |
---|
1294 | <arg value="ci/create-abcl-properties.bash"/> |
---|
1295 | <arg value="openjdk8"/> |
---|
1296 | </exec> |
---|
1297 | </target> |
---|
1298 | |
---|
1299 | <target name="abcl.properties.autoconfigure.openjdk.11"> |
---|
1300 | <exec executable="/usr/bin/env"> |
---|
1301 | <arg value="bash"/> |
---|
1302 | <arg value="ci/create-abcl-properties.bash"/> |
---|
1303 | <arg value="openjdk11"/> |
---|
1304 | </exec> |
---|
1305 | </target> |
---|
1306 | |
---|
1307 | <target name="abcl.properties.autoconfigure.openjdk.14"> |
---|
1308 | <exec executable="/usr/bin/env"> |
---|
1309 | <arg value="bash"/> |
---|
1310 | <arg value="ci/create-abcl-properties.bash"/> |
---|
1311 | <arg value="openjdk14"/> |
---|
1312 | </exec> |
---|
1313 | </target> |
---|
1314 | |
---|
1315 | <target name="abcl.properties.autoconfigure.openjdk.15"> |
---|
1316 | <exec executable="/usr/bin/env"> |
---|
1317 | <arg value="bash"/> |
---|
1318 | <arg value="ci/create-abcl-properties.bash"/> |
---|
1319 | <arg value="openjdk15"/> |
---|
1320 | </exec> |
---|
1321 | </target> |
---|
1322 | |
---|
1323 | <target name="abcl.properties.autoconfigure.openjdk.16"> |
---|
1324 | <exec executable="/usr/bin/env"> |
---|
1325 | <arg value="bash"/> |
---|
1326 | <arg value="ci/create-abcl-properties.bash"/> |
---|
1327 | <arg value="openjdk16"/> |
---|
1328 | </exec> |
---|
1329 | </target> |
---|
1330 | |
---|
1331 | <target name="abcl.properties.autoconfigure.openjdk.17"> |
---|
1332 | <exec executable="/usr/bin/env"> |
---|
1333 | <arg value="bash"/> |
---|
1334 | <arg value="ci/create-abcl-properties.bash"/> |
---|
1335 | <arg value="openjdk17"/> |
---|
1336 | </exec> |
---|
1337 | </target> |
---|
1338 | |
---|
1339 | <target name="abcl.properties.autoconfigure.openjdk.18"> |
---|
1340 | <exec executable="/usr/bin/env"> |
---|
1341 | <arg value="bash"/> |
---|
1342 | <arg value="ci/create-abcl-properties.bash"/> |
---|
1343 | <arg value="openjdk18"/> |
---|
1344 | </exec> |
---|
1345 | </target> |
---|
1346 | |
---|
1347 | <target name="abcl.properties.autoconfigure.openjdk.19"> |
---|
1348 | <exec executable="/usr/bin/env"> |
---|
1349 | <arg value="bash"/> |
---|
1350 | <arg value="ci/create-abcl-properties.bash"/> |
---|
1351 | <arg value="openjdk19"/> |
---|
1352 | </exec> |
---|
1353 | </target> |
---|
1354 | |
---|
1355 | <import file="etc/ant/netbeans-build.xml" |
---|
1356 | optional="true"/> |
---|
1357 | <import file="etc/ant/build-snapshot.xml" |
---|
1358 | optional="true"/> |
---|
1359 | <import file="etc/ant/build-maven.xml" |
---|
1360 | optional="true"/> |
---|
1361 | </project> |
---|