source: trunk/abcl/build.xml @ 12404

Last change on this file since 12404 was 12404, checked in by Mark Evenson, 12 years ago

Debugging ABCL compilation support; upgrade to JUnit-4.8.1.

Netbeans uses compiled directories before source.

Setting the property 'abcl.compile.lisp.skip' will skip the
compilation of the Lisp files which can be useful to debug under
Netbeans when debugging fundamental parts of ABCL.

Started to document useful Ant-based build knobs in
'build.properties.in'.

Added PathnameTest? and StreamTest? to Java unit tests.

Start documenting properties that affect the Ant build in
'build.properties.in'.

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