source: trunk/abcl/build.xml @ 12750

Last change on this file since 12750 was 12750, checked in by Mark Evenson, 11 years ago

Include "examples/" is source release.

Rported and Patched by Mario Lang.

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