source: trunk/abcl/build.xml @ 13199

Last change on this file since 13199 was 13199, checked in by Mark Evenson, 12 years ago

Fix ad infinitum appending of 'svnversion' results in incremental builds.

The 'version' file is now removed during each invocation of
'abcl.stamp.version' which adds a bit of time to each build, but at
least implement the correct semantics (i.e. always produce an accurate
svnversion result). An optimization might be to conditionally compare
the contents of 'version' with the results of running a fresh
'svnversion', but to do this with Ant's tiny little insect brain
requires more effort than this mammal deems wise to exert.

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