source: trunk/abcl/build.xml @ 13292

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

Untabify.

  • Property svn:eol-style set to LF
File size: 33.3 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.uptodate">
334      <uptodate property="abcl.stamp.version.uptodate.p" 
335                targetfile="${abcl.version.path}"
336                srcfile="${build.classes.dir}/org/armedbear/lisp/Version.class"/>
337    </target>
338
339    <target name="abcl.stamp.version" 
340            depends="abcl.version.src,abcl.stamp.version.1,abcl.stamp.version.2"
341            unless="abcl.stamp.version.uptodate.p">
342      <mkdir dir="${abcl.version.path}/.."/>
343      <echo>ABCL implementation version: ${abcl.implementation.version}</echo>
344      <echo file="${abcl.version.path}">${abcl.implementation.version}</echo>
345    </target>
346   
347    <target name="abcl.stamp.version.generate" 
348            depends="abcl.compile.java"
349            unless="abcl.stamp.version.uptodate.p">
350      <java fork="true"
351            classpath="${build.classes.dir}"
352            outputproperty="abcl.version"
353            classname="org.armedbear.lisp.Version"
354            logerror="yes"/> <!-- Don't catch stderr output -->
355    </target>
356
357    <target name="abcl.stamp.version.0" 
358            depends="abcl.stamp.version.uptodate,abcl.stamp.version.generate"/>
359
360    <target name="abcl.stamp.version.1"
361            depends="abcl.stamp.version.0"
362            unless="abcl.version.svn.p">
363      <property name="abcl.implementation.version"
364                value="${abcl.version}"/>
365    </target>
366
367    <target name="abcl.stamp.version.2" 
368            depends="abcl.stamp.version.0"
369            if="abcl.version.svn.p">
370      <property name="abcl.implementation.version"
371                value="${abcl.version}-${abcl.version.src}"/>
372    </target>
373
374    <target name="abcl.stamp.hostname" if="unix">
375      <exec executable="hostname" outputproperty="abcl.hostname"/>
376      <echo>abcl.hostname: ${abcl.hostname}</echo>
377    </target>
378
379    <target name="abcl.system.uptodate">
380      <condition property="abcl.system.needs-update.p">
381        <and>
382          <available file="${system.lisp.file}"/>
383          <available file="${abcl.startup.file}"/>
384          <uptodate
385                srcfile="${system.lisp.file}"
386                targetfile="${abcl.startup.file}"/>
387        </and>
388      </condition>
389    </target>
390   
391    <target name="abcl.system.update.maybe" depends="abcl.system.uptodate" 
392            if="abcl.system.needs-update.p">
393      <touch file="${src.dir}/org/armedbear/lisp/compile-system.lisp"/>
394    </target>
395
396    <target name="abcl.jar.uptodate" depends="abcl.compile,abcl.stamp">
397      <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}">
398        <srcfiles dir="${build.classes.dir}">
399          <patternset refid="abcl.objects"/>
400        </srcfiles>
401      </uptodate>
402    </target>
403
404    <target name="abcl.jar" depends="abcl.jar.uptodate"
405            unless="abcl.jar.uptodate.p">
406      <mkdir dir="${dist.dir}"/>
407      <loadfile property="abcl.version"
408                srcFile="${abcl.version.path}"/>
409      <jar destfile="${abcl.jar.path}"
410           compress="true"
411           basedir="${build.classes.dir}">
412        <patternset refid="abcl.objects"/>
413        <manifest>
414          <attribute name="Main-Class" value="org.armedbear.lisp.Main"/>
415          <section name="org/armedbear/lisp">
416            <attribute name="Implementation-Title" 
417                       value="ABCL"/>
418            <attribute name="Implementation-Version" 
419                       value="${abcl.implementation.version}"/>
420            <attribute name="Implementation-Build" 
421                       value="${build}"/>
422          </section>
423        </manifest>
424        <metainf dir="${src.dir}/META-INF"> 
425          <exclude name="services/javax.script.ScriptEngineFactory"
426                   unless="abcl.jsr-223.p"/>
427        </metainf>
428      </jar>
429    </target>
430   
431    <target name="abcl.wrapper" 
432            depends="abcl.jar,abcl.wrapper.unix,abcl.wrapper.windows">
433      <description>
434        Creates in-place exectuable shell wrapper in '${abcl.wrapper.file}'
435      </description>
436      <!-- Set from commandline or in 'build.properties' -->
437      <property name="additional.jars" value=""/>
438      <path id="abcl.runtime.classpath">
439        <pathelement location="${abcl.jar.path}"/>
440        <pathelement path="${additional.jars}"/>
441      </path>
442      <!-- set via '-Djava.options=JAVA_OPTIONS' or in 'build.properties -->
443      <property name="java.options" value=""/>
444
445      <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes">
446        <filterset>
447          <filter token="JAVA" 
448                  value="${java.path}"/>
449          <filter token="ABCL_JAVA_OPTIONS" 
450                  value="${java.options}"/>
451          <filter token="ABCL_CLASSPATH"
452                  value="${toString:abcl.runtime.classpath}"/>
453        </filterset>
454      </copy>
455      <chmod file="${abcl.wrapper.file}" perm="a+x"/>
456
457      <echo>Created executable ABCL wrapper in '${abcl.wrapper.file}'</echo>
458      <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo>
459    </target>
460
461    <target name="abcl.wrapper.unix" if="unix">
462      <property name="abcl.wrapper.file" value="abcl"/>
463      <property name="abcl.wrapper.in.file" value="abcl.in"/>
464    </target>
465
466    <target name="abcl.wrapper.windows" if="windows">
467      <property name="abcl.wrapper.file" value="abcl.bat"/>
468      <property name="abcl.wrapper.in.file" value="abcl.bat.in"/>
469    </target>
470
471    <!-- XXX Generalize when (if?) we get more contribs --> 
472    <target name="abcl.contrib.compile" depends="abcl.jar">
473      <java fork="true"
474            failonerror="true"
475            classpathref="abcl.classpath.dist"
476            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))))"
477            classname="org.armedbear.lisp.Main">
478        <arg value="--noinit"/>
479      </java>
480    </target>
481   
482    <target name="abcl.contrib" depends="abcl.contrib.compile">
483      <jar destfile="dist/abcl-contrib.jar"
484           compress="true"
485           basedir="contrib">
486        <patternset>
487          <include name="**/*.asd"/>
488          <include name="**/*.lisp"/>
489          <include name="**/*.abcl"/>
490        </patternset>
491      </jar>
492      <echo>
493Packaged contribs in ${dist.dir}/abcl-contrib.jar.
494
495To use ASDF-INSTALL, use the following in your ~/.abclrc:
496
497  (require 'asdf)
498  (pushnew "jar:file:${dist.dir}/abcl-contrib.jar!/asdf-install/" asdf:*central-registry*)
499
500Then issuing
501
502  CL-USER> (require 'asdf-install)
503
504will load ASDF-INSTALL.
505</echo>
506    </target>
507
508    <target name="abcl.debug.jpda" depends="abcl.jar">
509      <description>Invoke ABCL with JPDA listener on port 6789</description>
510      <java fork="true"
511            classpathref="abcl.classpath.dist"
512            classname="org.armedbear.lisp.Main">
513        <jvmarg 
514            value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
515      </java>
516      <echo>JPDA listening on localhost:6789</echo>
517    </target>
518
519    <target name="abcl.build.debug.jpda" depends="abcl.compile.java">
520      <description>Invoke ABCL with JPDA listener on port 6789</description>
521      <java fork="true"
522            classpathref="abcl.classpath.build"
523            classname="org.armedbear.lisp.Main">
524        <jvmarg
525            value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
526        <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/>
527      </java>
528      <echo>JPDA listening on localhost:6789</echo>
529    </target>
530
531    <target name="abcl.run" depends="abcl.jar">
532      <java fork="true"
533            classpathref="abcl.classpath.dist"
534            classname="org.armedbear.lisp.Main">
535      </java>
536    </target>
537
538    <target name="abcl.clean">
539      <delete dir="${build.dir}"/>
540      <delete file="${abcl.jar.path}"/>
541      <delete file="abcl"/>
542      <delete file="abcl.bat"/>
543    </target>
544
545    <target name="abcl.dist" depends="abcl.jar">
546      <copy file="${abcl.jar.path}"
547            toFile="${dist.dir}/abcl-${abcl.version}.jar"/>
548    </target>
549
550    <target name="abcl.distclean" depends="abcl.clean">
551      <delete dir="${dist.dir}"/>
552      <delete file="abcl"/>
553      <delete file="abcl.bat"/>
554    </target>
555
556    <target name="TAGS">
557      <delete file="TAGS"/>
558      <apply executable="etags" parallel="true" verbose="true" maxparallel="300">
559        <arg value="--append"/>
560        <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/>
561        <arg value='--regex=|[ \t]*@DocString([ \t]*name=\"\([^\"]*\)|\1|'/>
562        <fileset dir="${src.dir}">
563          <patternset refid="abcl.source.java"/>
564          <patternset refid="abcl.source.lisp"/>
565        </fileset>
566      </apply>
567    </target>
568
569    <patternset id="abcl.dist.misc"
570                description="Additional includes in the source distributions relative to basedir">
571      <include name="build.xml"/>
572      <include name="abcl.properties.in"/>
573      <include name="COPYING"/>
574      <include name="README"/>
575      <include name="CHANGES"/>
576      <include name="abcl.in"/>
577      <include name="abcl.bat.in"/>
578     
579      <include name="examples/**"/>
580
581      <include name="contrib/**"/>
582
583      <include name="build-from-lisp.sh"/>
584     
585      <!-- The remainder of these files are used by the Lisp hosted
586           build in 'build-abcl.lisp' but not used by Ant, so include
587           them in the source distribution. -->
588      <include name="make-jar.in"/>
589      <include name="make-jar.bat.in"/>
590
591
592
593      <include name="build-abcl.lisp"/>
594      <include name="customizations.lisp.in"/>
595
596    </patternset>
597
598    <patternset 
599        id="abcl.source.misc"
600        description="Additional includes in the source distribution relative to source root">
601      <include name="org/armedbear/lisp/LICENSE"/>
602      <include name="manifest-abcl"/>
603      <include name="META-INF/services/javax.script.ScriptEngineFactory"/>
604    </patternset>
605
606    <target name="abcl.source.prepare" depends="abcl.stamp.version">
607      <property name="abcl.build.src.dir"
608                value="${build.dir}/abcl-src-${abcl.version}"/>
609      <mkdir dir="${abcl.build.src.dir}/src"/>
610      <copy todir="${abcl.build.src.dir}/src"
611            preservelastmodified="true">
612        <fileset dir="${src.dir}"
613                 id="abcl.source.src">
614            <patternset refid="abcl.source.java"/>
615            <patternset refid="abcl.source.lisp"/>
616            <patternset refid="abcl.source.misc"/>
617        </fileset>
618      </copy>
619      <copy todir="${abcl.build.src.dir}"
620            preservelastmodified="true">
621        <fileset dir="${basedir}">
622            <patternset refid="abcl.dist.misc"/>
623        </fileset>
624      </copy>
625    </target>
626
627    <!--  Files in source distribution that always get LF EOL (aka
628         'unix') -->   
629    <patternset id="abcl.dist.lf">
630      <include name="abcl.in"/>
631    </patternset>
632
633    <!--  Files in source distribution that always get CRLF EOL (aka
634         'dos') -->   
635    <patternset id="abcl.dist.crlf">
636      <include name="abcl.bat.in"/>
637    </patternset>
638
639    <target name="abcl.source.unix" depends="abcl.source.prepare">
640      <fixcrlf srcdir="${abcl.build.src.dir}"
641               preservelastmodified="true"
642               eol="lf">
643      </fixcrlf>
644
645      <fixcrlf srcdir="${abcl.build.src.dir}"
646               preservelastmodified="true"
647               eol="crlf">
648          <patternset refid="abcl.dist.crlf"/>
649      </fixcrlf>
650
651      <fixcrlf srcdir="${abcl.build.src.dir}"
652               preservelastmodified="true"
653               eol="lf">
654          <patternset refid="abcl.dist.lf"/>
655      </fixcrlf>
656    </target>
657
658    <target name="abcl.source.tar" depends="abcl.source.unix">
659      <mkdir dir="${dist.dir}"/>
660      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
661           compression="gzip">
662        <tarfileset dir="${build.dir}">
663          <include name="abcl-src-${abcl.version}/**"/>
664        </tarfileset>
665      </tar>
666    </target>
667
668    <target name="abcl.source.windows" depends="abcl.source.prepare">
669      <fixcrlf srcdir="${abcl.build.src.dir}"
670               preservelastmodified="true"
671               eol="crlf">
672      </fixcrlf>
673
674      <fixcrlf srcdir="${abcl.build.src.dir}"
675               preservelastmodified="true"
676               eol="crlf">
677          <patternset refid="abcl.dist.crlf"/>
678      </fixcrlf>
679
680      <fixcrlf srcdir="${abcl.build.src.dir}"
681               preservelastmodified="true"
682               eol="lf">
683          <patternset refid="abcl.dist.lf"/>
684      </fixcrlf>
685    </target>
686
687    <target name="abcl.source.zip" depends="abcl.source.windows">
688      <mkdir dir="${dist.dir}"/>
689      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
690           compress="true">
691        <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
692      </zip>
693    </target>
694
695    <target name="abcl.source.jar" depends="abcl.source.unix">
696      <mkdir dir="${dist.dir}"/>
697      <jar destfile="${dist.dir}/abcl-${abcl.version}-sources.jar">
698        <metainf dir="${abcl.build.src.dir}">
699          <include name="COPYING"/>
700        </metainf>
701        <fileset dir="${abcl.build.src.dir}/src">
702          <include name="**/*.java"/>
703          <include name="**/*.lisp"/>
704        </fileset>
705      </jar>
706    </target>
707
708    <property name="abcl.javadoc.dir" value="${build.dir}/javadoc"/>
709
710    <target name="abcl.javadoc">
711      <mkdir dir="${abcl.javadoc.dir}"/>
712      <javadoc destdir="${abcl.javadoc.dir}"
713               sourcepath="${src.dir}"/>
714    </target>
715   
716    <target name="abcl.javadoc.jar" depends="abcl.stamp.version,abcl.javadoc">
717      <mkdir dir="${dist.dir}"/>
718      <jar destfile="${dist.dir}/abcl-${abcl.version}-javadoc.jar">
719        <fileset dir="${abcl.javadoc.dir}"/>
720      </jar>
721    </target>
722
723    <target name="abcl.binary.prepare" depends="abcl.jar,abcl.stamp.version">
724      <property name="abcl.build.binary.dir"
725                value="${build.dir}/abcl-bin-${abcl.version}"/>
726      <mkdir dir="${abcl.build.binary.dir}"/>
727      <copy todir="${abcl.build.binary.dir}"
728            preservelastmodified="true">
729        <fileset dir="${basedir}/dist">
730          <patternset>
731            <include name="abcl.jar"/>
732          </patternset>
733        </fileset>
734        <fileset dir="${basedir}">
735          <patternset>
736            <include name="README"/>
737            <include name="CHANGES"/>
738          </patternset>
739        </fileset>
740      </copy>
741    </target>
742
743    <target name="abcl.binary.tar" depends="abcl.binary.prepare">
744      <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz"
745           compression="gzip">
746        <tarfileset dir="${build.dir}">
747          <include name="abcl-bin-${abcl.version}/**"/>
748          </tarfileset>
749      </tar>
750    </target>
751
752    <target name="abcl.binary.zip" depends="abcl.binary.prepare">
753      <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip"
754           compress="true">
755        <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/>
756      </zip>
757    </target>
758
759    <target name="help.test">
760      <echo>
761The following Ant targets run various test suites:
762 
763  abcl.test
764    --  Run all available tests.
765  abcl.test.java
766    --  Run the ABCL junit Java tests under ${basedir}/test/src
767  abcl.test.lisp
768    --  Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets
769  test.ansi.compiled
770    --  Run the compiled version of the ANSI test suite
771  test.abcl
772    --  Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl
773  test.cl-bench
774    --  Run the cl-bench test suite.
775
776The ANSI tests require that the [ansi-tests][1] be manually installed in
777${basedir}/../ansi-tests.
778
779[1]: svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests
780
781The CL-BENCH test require that [cl-bench][2] be maunally installed in
782${basedir}/../cl-bench
783
784[2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz
785      </echo>
786    </target>
787
788    <property name="abcl.test.classes.dir"
789              value="${build.dir}/classes-test"/>
790
791    <property name="abcl.test.src.dir"
792              value="${basedir}/test/src"/>
793
794    <patternset id="abcl.test.source.java">
795      <!-- For now, we list tests explicitly, because we have to
796           enumerate them later to the JUnit test runner. -->
797      <include name="org/armedbear/lisp/*.java"/>
798    </patternset>
799
800    <property name="junit.path"
801              value="${abcl.ext.dir}/junit-4.8.1.jar"/>
802
803
804    <path id="abcl.test.compile.classpath">
805      <pathelement location="${junit.path}"/>
806      <pathelement location="${build.classes.dir}"/>
807    </path>
808
809    <target name="abcl.test.pre-compile" depends="abcl.ext"/>
810
811    <target name="abcl.ext.p">
812      <!--XXX generalize over enumeration of all contributions to
813           abcl.ext if we get more of them.  -->
814      <available file="${junit.path}" property="abcl.ext.p"/>
815    </target>
816    <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
817
818      <mkdir dir="${abcl.ext.dir}"/>
819      <get 
820          src="http://cloud.github.com/downloads/KentBeck/junit/junit-4.8.1.jar"
821          usetimestamp="true"
822          dest="${junit.path}"/>
823    </target>
824       
825    <target name="abcl.test.compile" 
826            depends="abcl.test.pre-compile">
827      <mkdir dir="${abcl.test.classes.dir}"/>
828      <javac destdir="${abcl.test.classes.dir}"
829             classpathref="abcl.test.compile.classpath"
830             debug="true"
831             target="1.5">
832        <src path="${abcl.test.src.dir}"/>
833        <patternset refid="abcl.test.source.java"/>
834      </javac>
835    </target>
836
837    <path id="abcl.test.run.classpath">
838      <path refid="abcl.test.compile.classpath"/>
839      <pathelement location="${abcl.test.classes.dir}"/>
840    </path>
841
842    <target name="abcl.test" 
843            depends="abcl.test.java,abcl.test.lisp"/>
844       
845    <target name="abcl.test.java" depends="abcl.test.compile">
846      <java fork="true"
847            classpathref="abcl.test.run.classpath"
848            classname="org.junit.runner.JUnitCore">
849        <arg value="org.armedbear.lisp.PathnameTest"/>
850        <arg value="org.armedbear.lisp.StreamTest"/>
851        <arg value="org.armedbear.lisp.UtilitiesTest"/>
852      </java>
853    </target>
854
855    <target name="abcl.test.lisp" 
856            depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
857
858    <target name="test.ansi.interpreted" depends="abcl.jar">
859      <echo>Recording test output in ${abcl.test.log.file}.</echo>
860      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
861      <java fork="true" dir="${basedir}"
862            classpathref="abcl.classpath.dist"
863            classname="org.armedbear.lisp.Main">
864        <arg value="--noinit"/> 
865        <arg value="--eval"/><arg value="(require (quote asdf))"/>
866        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
867        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-interpreted)"/>
868        <arg value="--eval"/><arg value="(ext:exit)"/>
869      </java>
870      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
871      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
872    </target>
873
874    <target name="test.ansi.compiled" depends="abcl.jar">
875      <echo>Recording test output in ${abcl.test.log.file}.</echo>
876      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
877      <java fork="true" dir="${basedir}"
878            classpathref="abcl.classpath.dist"
879            classname="org.armedbear.lisp.Main">
880        <arg value="--noinit"/> 
881        <arg value="--eval"/><arg value="(require (quote asdf))"/>
882        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
883        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-compiled)"/>
884        <arg value="--eval"/><arg value="(ext:exit)"/>
885      </java>
886      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
887      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
888    </target>
889
890    <target name="test.abcl" depends="abcl.jar">
891      <echo>Recording test output in ${abcl.test.log.file}.</echo>
892      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
893      <java fork="true" dir="${basedir}"
894            classpathref="abcl.classpath.dist"
895            classname="org.armedbear.lisp.Main">
896        <arg value="--noinit"/> 
897        <arg value="--eval"/><arg value="(require (quote asdf))"/>
898        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
899        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :abcl-test-lisp)"/>
900        <arg value="--eval"/><arg value="(ext:exit)"/>
901      </java>
902      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
903      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
904    </target>
905
906    <target name="test.cl-bench" depends="abcl.jar">
907      <echo>Recording test output in ${abcl.test.log.file}.</echo>
908      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
909      <java fork="true" dir="${basedir}"
910            classpathref="abcl.classpath.dist"
911            classname="org.armedbear.lisp.Main">
912        <arg value="--noinit"/> 
913        <arg value="--eval"/><arg value="(require (quote asdf))"/>
914        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
915        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :cl-bench)"/>
916        <arg value="--eval"/><arg value="(ext:exit)"/>
917      </java>
918      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
919      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
920    </target>
921   
922    <target name="abcl.release" 
923            depends="abcl.binary.tar,abcl.source.tar,abcl.binary.zip,abcl.source.zip">
924      <copy file="${abcl.jar.path}"
925            tofile="${dist.dir}/abcl-${abcl.version}.jar"/>
926    </target>
927
928    <import file="netbeans-build.xml" optional="true"/> 
929<!--    <import file="j-build.xml" optional="true"/>  -->
930    <import file="not.org-build.xml" optional="true"/> 
931</project>
932
933
934
935
Note: See TracBrowser for help on using the repository browser.