source: branches/0.27.x/abcl/build.xml

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

Include the test source in the release.

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