source: tags/0.26.1/abcl/build.xml

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

Backport r13390: Include org.armedbear.lisp.protocol source in release.

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