source: trunk/abcl/build.xml @ 12847

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

Remove possible FASL artifacts from source directory.

When working on ABCL from SLIME, one often inadvertently creates FASL
artifacts in the source directory, which can interfere with
system compilation.

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