source: trunk/abcl/build.xml @ 13197

Last change on this file since 13197 was 13197, checked in by Mark Evenson, 11 years ago

Incorporate output of 'svnversion' into LISP-IMPLEMENTATION-VERSION.

In the Ant-based build, if the executable 'svnversion' can be found on
the PATH and the topmost '.svn' subdirectory exists, the output of
'svnversion' is appended to the value returned by
LISP-IMPLEMENTATION-VERSION.

The use of 'version.src' in 'abcl.properties' has been removed.

TODO: the same functionality should be added to the Lisp-based build.

TODO: test that this works on Windows.

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