source: trunk/abcl/build.xml @ 13198

Last change on this file since 13198 was 13198, checked in by ehuelsmann, 11 years ago

Update r13197 for Windows.

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