source: branches/0.20.x/abcl/build.xml @ 12684

Last change on this file since 12684 was 12684, checked in by Mark Evenson, 13 years ago

Backport r1267[14]: Site specific initialization code can be named by 'abcl.startup.file'.

Builds of ABCL can now be customized with "site specific" startup code
by setting the Ant property 'abcl.startup.file' to the path of a file
containing the custom code. This code is merged into 'system.lisp'
which is loaded during the boot process.

  • Property svn:eol-style set to LF
File size: 26.9 KB
Line 
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"/>
7 
8    <target name="help">
9      <echo>
10Main 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>
25For 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.ext.dir"
44        value="${basedir}/ext"/>
45
46    <fail message="Please build using Ant 1.7.1 or higher.">
47        <condition>
48            <not>
49                <antversion atleast="1.7.1"/>
50            </not>
51        </condition>
52    </fail>
53
54    <!-- Checks if JSR-223 support is available - thanks to Mark Evenson -->
55    <available property="abcl.jsr-223.p"
56         classname="javax.script.ScriptEngine"/>
57
58    <patternset id="abcl.source.java">
59      <include name="org/armedbear/lisp/*.java"/>
60      <include name="org/armedbear/lisp/util/*.java"/>
61      <include name="org/armedbear/lisp/java/**/*.java"/>
62      <include name="org/armedbear/lisp/scripting/*.java" if="abcl.jsr-223.p"/>
63      <include name="org/armedbear/lisp/scripting/util/*.java" if="abcl.jsr-223.p"/>
64      <include name="org/armedbear/Main.java"/>
65    </patternset>
66
67    <patternset id="abcl.source.lisp">
68      <include name="org/armedbear/lisp/*.lisp"/>
69      <include name="org/armedbear/lisp/java/**/*.lisp"/>
70      <include name="org/armedbear/lisp/tests/*.lisp"/>
71      <exclude name="org/armedbear/lisp/j.lisp"/>
72      <include name="org/armedbear/lisp/scripting/lisp/*.lisp" if="abcl.jsr-223.p"/>
73    </patternset>
74
75    <!-- Lisp files required at runtime -->
76    <patternset id="abcl.source.lisp.dist">
77      <include name="org/armedbear/lisp/boot.lisp"/>
78      <include name="org/armedbear/lisp/scripting/lisp/*.lisp" if="abcl.jsr-223.p"/>
79      <include name="**/*.lisp" if="abcl.compile.lisp.skip"/>
80    </patternset>
81
82    <patternset id="abcl.objects">
83      <!-- "system.lisp" is dynamically created by COMPILE-SYSTEM -->
84      <include name="org/armedbear/lisp/system.lisp"/> 
85      <include name="org/armedbear/lisp/**/*.class"/>
86      <include name="org/armedbear/lisp/**/*.cls"/> 
87      <include name="org/armedbear/lisp/**/*.abcl"/>
88      <include name="org/armedbear/lisp/scripting/*.class" if="abcl.jsr-223.p"/>
89      <include name="org/armedbear/lisp/scripting/util/*.class" if="abcl.jsr-223.p"/>
90      <patternset refid="abcl.source.lisp.dist"/>
91    </patternset>
92   
93    <path id="abcl.classpath.dist">
94      <pathelement location="${abcl.jar.path}"/>
95    </path>
96   
97    <path id="abcl.classpath.build">
98      <pathelement location="${build.classes.dir}"/>
99    </path>
100
101    <target name="abcl.compile" depends="abcl.clean.maybe,abcl.compile.lisp">
102      <echo>Compiled ABCL with Java version: ${java.version}</echo>
103    </target>
104
105    <target name="abcl.clean.maybe" unless="abcl.build.incremental">
106      <echo>Cleaning all intermediate compilation artifacts.</echo>
107      <echo>Setting 'abcl.build.incremental' enables incremental compilation.</echo>
108      <antcall target="abcl.clean"/>
109    </target>
110     
111
112    <target name="abcl.init">
113      <tstamp>
114  <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/>
115      </tstamp>
116
117      <tstamp>
118  <format property="build.stamp" pattern="yyyymmdd-HHmm"/>
119      </tstamp>
120
121      <property name="abcl.test.log.file"
122    value="abcl-test-${build.stamp}.log"/>
123
124      <property name="java.path"
125    value="${java.home}/bin/java"/>
126
127      <!-- Deprecated. Two main types of build environents: 'unix' or 'windows'. -->
128      <condition property="unix"> 
129  <or>
130    <os family="unix"/>
131    <os family="mac"/>
132  </or>
133      </condition>
134      <condition property="windows"> 
135  <os family="windows"/>
136      </condition>
137
138      <!-- Deprecated. -->
139      <available file="${src.dir}org/armedbear/lisp/Interpreter.java" 
140     property="abcl.lisp.p"/>
141
142      <echo>java.version: ${java.version}</echo>
143      <condition property="abcl.java.version.p">
144  <or>
145    <matches string="${java.version}" pattern="1\.5"/>
146    <matches string="${java.version}" pattern="1\.6\.0_[12][0-9]"/>
147  </or> 
148      </condition>
149
150      <!-- Set from commandline via -D or in 'build.properties' -->
151      <property name="build.version" value="abcl.svn"/>
152      <echo>Implementation-Source: ${version.src}</echo>
153
154    </target>
155   
156    <target name="abcl.java.warning" 
157      depends="abcl.init"
158      unless="abcl.java.version.p">
159      <echo>WARNING: Use of Java version ${java.version} not recommended.</echo>
160    </target>
161 
162    <target name="abcl.jsr-223.notice"
163      depends="abcl.init"
164      unless="abcl.jsr-223.p">
165      <echo>
166  Notice: JSR-223 support won't be built since it is not
167          supported, neither natively by your JVM nor by
168    libraries in the CLASSPATH.
169      </echo>
170    </target>
171
172    <target name="abcl.compile.java" 
173      depends="abcl.init,abcl.java.warning,abcl.jsr-223.notice">
174      <mkdir dir="${build.dir}"/>
175      <mkdir dir="${build.classes.dir}"/>
176      <javac destdir="${build.classes.dir}"
177       debug="true"
178       target="1.5"
179       failonerror="true">
180  <src path="${src.dir}"/>
181  <patternset refid="abcl.source.java"/>
182      </javac>
183      <echo message="${build}" 
184      file="${build.classes.dir}/org/armedbear/lisp/build"/>
185    </target>
186
187    <target name="abcl.copy.lisp">
188      <copy todir="${build.classes.dir}" preservelastmodified="yes">
189  <fileset dir="${src.dir}">
190          <patternset refid="abcl.source.lisp.dist"/>
191  </fileset>
192      </copy>
193    </target>
194
195    <!-- Adjust the patternset for ABCL source to use the much faster
196         Ant 'uptodate' task to check if we need to compile the system
197         fasls.  Highly inter-dependent with the behavior specified in
198         'compile-system.lisp', i.e. files not listed in
199         there should NOT occur here. -->
200    <patternset id="abcl.source.lisp.fasls">
201      <patternset refid="abcl.source.lisp"/>
202      <exclude name="org/armedbear/lisp/scripting/**/*.lisp"/>
203      <exclude name="org/armedbear/lisp/boot.lisp"/>
204      <exclude name="org/armedbear/lisp/emacs.lisp"/>
205      <exclude name="org/armedbear/lisp/runtime-class.lisp"/>
206      <exclude name="org/armedbear/lisp/run-benchmarks.lisp"/>
207    </patternset>
208
209    <target name="abcl.fasls.uptodate">
210      <uptodate property="abcl.fasls.uptodate.p" value="true">
211  <srcfiles dir="${src.dir}">
212    <patternset refid="abcl.source.lisp.fasls"/>
213  </srcfiles>
214  <mapper type="glob" from="*.lisp" to="${build.classes.dir}/*.abcl"/>
215      </uptodate>
216    </target>
217
218    <path id="abcl.home.dir.path">
219        <path location="${src.dir}/org/armedbear/lisp/"/>
220    </path>         
221    <pathconvert property="abcl.home.dir" refid="abcl.home.dir.path"/>
222
223    <path id="abcl.lisp.output.path"
224          location="${build.classes.dir}/org/armedbear/lisp/"/>
225    <pathconvert dirsep="/" property="abcl.lisp.output" refid="abcl.lisp.output.path"/>
226
227    <property name="system.lisp.file" 
228              value="${build.classes.dir}/org/armedbear/lisp/system.lisp"/>
229   
230    <target name="abcl.compile.lisp" 
231      depends="abcl.copy.lisp,abcl.compile.java,abcl.system.update.maybe,abcl.fasls.uptodate"
232      unless="abcl.fasls.uptodate.p">
233      <echo>
234Compiling Lisp system
235from ${abcl.home.dir}
236to   ${abcl.lisp.output}</echo>
237      <java classpath="${build.classes.dir}" 
238      fork="true"
239      failonerror="true"
240            inputstring="(handler-case (compile-system :zip nil :quit t :output-path &quot;${abcl.lisp.output}/&quot;) (t (x) (progn (format t &quot;~A: ~A~%&quot; (type-of x) x) (exit :status -1))))"
241      classname="org.armedbear.lisp.Main">
242        <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/>
243  <arg value="--noinit"/>
244        <arg value="--eval"/>
245        <arg value="(setf *load-verbose* t)"/>
246      </java>
247      <concat destfile="${system.lisp.file}" append="true">
248        <fileset file="${abcl.startup.file}"/>
249      </concat>
250    </target>
251
252    <property name="abcl.build.path"
253        value="${build.classes.dir}/org/armedbear/lisp/build"/>
254    <target name="abcl.stamp" depends="abcl.compile,abcl.stamp.version,abcl.stamp.hostname">
255      <mkdir dir="${abcl.build.path}/.."/>
256      <echo message="${build}" file="${abcl.build.path}"/>   
257    </target>
258
259    <property name="abcl.home.dir"
260              value="${src.dir}/org/armedbear/lisp/"/>
261    <property name="abcl.version.path"
262        value="${build.classes.dir}/org/armedbear/lisp/version"/>
263    <target name="abcl.stamp.version" depends="abcl.compile.java"  >
264      <java fork="true"
265      classpath="${build.classes.dir}"
266      outputproperty="abcl.version"
267      classname="org.armedbear.lisp.Version"
268            logerror="yes"/> <!-- Don't catch stderr output -->
269
270      <echo>ABCL version: ${abcl.version}</echo>
271      <mkdir dir="${abcl.version.path}/.."/>
272      <echo message="${abcl.version}" file="${abcl.version.path}"/> 
273    </target>
274
275    <target name="abcl.stamp.hostname" if="unix">
276      <exec executable="hostname" outputproperty="abcl.hostname"/>
277      <echo>abcl.hostname: ${abcl.hostname}</echo>
278    </target>
279
280    <target name="abcl.system.uptodate">
281      <uptodate property="abcl.system.needs-update.p" 
282                srcfile="${system.lisp.file}"
283                targetfile="${abcl.startup.file}"/>
284    </target>
285   
286    <target name="abcl.system.update.maybe" depends="abcl.system.uptodate" if="abcl.system.needs-update.p">
287      <touch file="${src.dir}/org/armedbear/lisp/compile-system.lisp"/>
288    </target>
289
290    <target name="abcl.jar.uptodate" depends="abcl.compile">
291      <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}">
292        <srcfiles dir="${build.classes.dir}">
293          <patternset refid="abcl.objects"/>
294        </srcfiles>
295      </uptodate>
296    </target>
297
298    <target name="abcl.jar" depends="abcl.stamp,abcl.jar.uptodate"
299      unless="abcl.jar.uptodate.p">
300      <mkdir dir="${dist.dir}"/>
301      <loadfile property="abcl.version"
302      srcFile="${abcl.version.path}"/>
303      <jar destfile="${abcl.jar.path}"
304     compress="true"
305     basedir="${build.classes.dir}">
306  <patternset refid="abcl.objects"/>
307  <manifest>
308    <attribute name="Main-Class" value="org.armedbear.lisp.Main"/>
309    <section name="org/armedbear/lisp">
310      <attribute name="Implementation-Title" 
311           value="ABCL"/>
312      <attribute name="Implementation-Version" 
313           value="${abcl.version}"/>
314      <attribute name="Implementation-Build" 
315           value="${build}"/>
316      <attribute name="Implementation-Source" 
317           value="${version.src}"/>
318    </section>
319  </manifest>
320  <metainf dir="${src.dir}/META-INF"> 
321    <exclude name="services/javax.script.ScriptEngineFactory"
322       unless="abcl.jsr-223.p"/>
323        </metainf>
324      </jar>
325    </target>
326   
327    <target name="abcl.wrapper" 
328      depends="abcl.jar,abcl.wrapper.unix,abcl.wrapper.windows">
329      <description>
330  Creates in-place exectuable shell wrapper in '${abcl.wrapper.file}'
331      </description>
332      <!-- Set from commandline or in 'build.properties' -->
333      <property name="additional.jars" value=""/>
334      <path id="abcl.runtime.classpath">
335  <pathelement location="${abcl.jar.path}"/>
336  <pathelement path="${additional.jars}"/>
337      </path>
338      <!-- set via '-Djava.options=JAVA_OPTIONS' or in 'build.properties -->
339      <property name="java.options" value=""/>
340
341      <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes">
342  <filterset>
343    <filter token="JAVA" 
344      value="${java.path}"/>
345    <filter token="ABCL_JAVA_OPTIONS" 
346      value="${java.options}"/>
347    <filter token="ABCL_CLASSPATH"
348      value="${toString:abcl.runtime.classpath}"/>
349  </filterset>
350      </copy>
351      <chmod file="${abcl.wrapper.file}" perm="a+x"/>
352
353      <echo>Created executable ABCL wrapper in '${abcl.wrapper.file}'</echo>
354      <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo>
355    </target>
356
357    <target name="abcl.wrapper.unix" if="unix">
358      <property name="abcl.wrapper.file" value="abcl"/>
359      <property name="abcl.wrapper.in.file" value="abcl.in"/>
360    </target>
361
362    <target name="abcl.wrapper.windows" if="windows">
363      <property name="abcl.wrapper.file" value="abcl.bat"/>
364      <property name="abcl.wrapper.in.file" value="abcl.bat.in"/>
365    </target>
366
367    <!-- XXX Generalize when (if?) we get more contribs --> 
368    <target name="abcl.contrib" depends="abcl.jar">
369      <java fork="true"
370            failonerror="true"
371            classpathref="abcl.classpath.dist"
372            dir="${basedir}/contrib/asdf-install/"
373            inputstring="(require 'asdf) (asdf:operate 'asdf:compile-op :asdf-install)"
374            classname="org.armedbear.lisp.Main">
375        <arg value="--noinit"/>
376      </java>
377      <jar destfile="dist/abcl-contrib.jar"
378           compress="true"
379           basedir="contrib">
380        <patternset>
381          <include name="**/*.asd"/>
382          <include name="**/*.lisp"/>
383          <include name="**/*.abcl"/>
384        </patternset>
385      </jar>
386      <echo>
387Packaged contribs in ${dist.dir}/abcl-contrib.jar.
388
389To use ASDF-INSTALL, use the following in your ~/.abclrc:
390
391  (require 'asdf)
392  (pushnew "jar:file:${dist.dir}/abcl-contrib.jar!/asdf-install/" asdf:*central-registry*)
393
394Then issuing
395
396  CL-USER> (require 'asdf-install)
397
398will load ASDF-INSTALL.
399</echo>
400    </target>
401
402    <target name="abcl.debug.jpda" depends="abcl.jar">
403      <description>Invoke ABCL with JPDA listener on port 6789</description>
404      <java fork="true"
405      classpathref="abcl.classpath.dist"
406      classname="org.armedbear.lisp.Main">
407  <jvmarg 
408      value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
409      </java>
410      <echo>JPDA listening on localhost:6789</echo>
411    </target>
412
413    <target name="abcl.run" depends="abcl.jar">
414      <java fork="true"
415      classpathref="abcl.classpath.dist"
416      classname="org.armedbear.lisp.Main">
417      </java>
418    </target>
419
420    <target name="abcl.clean">
421      <delete dir="${build.dir}"/>
422      <delete file="${abcl.jar.path}"/>
423      <delete file="abcl"/>
424      <delete file="abcl.bat"/>
425    </target>
426
427    <target name="abcl.dist" depends="abcl.jar">
428      <copy file="${abcl.jar.path}"
429      toFile="${dist.dir}/abcl-${abcl.version}.jar"/>
430    </target>
431
432    <target name="abcl.distclean" depends="abcl.clean">
433      <delete dir="${dist.dir}"/>
434      <delete file="abcl"/>
435      <delete file="abcl.bat"/>
436    </target>
437
438    <target name="TAGS">
439      <apply executable="etags" parallel="true" verbose="true">
440  <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/>
441  <fileset dir="${src.dir}">
442    <patternset refid="abcl.source.java"/>
443    <patternset refid="abcl.source.lisp"/>
444  </fileset>
445      </apply>
446    </target>
447
448    <patternset id="abcl.dist.misc"
449    description="Additional includes in the source distributions relative to basedir">
450      <include name="build.xml"/>
451      <include name="build.properties.in"/>
452      <include name="COPYING"/>
453      <include name="README"/>
454      <include name="CHANGES"/>
455      <include name="abcl.in"/>
456      <include name="abcl.bat.in"/>
457     
458      <!-- The remainder of these files are used by the Lisp hosted
459           build in 'build-abcl.lisp' but not used by Ant, so include
460           them in the source distribution. -->
461      <include name="make-jar.in"/>
462      <include name="make-jar.bat.in"/>
463
464      <include name="build-from-lisp.sh"/>
465
466      <include name="build-abcl.lisp"/>
467      <include name="customizations.lisp.in"/>
468
469    </patternset>
470
471    <patternset 
472        id="abcl.source.misc"
473        description="Additional includes in the source distribution relative to source root">
474      <include name="org/armedbear/lisp/LICENSE"/>
475      <include name="manifest-abcl"/>
476      <include name="META-INF/services/javax.script.ScriptEngineFactory"/>
477    </patternset>
478
479    <target name="abcl.source.prepare" depends="abcl.stamp.version">
480      <property name="abcl.build.src.dir"
481    value="${build.dir}/abcl-src-${abcl.version}"/>
482      <mkdir dir="${abcl.build.src.dir}/src"/>
483      <copy todir="${abcl.build.src.dir}/src"
484            preservelastmodified="true">
485        <fileset dir="${src.dir}"
486                 id="abcl.source.src">
487            <patternset refid="abcl.source.java"/>
488            <patternset refid="abcl.source.lisp"/>
489            <patternset refid="abcl.source.misc"/>
490        </fileset>
491      </copy>
492      <copy todir="${abcl.build.src.dir}"
493            preservelastmodified="true">
494        <fileset dir="${basedir}">
495            <patternset refid="abcl.dist.misc"/>
496        </fileset>
497      </copy>
498    </target>
499
500    <!--  Files in source distribution that always get LF EOL (aka
501         'unix') -->   
502    <patternset id="abcl.dist.lf">
503      <include name="abcl.in"/>
504    </patternset>
505
506    <!--  Files in source distribution that always get CRLF EOL (aka
507         'dos') -->   
508    <patternset id="abcl.dist.crlf">
509      <include name="abcl.bat.in"/>
510    </patternset>
511
512    <target name="abcl.source.tar" depends="abcl.source.prepare">
513      <fixcrlf srcdir="${abcl.build.src.dir}"
514               preservelastmodified="true"
515               eol="lf">
516      </fixcrlf>
517
518      <fixcrlf srcdir="${abcl.build.src.dir}"
519               preservelastmodified="true"
520               eol="crlf">
521          <patternset refid="abcl.dist.crlf"/>
522      </fixcrlf>
523
524      <fixcrlf srcdir="${abcl.build.src.dir}"
525               preservelastmodified="true"
526               eol="lf">
527          <patternset refid="abcl.dist.lf"/>
528      </fixcrlf>
529
530      <mkdir dir="${dist.dir}"/>
531      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
532     compression="gzip">
533  <tarfileset dir="${build.dir}">
534    <include name="abcl-src-${abcl.version}/**"/>
535  </tarfileset>
536      </tar>
537    </target>
538
539    <target name="abcl.source.zip" depends="abcl.source.prepare">
540      <fixcrlf srcdir="${abcl.build.src.dir}"
541               preservelastmodified="true"
542               eol="crlf">
543      </fixcrlf>
544
545      <fixcrlf srcdir="${abcl.build.src.dir}"
546               preservelastmodified="true"
547               eol="crlf">
548          <patternset refid="abcl.dist.crlf"/>
549      </fixcrlf>
550
551      <fixcrlf srcdir="${abcl.build.src.dir}"
552               preservelastmodified="true"
553               eol="lf">
554          <patternset refid="abcl.dist.lf"/>
555      </fixcrlf>
556
557      <mkdir dir="${dist.dir}"/>
558      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
559     compress="true">
560  <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
561      </zip>
562    </target>
563   
564    <target name="abcl.binary.prepare" depends="abcl.jar,abcl.stamp.version">
565      <property name="abcl.build.binary.dir"
566                value="${build.dir}/abcl-bin-${abcl.version}"/>
567      <mkdir dir="${abcl.build.binary.dir}"/>
568      <copy todir="${abcl.build.binary.dir}"
569            preservelastmodified="true">
570        <fileset dir="${basedir}/dist">
571          <patternset>
572            <include name="abcl.jar"/>
573          </patternset>
574        </fileset>
575        <fileset dir="${basedir}">
576          <patternset>
577            <include name="README"/>
578            <include name="CHANGES"/>
579          </patternset>
580        </fileset>
581      </copy>
582    </target>
583
584    <target name="abcl.binary.tar" depends="abcl.binary.prepare">
585      <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz"
586           compression="gzip">
587        <tarfileset dir="${build.dir}">
588          <include name="abcl-bin-${abcl.version}/**"/>
589          </tarfileset>
590      </tar>
591    </target>
592
593    <target name="abcl.binary.zip" depends="abcl.binary.prepare">
594      <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip"
595           compress="true">
596        <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/>
597      </zip>
598    </target>
599
600    <target name="help.test">
601      <echo>
602The following Ant targets run various test suites:
603 
604  abcl.test
605    --  Run all available tests.
606  abcl.test.java
607    --  Run the ABCL junit Java tests under ${basedir}/test/src
608  abcl.test.lisp
609    --  Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets
610  test.ansi.compiled
611    --  Run the compiled version of the ANSI test suite
612  test.abcl
613    --  Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl
614  test.cl-bench
615    --  Run the cl-bench test suite.
616
617The ANSI tests require that the [ansi-tests][1] be manually installed in
618${basedir}/../ansi-tests.
619
620[1]: svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests
621
622The CL-BENCH test require that [cl-bench][2] be maunally installed in
623${basedir}/../cl-bench
624
625[2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz
626      </echo>
627    </target>
628
629    <property name="abcl.test.classes.dir"
630        value="${build.dir}/classes-test"/>
631
632    <property name="abcl.test.src.dir"
633        value="${basedir}/test/src"/>
634
635    <patternset id="abcl.test.source.java">
636      <!-- For now, we list tests explicitly, because we have to
637           enumerate them later to the JUnit test runner. -->
638      <include name="org/armedbear/lisp/*.java"/>
639    </patternset>
640
641    <property name="junit.path"
642        value="${abcl.ext.dir}/junit-4.8.1.jar"/>
643
644
645    <path id="abcl.test.compile.classpath">
646      <pathelement location="${junit.path}"/>
647      <pathelement location="${build.classes.dir}"/>
648    </path>
649
650    <target name="abcl.test.pre-compile" depends="abcl.ext"/>
651
652    <target name="abcl.ext.p">
653      <!--XXX generalize over enumeration of all contributions to
654           abcl.ext if we get more of them.  -->
655      <available file="${junit.path}" property="abcl.ext.p"/>
656    </target>
657    <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
658
659      <mkdir dir="${abcl.ext.dir}"/>
660      <get 
661          src="http://cloud.github.com/downloads/KentBeck/junit/junit-4.8.1.jar"
662          usetimestamp="true"
663          dest="${junit.path}"/>
664    </target>
665 
666    <target name="abcl.test.compile" 
667      depends="abcl.test.pre-compile">
668      <mkdir dir="${abcl.test.classes.dir}"/>
669      <javac destdir="${abcl.test.classes.dir}"
670       classpathref="abcl.test.compile.classpath"
671       debug="true"
672       target="1.5">
673  <src path="${abcl.test.src.dir}"/>
674  <patternset refid="abcl.test.source.java"/>
675      </javac>
676    </target>
677
678    <path id="abcl.test.run.classpath">
679      <path refid="abcl.test.compile.classpath"/>
680      <pathelement location="${abcl.test.classes.dir}"/>
681    </path>
682
683    <target name="abcl.test" 
684      depends="abcl.test.java,abcl.test.lisp"/>
685 
686    <target name="abcl.test.java" depends="abcl.test.compile">
687      <java fork="true"
688      classpathref="abcl.test.run.classpath"
689      classname="org.junit.runner.JUnitCore">
690        <arg value="org.armedbear.lisp.PathnameTest"/>
691        <arg value="org.armedbear.lisp.StreamTest"/>
692        <arg value="org.armedbear.lisp.UtilitiesTest"/>
693      </java>
694    </target>
695
696    <target name="abcl.test.lisp" 
697      depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
698
699    <target name="test.ansi.interpreted" depends="abcl.jar">
700      <echo>Recording test output in ${abcl.test.log.file}.</echo>
701      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
702      <java fork="true" dir="${basedir}"
703      classpathref="abcl.classpath.dist"
704      classname="org.armedbear.lisp.Main">
705  <arg value="--noinit"/> 
706  <arg value="--eval"/><arg value="(require (quote asdf))"/>
707  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
708  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-interpreted)"/>
709        <arg value="--eval"/><arg value="(ext:exit)"/>
710      </java>
711      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
712      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
713    </target>
714
715    <target name="test.ansi.compiled" depends="abcl.jar">
716      <echo>Recording test output in ${abcl.test.log.file}.</echo>
717      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
718      <java fork="true" dir="${basedir}"
719      classpathref="abcl.classpath.dist"
720      classname="org.armedbear.lisp.Main">
721  <arg value="--noinit"/> 
722  <arg value="--eval"/><arg value="(require (quote asdf))"/>
723  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
724  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-compiled)"/>
725        <arg value="--eval"/><arg value="(ext:exit)"/>
726      </java>
727      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
728      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
729    </target>
730
731    <target name="test.abcl" depends="abcl.jar">
732      <echo>Recording test output in ${abcl.test.log.file}.</echo>
733      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
734      <java fork="true" dir="${basedir}"
735      classpathref="abcl.classpath.dist"
736      classname="org.armedbear.lisp.Main">
737  <arg value="--noinit"/> 
738  <arg value="--eval"/><arg value="(require (quote asdf))"/>
739  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
740  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :abcl-test-lisp)"/>
741        <arg value="--eval"/><arg value="(ext:exit)"/>
742      </java>
743      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
744      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
745    </target>
746
747    <target name="test.cl-bench" depends="abcl.jar">
748      <echo>Recording test output in ${abcl.test.log.file}.</echo>
749      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
750      <java fork="true" dir="${basedir}"
751      classpathref="abcl.classpath.dist"
752      classname="org.armedbear.lisp.Main">
753  <arg value="--noinit"/> 
754  <arg value="--eval"/><arg value="(require (quote asdf))"/>
755  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
756  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :cl-bench)"/>
757        <arg value="--eval"/><arg value="(ext:exit)"/>
758      </java>
759      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
760      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
761    </target>
762   
763    <target name="abcl.release" 
764            depends="abcl.binary.tar,abcl.source.tar,abcl.binary.zip,abcl.source.zip">
765      <copy file="${abcl.jar.path}"
766            tofile="${dist.dir}/abcl-${abcl.version}.jar"/>
767    </target>
768
769    <import file="netbeans-build.xml" optional="true"/> 
770<!--    <import file="j-build.xml" optional="true"/>  -->
771    <import file="not.org-build.xml" optional="true"/> 
772</project>
773
774
775
776
Note: See TracBrowser for help on using the repository browser.