source: trunk/abcl/build.xml @ 12675

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

Fix build from scratch breakage in r12673.

  • Property svn:eol-style set to LF
File size: 27.1 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="--nosystem"/>
245        <arg value="--eval"/>
246        <arg value="(setf *load-verbose* t)"/>
247      </java>
248      <concat destfile="${system.lisp.file}" append="true">
249        <fileset file="${abcl.startup.file}"/>
250      </concat>
251    </target>
252
253    <property name="abcl.build.path"
254        value="${build.classes.dir}/org/armedbear/lisp/build"/>
255    <target name="abcl.stamp" depends="abcl.compile,abcl.stamp.version,abcl.stamp.hostname">
256      <mkdir dir="${abcl.build.path}/.."/>
257      <echo message="${build}" file="${abcl.build.path}"/>   
258    </target>
259
260    <property name="abcl.home.dir"
261              value="${src.dir}/org/armedbear/lisp/"/>
262    <property name="abcl.version.path"
263        value="${build.classes.dir}/org/armedbear/lisp/version"/>
264    <target name="abcl.stamp.version" depends="abcl.compile.java"  >
265      <java fork="true"
266      classpath="${build.classes.dir}"
267      outputproperty="abcl.version"
268      classname="org.armedbear.lisp.Version"
269            logerror="yes"/> <!-- Don't catch stderr output -->
270
271      <echo>ABCL version: ${abcl.version}</echo>
272      <mkdir dir="${abcl.version.path}/.."/>
273      <echo message="${abcl.version}" file="${abcl.version.path}"/> 
274    </target>
275
276    <target name="abcl.stamp.hostname" if="unix">
277      <exec executable="hostname" outputproperty="abcl.hostname"/>
278      <echo>abcl.hostname: ${abcl.hostname}</echo>
279    </target>
280
281    <target name="abcl.system.uptodate">
282      <condition property="abcl.system.needs-update.p">
283        <and>
284          <available file="${system.lisp.file}"/>
285          <available file="${abcl.startup.file}"/>
286          <uptodate
287                srcfile="${system.lisp.file}"
288                targetfile="${abcl.startup.file}"/>
289        </and>
290      </condition>
291    </target>
292   
293    <target name="abcl.system.update.maybe" depends="abcl.system.uptodate" 
294            if="abcl.system.needs-update.p">
295      <touch file="${src.dir}/org/armedbear/lisp/compile-system.lisp"/>
296    </target>
297
298    <target name="abcl.jar.uptodate" depends="abcl.compile">
299      <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}">
300        <srcfiles dir="${build.classes.dir}">
301          <patternset refid="abcl.objects"/>
302        </srcfiles>
303      </uptodate>
304    </target>
305
306    <target name="abcl.jar" depends="abcl.stamp,abcl.jar.uptodate"
307      unless="abcl.jar.uptodate.p">
308      <mkdir dir="${dist.dir}"/>
309      <loadfile property="abcl.version"
310      srcFile="${abcl.version.path}"/>
311      <jar destfile="${abcl.jar.path}"
312     compress="true"
313     basedir="${build.classes.dir}">
314  <patternset refid="abcl.objects"/>
315  <manifest>
316    <attribute name="Main-Class" value="org.armedbear.lisp.Main"/>
317    <section name="org/armedbear/lisp">
318      <attribute name="Implementation-Title" 
319           value="ABCL"/>
320      <attribute name="Implementation-Version" 
321           value="${abcl.version}"/>
322      <attribute name="Implementation-Build" 
323           value="${build}"/>
324      <attribute name="Implementation-Source" 
325           value="${version.src}"/>
326    </section>
327  </manifest>
328  <metainf dir="${src.dir}/META-INF"> 
329    <exclude name="services/javax.script.ScriptEngineFactory"
330       unless="abcl.jsr-223.p"/>
331        </metainf>
332      </jar>
333    </target>
334   
335    <target name="abcl.wrapper" 
336      depends="abcl.jar,abcl.wrapper.unix,abcl.wrapper.windows">
337      <description>
338  Creates in-place exectuable shell wrapper in '${abcl.wrapper.file}'
339      </description>
340      <!-- Set from commandline or in 'build.properties' -->
341      <property name="additional.jars" value=""/>
342      <path id="abcl.runtime.classpath">
343  <pathelement location="${abcl.jar.path}"/>
344  <pathelement path="${additional.jars}"/>
345      </path>
346      <!-- set via '-Djava.options=JAVA_OPTIONS' or in 'build.properties -->
347      <property name="java.options" value=""/>
348
349      <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes">
350  <filterset>
351    <filter token="JAVA" 
352      value="${java.path}"/>
353    <filter token="ABCL_JAVA_OPTIONS" 
354      value="${java.options}"/>
355    <filter token="ABCL_CLASSPATH"
356      value="${toString:abcl.runtime.classpath}"/>
357  </filterset>
358      </copy>
359      <chmod file="${abcl.wrapper.file}" perm="a+x"/>
360
361      <echo>Created executable ABCL wrapper in '${abcl.wrapper.file}'</echo>
362      <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo>
363    </target>
364
365    <target name="abcl.wrapper.unix" if="unix">
366      <property name="abcl.wrapper.file" value="abcl"/>
367      <property name="abcl.wrapper.in.file" value="abcl.in"/>
368    </target>
369
370    <target name="abcl.wrapper.windows" if="windows">
371      <property name="abcl.wrapper.file" value="abcl.bat"/>
372      <property name="abcl.wrapper.in.file" value="abcl.bat.in"/>
373    </target>
374
375    <!-- XXX Generalize when (if?) we get more contribs --> 
376    <target name="abcl.contrib" depends="abcl.jar">
377      <java fork="true"
378            failonerror="true"
379            classpathref="abcl.classpath.dist"
380            dir="${basedir}/contrib/asdf-install/"
381            inputstring="(require 'asdf) (asdf:operate 'asdf:compile-op :asdf-install)"
382            classname="org.armedbear.lisp.Main">
383        <arg value="--noinit"/>
384      </java>
385      <jar destfile="dist/abcl-contrib.jar"
386           compress="true"
387           basedir="contrib">
388        <patternset>
389          <include name="**/*.asd"/>
390          <include name="**/*.lisp"/>
391          <include name="**/*.abcl"/>
392        </patternset>
393      </jar>
394      <echo>
395Packaged contribs in ${dist.dir}/abcl-contrib.jar.
396
397To use ASDF-INSTALL, use the following in your ~/.abclrc:
398
399  (require 'asdf)
400  (pushnew "jar:file:${dist.dir}/abcl-contrib.jar!/asdf-install/" asdf:*central-registry*)
401
402Then issuing
403
404  CL-USER> (require 'asdf-install)
405
406will load ASDF-INSTALL.
407</echo>
408    </target>
409
410    <target name="abcl.debug.jpda" depends="abcl.jar">
411      <description>Invoke ABCL with JPDA listener on port 6789</description>
412      <java fork="true"
413      classpathref="abcl.classpath.dist"
414      classname="org.armedbear.lisp.Main">
415  <jvmarg 
416      value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
417      </java>
418      <echo>JPDA listening on localhost:6789</echo>
419    </target>
420
421    <target name="abcl.run" depends="abcl.jar">
422      <java fork="true"
423      classpathref="abcl.classpath.dist"
424      classname="org.armedbear.lisp.Main">
425      </java>
426    </target>
427
428    <target name="abcl.clean">
429      <delete dir="${build.dir}"/>
430      <delete file="${abcl.jar.path}"/>
431      <delete file="abcl"/>
432      <delete file="abcl.bat"/>
433    </target>
434
435    <target name="abcl.dist" depends="abcl.jar">
436      <copy file="${abcl.jar.path}"
437      toFile="${dist.dir}/abcl-${abcl.version}.jar"/>
438    </target>
439
440    <target name="abcl.distclean" depends="abcl.clean">
441      <delete dir="${dist.dir}"/>
442      <delete file="abcl"/>
443      <delete file="abcl.bat"/>
444    </target>
445
446    <target name="TAGS">
447      <apply executable="etags" parallel="true" verbose="true">
448  <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/>
449  <fileset dir="${src.dir}">
450    <patternset refid="abcl.source.java"/>
451    <patternset refid="abcl.source.lisp"/>
452  </fileset>
453      </apply>
454    </target>
455
456    <patternset id="abcl.dist.misc"
457    description="Additional includes in the source distributions relative to basedir">
458      <include name="build.xml"/>
459      <include name="build.properties.in"/>
460      <include name="COPYING"/>
461      <include name="README"/>
462      <include name="CHANGES"/>
463      <include name="abcl.in"/>
464      <include name="abcl.bat.in"/>
465     
466      <!-- The remainder of these files are used by the Lisp hosted
467           build in 'build-abcl.lisp' but not used by Ant, so include
468           them in the source distribution. -->
469      <include name="make-jar.in"/>
470      <include name="make-jar.bat.in"/>
471
472      <include name="build-from-lisp.sh"/>
473
474      <include name="build-abcl.lisp"/>
475      <include name="customizations.lisp.in"/>
476
477    </patternset>
478
479    <patternset 
480        id="abcl.source.misc"
481        description="Additional includes in the source distribution relative to source root">
482      <include name="org/armedbear/lisp/LICENSE"/>
483      <include name="manifest-abcl"/>
484      <include name="META-INF/services/javax.script.ScriptEngineFactory"/>
485    </patternset>
486
487    <target name="abcl.source.prepare" depends="abcl.stamp.version">
488      <property name="abcl.build.src.dir"
489    value="${build.dir}/abcl-src-${abcl.version}"/>
490      <mkdir dir="${abcl.build.src.dir}/src"/>
491      <copy todir="${abcl.build.src.dir}/src"
492            preservelastmodified="true">
493        <fileset dir="${src.dir}"
494                 id="abcl.source.src">
495            <patternset refid="abcl.source.java"/>
496            <patternset refid="abcl.source.lisp"/>
497            <patternset refid="abcl.source.misc"/>
498        </fileset>
499      </copy>
500      <copy todir="${abcl.build.src.dir}"
501            preservelastmodified="true">
502        <fileset dir="${basedir}">
503            <patternset refid="abcl.dist.misc"/>
504        </fileset>
505      </copy>
506    </target>
507
508    <!--  Files in source distribution that always get LF EOL (aka
509         'unix') -->   
510    <patternset id="abcl.dist.lf">
511      <include name="abcl.in"/>
512    </patternset>
513
514    <!--  Files in source distribution that always get CRLF EOL (aka
515         'dos') -->   
516    <patternset id="abcl.dist.crlf">
517      <include name="abcl.bat.in"/>
518    </patternset>
519
520    <target name="abcl.source.tar" depends="abcl.source.prepare">
521      <fixcrlf srcdir="${abcl.build.src.dir}"
522               preservelastmodified="true"
523               eol="lf">
524      </fixcrlf>
525
526      <fixcrlf srcdir="${abcl.build.src.dir}"
527               preservelastmodified="true"
528               eol="crlf">
529          <patternset refid="abcl.dist.crlf"/>
530      </fixcrlf>
531
532      <fixcrlf srcdir="${abcl.build.src.dir}"
533               preservelastmodified="true"
534               eol="lf">
535          <patternset refid="abcl.dist.lf"/>
536      </fixcrlf>
537
538      <mkdir dir="${dist.dir}"/>
539      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
540     compression="gzip">
541  <tarfileset dir="${build.dir}">
542    <include name="abcl-src-${abcl.version}/**"/>
543  </tarfileset>
544      </tar>
545    </target>
546
547    <target name="abcl.source.zip" depends="abcl.source.prepare">
548      <fixcrlf srcdir="${abcl.build.src.dir}"
549               preservelastmodified="true"
550               eol="crlf">
551      </fixcrlf>
552
553      <fixcrlf srcdir="${abcl.build.src.dir}"
554               preservelastmodified="true"
555               eol="crlf">
556          <patternset refid="abcl.dist.crlf"/>
557      </fixcrlf>
558
559      <fixcrlf srcdir="${abcl.build.src.dir}"
560               preservelastmodified="true"
561               eol="lf">
562          <patternset refid="abcl.dist.lf"/>
563      </fixcrlf>
564
565      <mkdir dir="${dist.dir}"/>
566      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
567     compress="true">
568  <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
569      </zip>
570    </target>
571   
572    <target name="abcl.binary.prepare" depends="abcl.jar,abcl.stamp.version">
573      <property name="abcl.build.binary.dir"
574                value="${build.dir}/abcl-bin-${abcl.version}"/>
575      <mkdir dir="${abcl.build.binary.dir}"/>
576      <copy todir="${abcl.build.binary.dir}"
577            preservelastmodified="true">
578        <fileset dir="${basedir}/dist">
579          <patternset>
580            <include name="abcl.jar"/>
581          </patternset>
582        </fileset>
583        <fileset dir="${basedir}">
584          <patternset>
585            <include name="README"/>
586            <include name="CHANGES"/>
587          </patternset>
588        </fileset>
589      </copy>
590    </target>
591
592    <target name="abcl.binary.tar" depends="abcl.binary.prepare">
593      <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz"
594           compression="gzip">
595        <tarfileset dir="${build.dir}">
596          <include name="abcl-bin-${abcl.version}/**"/>
597          </tarfileset>
598      </tar>
599    </target>
600
601    <target name="abcl.binary.zip" depends="abcl.binary.prepare">
602      <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip"
603           compress="true">
604        <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/>
605      </zip>
606    </target>
607
608    <target name="help.test">
609      <echo>
610The following Ant targets run various test suites:
611 
612  abcl.test
613    --  Run all available tests.
614  abcl.test.java
615    --  Run the ABCL junit Java tests under ${basedir}/test/src
616  abcl.test.lisp
617    --  Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets
618  test.ansi.compiled
619    --  Run the compiled version of the ANSI test suite
620  test.abcl
621    --  Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl
622  test.cl-bench
623    --  Run the cl-bench test suite.
624
625The ANSI tests require that the [ansi-tests][1] be manually installed in
626${basedir}/../ansi-tests.
627
628[1]: svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests
629
630The CL-BENCH test require that [cl-bench][2] be maunally installed in
631${basedir}/../cl-bench
632
633[2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz
634      </echo>
635    </target>
636
637    <property name="abcl.test.classes.dir"
638        value="${build.dir}/classes-test"/>
639
640    <property name="abcl.test.src.dir"
641        value="${basedir}/test/src"/>
642
643    <patternset id="abcl.test.source.java">
644      <!-- For now, we list tests explicitly, because we have to
645           enumerate them later to the JUnit test runner. -->
646      <include name="org/armedbear/lisp/*.java"/>
647    </patternset>
648
649    <property name="junit.path"
650        value="${abcl.ext.dir}/junit-4.8.1.jar"/>
651
652
653    <path id="abcl.test.compile.classpath">
654      <pathelement location="${junit.path}"/>
655      <pathelement location="${build.classes.dir}"/>
656    </path>
657
658    <target name="abcl.test.pre-compile" depends="abcl.ext"/>
659
660    <target name="abcl.ext.p">
661      <!--XXX generalize over enumeration of all contributions to
662           abcl.ext if we get more of them.  -->
663      <available file="${junit.path}" property="abcl.ext.p"/>
664    </target>
665    <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
666
667      <mkdir dir="${abcl.ext.dir}"/>
668      <get 
669          src="http://cloud.github.com/downloads/KentBeck/junit/junit-4.8.1.jar"
670          usetimestamp="true"
671          dest="${junit.path}"/>
672    </target>
673 
674    <target name="abcl.test.compile" 
675      depends="abcl.test.pre-compile">
676      <mkdir dir="${abcl.test.classes.dir}"/>
677      <javac destdir="${abcl.test.classes.dir}"
678       classpathref="abcl.test.compile.classpath"
679       debug="true"
680       target="1.5">
681  <src path="${abcl.test.src.dir}"/>
682  <patternset refid="abcl.test.source.java"/>
683      </javac>
684    </target>
685
686    <path id="abcl.test.run.classpath">
687      <path refid="abcl.test.compile.classpath"/>
688      <pathelement location="${abcl.test.classes.dir}"/>
689    </path>
690
691    <target name="abcl.test" 
692      depends="abcl.test.java,abcl.test.lisp"/>
693 
694    <target name="abcl.test.java" depends="abcl.test.compile">
695      <java fork="true"
696      classpathref="abcl.test.run.classpath"
697      classname="org.junit.runner.JUnitCore">
698        <arg value="org.armedbear.lisp.PathnameTest"/>
699        <arg value="org.armedbear.lisp.StreamTest"/>
700        <arg value="org.armedbear.lisp.UtilitiesTest"/>
701      </java>
702    </target>
703
704    <target name="abcl.test.lisp" 
705      depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
706
707    <target name="test.ansi.interpreted" depends="abcl.jar">
708      <echo>Recording test output in ${abcl.test.log.file}.</echo>
709      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
710      <java fork="true" dir="${basedir}"
711      classpathref="abcl.classpath.dist"
712      classname="org.armedbear.lisp.Main">
713  <arg value="--noinit"/> 
714  <arg value="--eval"/><arg value="(require (quote asdf))"/>
715  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
716  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-interpreted)"/>
717        <arg value="--eval"/><arg value="(ext:exit)"/>
718      </java>
719      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
720      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
721    </target>
722
723    <target name="test.ansi.compiled" depends="abcl.jar">
724      <echo>Recording test output in ${abcl.test.log.file}.</echo>
725      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
726      <java fork="true" dir="${basedir}"
727      classpathref="abcl.classpath.dist"
728      classname="org.armedbear.lisp.Main">
729  <arg value="--noinit"/> 
730  <arg value="--eval"/><arg value="(require (quote asdf))"/>
731  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
732  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-compiled)"/>
733        <arg value="--eval"/><arg value="(ext:exit)"/>
734      </java>
735      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
736      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
737    </target>
738
739    <target name="test.abcl" depends="abcl.jar">
740      <echo>Recording test output in ${abcl.test.log.file}.</echo>
741      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
742      <java fork="true" dir="${basedir}"
743      classpathref="abcl.classpath.dist"
744      classname="org.armedbear.lisp.Main">
745  <arg value="--noinit"/> 
746  <arg value="--eval"/><arg value="(require (quote asdf))"/>
747  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
748  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :abcl-test-lisp)"/>
749        <arg value="--eval"/><arg value="(ext:exit)"/>
750      </java>
751      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
752      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
753    </target>
754
755    <target name="test.cl-bench" depends="abcl.jar">
756      <echo>Recording test output in ${abcl.test.log.file}.</echo>
757      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
758      <java fork="true" dir="${basedir}"
759      classpathref="abcl.classpath.dist"
760      classname="org.armedbear.lisp.Main">
761  <arg value="--noinit"/> 
762  <arg value="--eval"/><arg value="(require (quote asdf))"/>
763  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
764  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :cl-bench)"/>
765        <arg value="--eval"/><arg value="(ext:exit)"/>
766      </java>
767      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
768      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
769    </target>
770   
771    <target name="abcl.release" 
772            depends="abcl.binary.tar,abcl.source.tar,abcl.binary.zip,abcl.source.zip">
773      <copy file="${abcl.jar.path}"
774            tofile="${dist.dir}/abcl-${abcl.version}.jar"/>
775    </target>
776
777    <import file="netbeans-build.xml" optional="true"/> 
778<!--    <import file="j-build.xml" optional="true"/>  -->
779    <import file="not.org-build.xml" optional="true"/> 
780</project>
781
782
783
784
Note: See TracBrowser for help on using the repository browser.