source: branches/invokedynamic/abcl/build.xml @ 12921

Last change on this file since 12921 was 12921, checked in by astalla, 12 years ago

preliminary test of invokedynamic (Java only, no compiler integration)

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