source: trunk/abcl/build.xml @ 12532

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

Rename 'build.properties' to 'abcl.properties'.

Eclipse uses 'build.properties' for its own nefarious purposes, so for
ABCL to play nice in the Eclipse RCP ecosystem we disentangle possible
confusion.

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