source: trunk/abcl/build.xml @ 13211

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

'abcl.source.jar' now produces a source archive intended for Maven.

Refactored UNIX/Windows EOL fixes into separate target. The
'abcl.source.jar' target currently uses UNIX EOL conventions.

  • Property svn:eol-style set to LF
File size: 31.2 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.unix" 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    </target>
646
647    <target name="abcl.source.tar" depends="abcl.source.unix">
648      <mkdir dir="${dist.dir}"/>
649      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
650     compression="gzip">
651  <tarfileset dir="${build.dir}">
652    <include name="abcl-src-${abcl.version}/**"/>
653  </tarfileset>
654      </tar>
655    </target>
656
657    <target name="abcl.source.windows" depends="abcl.source.prepare">
658      <fixcrlf srcdir="${abcl.build.src.dir}"
659               preservelastmodified="true"
660               eol="crlf">
661      </fixcrlf>
662
663      <fixcrlf srcdir="${abcl.build.src.dir}"
664               preservelastmodified="true"
665               eol="crlf">
666          <patternset refid="abcl.dist.crlf"/>
667      </fixcrlf>
668
669      <fixcrlf srcdir="${abcl.build.src.dir}"
670               preservelastmodified="true"
671               eol="lf">
672          <patternset refid="abcl.dist.lf"/>
673      </fixcrlf>
674    </target>
675
676    <target name="abcl.source.zip" depends="abcl.source.windows">
677      <mkdir dir="${dist.dir}"/>
678      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
679     compress="true">
680  <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
681      </zip>
682    </target>
683
684    <target name="abcl.source.jar" depends="abcl.source.unix">
685      <mkdir dir="${dist.dir}"/>
686      <jar destfile="${dist.dir}/abcl-${abcl.version}-sources.jar">
687        <metainf dir="${abcl.build.src.dir}">
688          <include name="COPYING"/>
689        </metainf>
690        <fileset dir="${abcl.build.src.dir}/src">
691          <include name="**/*.java"/>
692          <include name="**/*.lisp"/>
693        </fileset>
694      </jar>
695    </target>
696
697    <target name="abcl.binary.prepare" depends="abcl.jar,abcl.stamp.version">
698      <property name="abcl.build.binary.dir"
699                value="${build.dir}/abcl-bin-${abcl.version}"/>
700      <mkdir dir="${abcl.build.binary.dir}"/>
701      <copy todir="${abcl.build.binary.dir}"
702            preservelastmodified="true">
703        <fileset dir="${basedir}/dist">
704          <patternset>
705            <include name="abcl.jar"/>
706          </patternset>
707        </fileset>
708        <fileset dir="${basedir}">
709          <patternset>
710            <include name="README"/>
711            <include name="CHANGES"/>
712          </patternset>
713        </fileset>
714      </copy>
715    </target>
716
717    <target name="abcl.binary.tar" depends="abcl.binary.prepare">
718      <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz"
719           compression="gzip">
720        <tarfileset dir="${build.dir}">
721          <include name="abcl-bin-${abcl.version}/**"/>
722          </tarfileset>
723      </tar>
724    </target>
725
726    <target name="abcl.binary.zip" depends="abcl.binary.prepare">
727      <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip"
728           compress="true">
729        <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/>
730      </zip>
731    </target>
732
733    <target name="help.test">
734      <echo>
735The following Ant targets run various test suites:
736 
737  abcl.test
738    --  Run all available tests.
739  abcl.test.java
740    --  Run the ABCL junit Java tests under ${basedir}/test/src
741  abcl.test.lisp
742    --  Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets
743  test.ansi.compiled
744    --  Run the compiled version of the ANSI test suite
745  test.abcl
746    --  Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl
747  test.cl-bench
748    --  Run the cl-bench test suite.
749
750The ANSI tests require that the [ansi-tests][1] be manually installed in
751${basedir}/../ansi-tests.
752
753[1]: svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests
754
755The CL-BENCH test require that [cl-bench][2] be maunally installed in
756${basedir}/../cl-bench
757
758[2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz
759      </echo>
760    </target>
761
762    <property name="abcl.test.classes.dir"
763        value="${build.dir}/classes-test"/>
764
765    <property name="abcl.test.src.dir"
766        value="${basedir}/test/src"/>
767
768    <patternset id="abcl.test.source.java">
769      <!-- For now, we list tests explicitly, because we have to
770           enumerate them later to the JUnit test runner. -->
771      <include name="org/armedbear/lisp/*.java"/>
772    </patternset>
773
774    <property name="junit.path"
775        value="${abcl.ext.dir}/junit-4.8.1.jar"/>
776
777
778    <path id="abcl.test.compile.classpath">
779      <pathelement location="${junit.path}"/>
780      <pathelement location="${build.classes.dir}"/>
781    </path>
782
783    <target name="abcl.test.pre-compile" depends="abcl.ext"/>
784
785    <target name="abcl.ext.p">
786      <!--XXX generalize over enumeration of all contributions to
787           abcl.ext if we get more of them.  -->
788      <available file="${junit.path}" property="abcl.ext.p"/>
789    </target>
790    <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
791
792      <mkdir dir="${abcl.ext.dir}"/>
793      <get 
794          src="http://cloud.github.com/downloads/KentBeck/junit/junit-4.8.1.jar"
795          usetimestamp="true"
796          dest="${junit.path}"/>
797    </target>
798 
799    <target name="abcl.test.compile" 
800      depends="abcl.test.pre-compile">
801      <mkdir dir="${abcl.test.classes.dir}"/>
802      <javac destdir="${abcl.test.classes.dir}"
803       classpathref="abcl.test.compile.classpath"
804       debug="true"
805       target="1.5">
806  <src path="${abcl.test.src.dir}"/>
807  <patternset refid="abcl.test.source.java"/>
808      </javac>
809    </target>
810
811    <path id="abcl.test.run.classpath">
812      <path refid="abcl.test.compile.classpath"/>
813      <pathelement location="${abcl.test.classes.dir}"/>
814    </path>
815
816    <target name="abcl.test" 
817      depends="abcl.test.java,abcl.test.lisp"/>
818 
819    <target name="abcl.test.java" depends="abcl.test.compile">
820      <java fork="true"
821      classpathref="abcl.test.run.classpath"
822      classname="org.junit.runner.JUnitCore">
823        <arg value="org.armedbear.lisp.PathnameTest"/>
824        <arg value="org.armedbear.lisp.StreamTest"/>
825        <arg value="org.armedbear.lisp.UtilitiesTest"/>
826      </java>
827    </target>
828
829    <target name="abcl.test.lisp" 
830      depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
831
832    <target name="test.ansi.interpreted" depends="abcl.jar">
833      <echo>Recording test output in ${abcl.test.log.file}.</echo>
834      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
835      <java fork="true" dir="${basedir}"
836      classpathref="abcl.classpath.dist"
837      classname="org.armedbear.lisp.Main">
838  <arg value="--noinit"/> 
839  <arg value="--eval"/><arg value="(require (quote asdf))"/>
840  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
841  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-interpreted)"/>
842        <arg value="--eval"/><arg value="(ext:exit)"/>
843      </java>
844      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
845      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
846    </target>
847
848    <target name="test.ansi.compiled" depends="abcl.jar">
849      <echo>Recording test output in ${abcl.test.log.file}.</echo>
850      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
851      <java fork="true" dir="${basedir}"
852      classpathref="abcl.classpath.dist"
853      classname="org.armedbear.lisp.Main">
854  <arg value="--noinit"/> 
855  <arg value="--eval"/><arg value="(require (quote asdf))"/>
856  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
857  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-compiled)"/>
858        <arg value="--eval"/><arg value="(ext:exit)"/>
859      </java>
860      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
861      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
862    </target>
863
864    <target name="test.abcl" depends="abcl.jar">
865      <echo>Recording test output in ${abcl.test.log.file}.</echo>
866      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
867      <java fork="true" dir="${basedir}"
868      classpathref="abcl.classpath.dist"
869      classname="org.armedbear.lisp.Main">
870  <arg value="--noinit"/> 
871  <arg value="--eval"/><arg value="(require (quote asdf))"/>
872  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
873  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :abcl-test-lisp)"/>
874        <arg value="--eval"/><arg value="(ext:exit)"/>
875      </java>
876      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
877      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
878    </target>
879
880    <target name="test.cl-bench" depends="abcl.jar">
881      <echo>Recording test output in ${abcl.test.log.file}.</echo>
882      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
883      <java fork="true" dir="${basedir}"
884      classpathref="abcl.classpath.dist"
885      classname="org.armedbear.lisp.Main">
886  <arg value="--noinit"/> 
887  <arg value="--eval"/><arg value="(require (quote asdf))"/>
888  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
889  <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :cl-bench)"/>
890        <arg value="--eval"/><arg value="(ext:exit)"/>
891      </java>
892      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
893      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
894    </target>
895   
896    <target name="abcl.release" 
897            depends="abcl.binary.tar,abcl.source.tar,abcl.binary.zip,abcl.source.zip">
898      <copy file="${abcl.jar.path}"
899            tofile="${dist.dir}/abcl-${abcl.version}.jar"/>
900    </target>
901
902    <import file="netbeans-build.xml" optional="true"/> 
903<!--    <import file="j-build.xml" optional="true"/>  -->
904    <import file="not.org-build.xml" optional="true"/> 
905</project>
906
907
908
909
Note: See TracBrowser for help on using the repository browser.