source: tags/0.25.0/abcl/build.xml

Last change on this file was 13212, checked in by Mark Evenson, 13 years ago

Added Ant targets to generate javadoc.

'abcl.javadoc' generates the javadoc documentation under
'build/javadoc'.

'abcl.javadoc.jar' packages the javadoc documentation into
'dist/abcl-${abcl.version}-javadoc.jar'.

  • Property svn:eol-style set to LF
File size: 31.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/version"/>
89      <include name="org/armedbear/lisp/scripting/*.class" if="abcl.jsr-223.p"/>
90      <include name="org/armedbear/lisp/scripting/util/*.class" if="abcl.jsr-223.p"/>
91      <patternset refid="abcl.source.lisp.dist"/>
92    </patternset>
93   
94    <path id="abcl.classpath.dist">
95      <pathelement location="${abcl.jar.path}"/>
96    </path>
97   
98    <path id="abcl.classpath.build">
99      <pathelement location="${build.classes.dir}"/>
100    </path>
101
102    <target name="abcl.compile" depends="abcl.clean.maybe,abcl.compile.lisp">
103      <echo>Compiled ABCL with Java version: ${java.version}</echo>
104    </target>
105
106    <target name="abcl.clean.maybe" unless="abcl.build.incremental">
107      <echo>Cleaning all intermediate compilation artifacts.</echo>
108      <echo>Setting 'abcl.build.incremental' enables incremental compilation.</echo>
109      <antcall target="abcl.clean"/>
110    </target>
111     
112
113    <target name="abcl.init">
114      <tstamp>
115  <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/>
116      </tstamp>
117
118      <tstamp>
119  <format property="build.stamp" pattern="yyyymmdd-HHmm"/>
120      </tstamp>
121
122      <property name="abcl.test.log.file"
123    value="abcl-test-${build.stamp}.log"/>
124
125      <property name="java.path"
126    value="${java.home}/bin/java"/>
127
128      <!-- Deprecated. Two main types of build environents: 'unix' or 'windows'. -->
129      <condition property="unix"> 
130  <or>
131    <os family="unix"/>
132    <os family="mac"/>
133  </or>
134      </condition>
135      <condition property="windows"> 
136  <os family="windows"/>
137      </condition>
138
139      <!-- Deprecated. -->
140      <available file="${src.dir}org/armedbear/lisp/Interpreter.java" 
141     property="abcl.lisp.p"/>
142
143      <echo>java.version: ${java.version}</echo>
144      <condition property="abcl.java.version.p">
145  <or>
146    <matches string="${java.version}" pattern="1\.5"/>
147    <matches string="${java.version}" pattern="1\.6\.0_[12][0-9]"/>
148  </or> 
149      </condition>
150
151    </target>
152   
153    <target name="abcl.java.warning" 
154      depends="abcl.init"
155      unless="abcl.java.version.p">
156      <echo>WARNING: Use of Java version ${java.version} not recommended.</echo>
157    </target>
158 
159    <target name="abcl.jsr-223.notice"
160      depends="abcl.init"
161      unless="abcl.jsr-223.p">
162      <echo>
163  Notice: JSR-223 support won't be built since it is not
164          supported, neither natively by your JVM nor by
165    libraries in the CLASSPATH.
166      </echo>
167    </target>
168
169    <target name="abcl.compile.java" 
170      depends="abcl.init,abcl.java.warning,abcl.jsr-223.notice">
171      <mkdir dir="${build.dir}"/>
172      <mkdir dir="${build.classes.dir}"/>
173      <javac destdir="${build.classes.dir}"
174       debug="true"
175       target="1.5"
176             includeantruntime="false"
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    <pathconvert dirsep="/" property="abcl.lisp.output" refid="abcl.lisp.output.path"/>
224
225    <property name="system.lisp.file" 
226              value="${build.classes.dir}/org/armedbear/lisp/system.lisp"/>
227   
228    <target name="abcl.compile.lisp" 
229      depends="abcl.copy.lisp,abcl.compile.java,abcl.system.update.maybe,abcl.fasls.uptodate"
230      unless="abcl.fasls.uptodate.p">
231      <echo>
232Compiling Lisp system
233from ${abcl.home.dir}
234 to  ${abcl.lisp.output}</echo>
235 
236     <!-- Not good if ${abcl.home.dir} == ${abcl.lisp.output} -->
237     <delete>
238       <fileset dir="${abcl.home.dir}" includes="**/*.abcl **/*.cls **/*._"/>
239     </delete>
240     <java classpath="${build.classes.dir}" 
241      fork="true"
242      failonerror="true"
243            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))))"
244      classname="org.armedbear.lisp.Main">
245        <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/>
246  <arg value="--noinit"/>
247        <arg value="--nosystem"/>
248        <arg value="--eval"/>
249        <arg value="(setf *load-verbose* t)"/>
250      </java>
251      <concat destfile="${system.lisp.file}" append="true">
252        <fileset file="${abcl.startup.file}"/>
253      </concat>
254    </target>
255
256    <property name="abcl.build.path"
257        value="${build.classes.dir}/org/armedbear/lisp/build"/>
258    <target name="abcl.stamp" 
259            depends="abcl.compile,abcl.stamp.version,abcl.stamp.hostname">
260      <mkdir dir="${abcl.build.path}/.."/>
261      <echo message="${build}" file="${abcl.build.path}"/>   
262    </target>
263
264
265    <!-- Environment variables may be accessed as ${env.NAME} -->
266    <property environment="env"/>
267
268    <!-- Can we derive an SVN version from the current build tree? -->
269    <condition property="abcl.version.svn.p">
270      <and>
271        <available
272            file="${basedir}/.svn"
273            type="dir"/>
274        <or>
275            <available
276                file="svnversion.exe"
277                filepath="${env.Path}"/>
278            <available
279                file="svnversion.exe"
280                filepath="${env.PATH}"/>
281             <available
282                file="svnversion"
283                filepath="${env.Path}"/>
284            <available
285                file="svnversion"
286                filepath="${env.PATH}"/>
287        </or>
288      </and>
289    </condition>
290
291    <target name="abcl.version.src" depends="abcl.version.src.3"/>
292
293    <target name="abcl.version.src.0" if="windows">
294      <exec
295          executable="svnversion.exe"
296          outputproperty="abcl.version.svn"
297          failifexecutionfails="false"
298          searchpath="true" />
299    </target>
300
301    <target name="abcl.version.src.1" depends="abcl.version.src.0">
302      <exec 
303          executable="svnversion"
304          outputproperty="abcl.version.svn"
305          failifexecutionfails="false"
306          searchpath="true" />
307    </target>
308
309    <target name="abcl.version.src.2" 
310            depends="abcl.version.src.1"
311            if="abcl.version.svn.p">
312      <echo>abcl.version.svn: ${abcl.version.svn}</echo>
313      <property name="abcl.version.src"
314                value="svn-${abcl.version.svn}"/>
315    </target>
316
317    <target name="abcl.version.src.3"
318            depends="abcl.version.src.2"
319            unless="abcl.version.svn.p">
320      <property name="abcl.version.src"
321                value=""/>
322    </target>
323
324    <property name="abcl.home.dir"
325              value="${src.dir}/org/armedbear/lisp/"/>
326    <property name="abcl.version.path"
327        value="${build.classes.dir}/org/armedbear/lisp/version"/>
328
329    <target name="abcl.clean.version">
330      <delete file="${abcl.version.path}"/>
331    </target>
332
333    <target name="abcl.stamp.version" 
334            depends="abcl.clean.version,abcl.version.src,abcl.stamp.version.1,abcl.stamp.version.2">
335      <mkdir dir="${abcl.version.path}/.."/>
336      <echo>ABCL implementation version: ${abcl.implementation.version}</echo>
337      <echo file="${abcl.version.path}">${abcl.implementation.version}</echo>
338    </target>
339   
340    <target name="abcl.stamp.version.0" 
341            depends="abcl.compile.java">
342      <java fork="true"
343      classpath="${build.classes.dir}"
344      outputproperty="abcl.version"
345      classname="org.armedbear.lisp.Version"
346            logerror="yes"/> <!-- Don't catch stderr output -->
347    </target>
348
349    <target name="abcl.stamp.version.1"
350            depends="abcl.stamp.version.0"
351            unless="abcl.version.svn.p">
352      <property name="abcl.implementation.version"
353                value="${abcl.version}"/>
354    </target>
355
356    <target name="abcl.stamp.version.2" 
357            depends="abcl.stamp.version.0"
358            if="abcl.version.svn.p">
359      <property name="abcl.implementation.version"
360                value="${abcl.version}-${abcl.version.src}"/>
361    </target>
362
363    <target name="abcl.stamp.hostname" if="unix">
364      <exec executable="hostname" outputproperty="abcl.hostname"/>
365      <echo>abcl.hostname: ${abcl.hostname}</echo>
366    </target>
367
368    <target name="abcl.system.uptodate">
369      <condition property="abcl.system.needs-update.p">
370        <and>
371          <available file="${system.lisp.file}"/>
372          <available file="${abcl.startup.file}"/>
373          <uptodate
374                srcfile="${system.lisp.file}"
375                targetfile="${abcl.startup.file}"/>
376        </and>
377      </condition>
378    </target>
379   
380    <target name="abcl.system.update.maybe" depends="abcl.system.uptodate" 
381            if="abcl.system.needs-update.p">
382      <touch file="${src.dir}/org/armedbear/lisp/compile-system.lisp"/>
383    </target>
384
385    <target name="abcl.jar.uptodate" depends="abcl.compile">
386      <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}">
387        <srcfiles dir="${build.classes.dir}">
388          <patternset refid="abcl.objects"/>
389        </srcfiles>
390      </uptodate>
391    </target>
392
393    <target name="abcl.jar" depends="abcl.stamp,abcl.jar.uptodate"
394      unless="abcl.jar.uptodate.p">
395      <mkdir dir="${dist.dir}"/>
396      <loadfile property="abcl.version"
397      srcFile="${abcl.version.path}"/>
398      <jar destfile="${abcl.jar.path}"
399     compress="true"
400     basedir="${build.classes.dir}">
401  <patternset refid="abcl.objects"/>
402  <manifest>
403    <attribute name="Main-Class" value="org.armedbear.lisp.Main"/>
404    <section name="org/armedbear/lisp">
405      <attribute name="Implementation-Title" 
406           value="ABCL"/>
407      <attribute name="Implementation-Version" 
408           value="${abcl.implementation.version}"/>
409      <attribute name="Implementation-Build" 
410           value="${build}"/>
411    </section>
412  </manifest>
413  <metainf dir="${src.dir}/META-INF"> 
414    <exclude name="services/javax.script.ScriptEngineFactory"
415       unless="abcl.jsr-223.p"/>
416        </metainf>
417      </jar>
418    </target>
419   
420    <target name="abcl.wrapper" 
421      depends="abcl.jar,abcl.wrapper.unix,abcl.wrapper.windows">
422      <description>
423  Creates in-place exectuable shell wrapper in '${abcl.wrapper.file}'
424      </description>
425      <!-- Set from commandline or in 'build.properties' -->
426      <property name="additional.jars" value=""/>
427      <path id="abcl.runtime.classpath">
428  <pathelement location="${abcl.jar.path}"/>
429  <pathelement path="${additional.jars}"/>
430      </path>
431      <!-- set via '-Djava.options=JAVA_OPTIONS' or in 'build.properties -->
432      <property name="java.options" value=""/>
433
434      <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes">
435  <filterset>
436    <filter token="JAVA" 
437      value="${java.path}"/>
438    <filter token="ABCL_JAVA_OPTIONS" 
439      value="${java.options}"/>
440    <filter token="ABCL_CLASSPATH"
441      value="${toString:abcl.runtime.classpath}"/>
442  </filterset>
443      </copy>
444      <chmod file="${abcl.wrapper.file}" perm="a+x"/>
445
446      <echo>Created executable ABCL wrapper in '${abcl.wrapper.file}'</echo>
447      <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo>
448    </target>
449
450    <target name="abcl.wrapper.unix" if="unix">
451      <property name="abcl.wrapper.file" value="abcl"/>
452      <property name="abcl.wrapper.in.file" value="abcl.in"/>
453    </target>
454
455    <target name="abcl.wrapper.windows" if="windows">
456      <property name="abcl.wrapper.file" value="abcl.bat"/>
457      <property name="abcl.wrapper.in.file" value="abcl.bat.in"/>
458    </target>
459
460    <!-- XXX Generalize when (if?) we get more contribs --> 
461    <target name="abcl.contrib.compile" depends="abcl.jar">
462      <java fork="true"
463      failonerror="true"
464            classpathref="abcl.classpath.dist"
465            inputstring="(require 'asdf) (handler-case (progn (setf *default-pathname-defaults* &quot;${basedir}/contrib/asdf-install/&quot;) (asdf:operate 'asdf:compile-op :asdf-install)) (t (x) (progn (format t &quot;~A: ~A~%&quot; (type-of x) x) (exit :status -1))))"
466            classname="org.armedbear.lisp.Main">
467        <arg value="--noinit"/>
468      </java>
469    </target>
470   
471    <target name="abcl.contrib" depends="abcl.contrib.compile">
472      <jar destfile="dist/abcl-contrib.jar"
473           compress="true"
474           basedir="contrib">
475        <patternset>
476          <include name="**/*.asd"/>
477          <include name="**/*.lisp"/>
478          <include name="**/*.abcl"/>
479        </patternset>
480      </jar>
481      <echo>
482Packaged contribs in ${dist.dir}/abcl-contrib.jar.
483
484To use ASDF-INSTALL, use the following in your ~/.abclrc:
485
486  (require 'asdf)
487  (pushnew "jar:file:${dist.dir}/abcl-contrib.jar!/asdf-install/" asdf:*central-registry*)
488
489Then issuing
490
491  CL-USER> (require 'asdf-install)
492
493will load ASDF-INSTALL.
494</echo>
495    </target>
496
497    <target name="abcl.debug.jpda" depends="abcl.jar">
498      <description>Invoke ABCL with JPDA listener on port 6789</description>
499      <java fork="true"
500      classpathref="abcl.classpath.dist"
501      classname="org.armedbear.lisp.Main">
502  <jvmarg 
503      value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
504      </java>
505      <echo>JPDA listening on localhost:6789</echo>
506    </target>
507
508    <target name="abcl.build.debug.jpda" depends="abcl.compile.java">
509      <description>Invoke ABCL with JPDA listener on port 6789</description>
510      <java fork="true"
511      classpathref="abcl.classpath.build"
512      classname="org.armedbear.lisp.Main">
513  <jvmarg
514      value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
515        <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/>
516      </java>
517      <echo>JPDA listening on localhost:6789</echo>
518    </target>
519
520    <target name="abcl.run" depends="abcl.jar">
521      <java fork="true"
522      classpathref="abcl.classpath.dist"
523      classname="org.armedbear.lisp.Main">
524      </java>
525    </target>
526
527    <target name="abcl.clean">
528      <delete dir="${build.dir}"/>
529      <delete file="${abcl.jar.path}"/>
530      <delete file="abcl"/>
531      <delete file="abcl.bat"/>
532    </target>
533
534    <target name="abcl.dist" depends="abcl.jar">
535      <copy file="${abcl.jar.path}"
536      toFile="${dist.dir}/abcl-${abcl.version}.jar"/>
537    </target>
538
539    <target name="abcl.distclean" depends="abcl.clean">
540      <delete dir="${dist.dir}"/>
541      <delete file="abcl"/>
542      <delete file="abcl.bat"/>
543    </target>
544
545    <target name="TAGS">
546      <delete file="TAGS"/>
547      <apply executable="etags" parallel="true" verbose="true" maxparallel="300">
548        <arg value="--append"/>
549  <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/>
550  <arg value='--regex=|[ \t]*@DocString([ \t]*name=\"\([^\"]*\)|\1|'/>
551  <fileset dir="${src.dir}">
552    <patternset refid="abcl.source.java"/>
553    <patternset refid="abcl.source.lisp"/>
554  </fileset>
555      </apply>
556    </target>
557
558    <patternset id="abcl.dist.misc"
559    description="Additional includes in the source distributions relative to basedir">
560      <include name="build.xml"/>
561      <include name="abcl.properties.in"/>
562      <include name="COPYING"/>
563      <include name="README"/>
564      <include name="CHANGES"/>
565      <include name="abcl.in"/>
566      <include name="abcl.bat.in"/>
567     
568      <include name="examples/**"/>
569
570      <include name="contrib/**"/>
571
572      <include name="build-from-lisp.sh"/>
573     
574      <!-- The remainder of these files are used by the Lisp hosted
575           build in 'build-abcl.lisp' but not used by Ant, so include
576           them in the source distribution. -->
577      <include name="make-jar.in"/>
578      <include name="make-jar.bat.in"/>
579
580
581
582      <include name="build-abcl.lisp"/>
583      <include name="customizations.lisp.in"/>
584
585    </patternset>
586
587    <patternset 
588        id="abcl.source.misc"
589        description="Additional includes in the source distribution relative to source root">
590      <include name="org/armedbear/lisp/LICENSE"/>
591      <include name="manifest-abcl"/>
592      <include name="META-INF/services/javax.script.ScriptEngineFactory"/>
593    </patternset>
594
595    <target name="abcl.source.prepare" depends="abcl.stamp.version">
596      <property name="abcl.build.src.dir"
597    value="${build.dir}/abcl-src-${abcl.version}"/>
598      <mkdir dir="${abcl.build.src.dir}/src"/>
599      <copy todir="${abcl.build.src.dir}/src"
600            preservelastmodified="true">
601        <fileset dir="${src.dir}"
602                 id="abcl.source.src">
603            <patternset refid="abcl.source.java"/>
604            <patternset refid="abcl.source.lisp"/>
605            <patternset refid="abcl.source.misc"/>
606        </fileset>
607      </copy>
608      <copy todir="${abcl.build.src.dir}"
609            preservelastmodified="true">
610        <fileset dir="${basedir}">
611            <patternset refid="abcl.dist.misc"/>
612        </fileset>
613      </copy>
614    </target>
615
616    <!--  Files in source distribution that always get LF EOL (aka
617         'unix') -->   
618    <patternset id="abcl.dist.lf">
619      <include name="abcl.in"/>
620    </patternset>
621
622    <!--  Files in source distribution that always get CRLF EOL (aka
623         'dos') -->   
624    <patternset id="abcl.dist.crlf">
625      <include name="abcl.bat.in"/>
626    </patternset>
627
628    <target name="abcl.source.unix" depends="abcl.source.prepare">
629      <fixcrlf srcdir="${abcl.build.src.dir}"
630               preservelastmodified="true"
631               eol="lf">
632      </fixcrlf>
633
634      <fixcrlf srcdir="${abcl.build.src.dir}"
635               preservelastmodified="true"
636               eol="crlf">
637          <patternset refid="abcl.dist.crlf"/>
638      </fixcrlf>
639
640      <fixcrlf srcdir="${abcl.build.src.dir}"
641               preservelastmodified="true"
642               eol="lf">
643          <patternset refid="abcl.dist.lf"/>
644      </fixcrlf>
645    </target>
646
647    <target name="abcl.source.tar" depends="abcl.source.unix">
648      <mkdir dir="${dist.dir}"/>
649      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
650     compression="gzip">
651  <tarfileset dir="${build.dir}">
652    <include name="abcl-src-${abcl.version}/**"/>
653  </tarfileset>
654      </tar>
655    </target>
656
657    <target name="abcl.source.windows" depends="abcl.source.prepare">
658      <fixcrlf srcdir="${abcl.build.src.dir}"
659               preservelastmodified="true"
660               eol="crlf">
661      </fixcrlf>
662
663      <fixcrlf srcdir="${abcl.build.src.dir}"
664               preservelastmodified="true"
665               eol="crlf">
666          <patternset refid="abcl.dist.crlf"/>
667      </fixcrlf>
668
669      <fixcrlf srcdir="${abcl.build.src.dir}"
670               preservelastmodified="true"
671               eol="lf">
672          <patternset refid="abcl.dist.lf"/>
673      </fixcrlf>
674    </target>
675
676    <target name="abcl.source.zip" depends="abcl.source.windows">
677      <mkdir dir="${dist.dir}"/>
678      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
679     compress="true">
680  <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
681      </zip>
682    </target>
683
684    <target name="abcl.source.jar" depends="abcl.source.unix">
685      <mkdir dir="${dist.dir}"/>
686      <jar destfile="${dist.dir}/abcl-${abcl.version}-sources.jar">
687        <metainf dir="${abcl.build.src.dir}">
688          <include name="COPYING"/>
689        </metainf>
690        <fileset dir="${abcl.build.src.dir}/src">
691          <include name="**/*.java"/>
692          <include name="**/*.lisp"/>
693        </fileset>
694      </jar>
695    </target>
696
697    <property name="abcl.javadoc.dir" value="${build.dir}/javadoc"/>
698
699    <target name="abcl.javadoc">
700      <mkdir dir="${abcl.javadoc.dir}"/>
701      <javadoc destdir="${abcl.javadoc.dir}"
702               sourcepath="${src.dir}"/>
703    </target>
704   
705    <target name="abcl.javadoc.jar" depends="abcl.stamp.version,abcl.javadoc">
706      <mkdir dir="${dist.dir}"/>
707      <jar destfile="${dist.dir}/abcl-${abcl.version}-javadoc.jar">
708        <fileset dir="${abcl.javadoc.dir}"/>
709      </jar>
710    </target>
711
712    <target name="abcl.binary.prepare" depends="abcl.jar,abcl.stamp.version">
713      <property name="abcl.build.binary.dir"
714                value="${build.dir}/abcl-bin-${abcl.version}"/>
715      <mkdir dir="${abcl.build.binary.dir}"/>
716      <copy todir="${abcl.build.binary.dir}"
717            preservelastmodified="true">
718        <fileset dir="${basedir}/dist">
719          <patternset>
720            <include name="abcl.jar"/>
721          </patternset>
722        </fileset>
723        <fileset dir="${basedir}">
724          <patternset>
725            <include name="README"/>
726            <include name="CHANGES"/>
727          </patternset>
728        </fileset>
729      </copy>
730    </target>
731
732    <target name="abcl.binary.tar" depends="abcl.binary.prepare">
733      <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz"
734           compression="gzip">
735        <tarfileset dir="${build.dir}">
736          <include name="abcl-bin-${abcl.version}/**"/>
737          </tarfileset>
738      </tar>
739    </target>
740
741    <target name="abcl.binary.zip" depends="abcl.binary.prepare">
742      <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip"
743           compress="true">
744        <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/>
745      </zip>
746    </target>
747
748    <target name="help.test">
749      <echo>
750The following Ant targets run various test suites:
751 
752  abcl.test
753    --  Run all available tests.
754  abcl.test.java
755    --  Run the ABCL junit Java tests under ${basedir}/test/src
756  abcl.test.lisp
757    --  Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets
758  test.ansi.compiled
759    --  Run the compiled version of the ANSI test suite
760  test.abcl
761    --  Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl
762  test.cl-bench
763    --  Run the cl-bench test suite.
764
765The ANSI tests require that the [ansi-tests][1] be manually installed in
766${basedir}/../ansi-tests.
767
768[1]: svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests
769
770The CL-BENCH test require that [cl-bench][2] be maunally installed in
771${basedir}/../cl-bench
772
773[2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz
774      </echo>
775    </target>
776
777    <property name="abcl.test.classes.dir"
778        value="${build.dir}/classes-test"/>
779
780    <property name="abcl.test.src.dir"
781        value="${basedir}/test/src"/>
782
783    <patternset id="abcl.test.source.java">
784      <!-- For now, we list tests explicitly, because we have to
785           enumerate them later to the JUnit test runner. -->
786      <include name="org/armedbear/lisp/*.java"/>
787    </patternset>
788
789    <property name="junit.path"
790        value="${abcl.ext.dir}/junit-4.8.1.jar"/>
791
792
793    <path id="abcl.test.compile.classpath">
794      <pathelement location="${junit.path}"/>
795      <pathelement location="${build.classes.dir}"/>
796    </path>
797
798    <target name="abcl.test.pre-compile" depends="abcl.ext"/>
799
800    <target name="abcl.ext.p">
801      <!--XXX generalize over enumeration of all contributions to
802           abcl.ext if we get more of them.  -->
803      <available file="${junit.path}" property="abcl.ext.p"/>
804    </target>
805    <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
806
807      <mkdir dir="${abcl.ext.dir}"/>
808      <get 
809          src="http://cloud.github.com/downloads/KentBeck/junit/junit-4.8.1.jar"
810          usetimestamp="true"
811          dest="${junit.path}"/>
812    </target>
813 
814    <target name="abcl.test.compile" 
815      depends="abcl.test.pre-compile">
816      <mkdir dir="${abcl.test.classes.dir}"/>
817      <javac destdir="${abcl.test.classes.dir}"
818       classpathref="abcl.test.compile.classpath"
819       debug="true"
820       target="1.5">
821  <src path="${abcl.test.src.dir}"/>
822  <patternset refid="abcl.test.source.java"/>
823      </javac>
824    </target>
825
826    <path id="abcl.test.run.classpath">
827      <path refid="abcl.test.compile.classpath"/>
828      <pathelement location="${abcl.test.classes.dir}"/>
829    </path>
830
831    <target name="abcl.test" 
832      depends="abcl.test.java,abcl.test.lisp"/>
833 
834    <target name="abcl.test.java" depends="abcl.test.compile">
835      <java fork="true"
836      classpathref="abcl.test.run.classpath"
837      classname="org.junit.runner.JUnitCore">
838        <arg value="org.armedbear.lisp.PathnameTest"/>
839        <arg value="org.armedbear.lisp.StreamTest"/>
840        <arg value="org.armedbear.lisp.UtilitiesTest"/>
841      </java>
842    </target>
843
844    <target name="abcl.test.lisp" 
845      depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
846
847    <target name="test.ansi.interpreted" depends="abcl.jar">
848      <echo>Recording test output in ${abcl.test.log.file}.</echo>
849      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
850      <java fork="true" dir="${basedir}"
851      classpathref="abcl.classpath.dist"
852      classname="org.armedbear.lisp.Main">
853  <arg value="--noinit"/> 
854  <arg value="--eval"/><arg value="(require (quote asdf))"/>
855  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
856  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-interpreted)"/>
857        <arg value="--eval"/><arg value="(ext:exit)"/>
858      </java>
859      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
860      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
861    </target>
862
863    <target name="test.ansi.compiled" depends="abcl.jar">
864      <echo>Recording test output in ${abcl.test.log.file}.</echo>
865      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
866      <java fork="true" dir="${basedir}"
867      classpathref="abcl.classpath.dist"
868      classname="org.armedbear.lisp.Main">
869  <arg value="--noinit"/> 
870  <arg value="--eval"/><arg value="(require (quote asdf))"/>
871  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
872  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-compiled)"/>
873        <arg value="--eval"/><arg value="(ext:exit)"/>
874      </java>
875      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
876      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
877    </target>
878
879    <target name="test.abcl" depends="abcl.jar">
880      <echo>Recording test output in ${abcl.test.log.file}.</echo>
881      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
882      <java fork="true" dir="${basedir}"
883      classpathref="abcl.classpath.dist"
884      classname="org.armedbear.lisp.Main">
885  <arg value="--noinit"/> 
886  <arg value="--eval"/><arg value="(require (quote asdf))"/>
887  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
888  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :abcl-test-lisp)"/>
889        <arg value="--eval"/><arg value="(ext:exit)"/>
890      </java>
891      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
892      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
893    </target>
894
895    <target name="test.cl-bench" depends="abcl.jar">
896      <echo>Recording test output in ${abcl.test.log.file}.</echo>
897      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
898      <java fork="true" dir="${basedir}"
899      classpathref="abcl.classpath.dist"
900      classname="org.armedbear.lisp.Main">
901  <arg value="--noinit"/> 
902  <arg value="--eval"/><arg value="(require (quote asdf))"/>
903  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
904  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :cl-bench)"/>
905        <arg value="--eval"/><arg value="(ext:exit)"/>
906      </java>
907      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
908      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
909    </target>
910   
911    <target name="abcl.release" 
912            depends="abcl.binary.tar,abcl.source.tar,abcl.binary.zip,abcl.source.zip">
913      <copy file="${abcl.jar.path}"
914            tofile="${dist.dir}/abcl-${abcl.version}.jar"/>
915    </target>
916
917    <import file="netbeans-build.xml" optional="true"/> 
918<!--    <import file="j-build.xml" optional="true"/>  -->
919    <import file="not.org-build.xml" optional="true"/> 
920</project>
921
922
923
924
Note: See TracBrowser for help on using the repository browser.