source: trunk/abcl/build.xml @ 13756

Last change on this file since 13756 was 13756, checked in by astalla, 12 years ago

Update POMs and readme for 1.0.1 release to Sonatype

  • Property svn:eol-style set to LF
File size: 34.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/protocol/*.java"/>
62      <include name="org/armedbear/lisp/java/**/*.java"/>
63      <include name="org/armedbear/lisp/scripting/*.java" if="abcl.jsr-223.p"/>
64      <include name="org/armedbear/lisp/scripting/util/*.java" if="abcl.jsr-223.p"/>
65      <include name="org/armedbear/Main.java"/>
66    </patternset>
67
68    <patternset id="abcl.source.lisp">
69      <include name="org/armedbear/lisp/*.lisp"/>
70      <include name="org/armedbear/lisp/java/**/*.lisp"/>
71      <include name="org/armedbear/lisp/tests/*.lisp"/>
72      <exclude name="org/armedbear/lisp/j.lisp"/>
73      <include name="org/armedbear/lisp/scripting/lisp/*.lisp" if="abcl.jsr-223.p"/>
74    </patternset>
75
76    <!-- Lisp files required at runtime -->
77    <patternset id="abcl.source.lisp.dist">
78      <include name="org/armedbear/lisp/boot.lisp"/>
79      <include name="org/armedbear/lisp/scripting/lisp/*.lisp" if="abcl.jsr-223.p"/>
80      <include name="**/*.lisp" if="abcl.compile.lisp.skip"/>
81    </patternset>
82
83    <patternset id="abcl.objects">
84      <!-- "system.lisp" is dynamically created by COMPILE-SYSTEM -->
85      <include name="org/armedbear/lisp/system.lisp"/> 
86      <include name="org/armedbear/lisp/**/*.class"/>
87      <include name="org/armedbear/lisp/**/*.cls"/> 
88      <include name="org/armedbear/lisp/**/*.abcl"/>
89      <include name="org/armedbear/lisp/version"/>
90      <include name="org/armedbear/lisp/scripting/*.class" if="abcl.jsr-223.p"/>
91      <include name="org/armedbear/lisp/scripting/util/*.class" if="abcl.jsr-223.p"/>
92      <patternset refid="abcl.source.lisp.dist"/>
93    </patternset>
94   
95    <path id="abcl.classpath.dist">
96      <pathelement location="${abcl.jar.path}"/>
97    </path>
98   
99    <path id="abcl.classpath.build">
100      <pathelement location="${build.classes.dir}"/>
101    </path>
102
103    <target name="abcl.compile" depends="abcl.clean.maybe,abcl.compile.lisp">
104      <echo>Compiled ABCL with Java version: ${java.version}</echo>
105    </target>
106
107    <target name="abcl.clean.maybe" unless="abcl.build.incremental">
108      <echo>Cleaning all intermediate compilation artifacts.</echo>
109      <echo>Setting 'abcl.build.incremental' enables incremental compilation.</echo>
110      <antcall target="abcl.clean"/>
111    </target>
112     
113
114    <target name="abcl.init">
115      <tstamp>
116        <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/>
117      </tstamp>
118
119      <tstamp>
120        <format property="build.stamp" pattern="yyyymmdd-HHmm"/>
121      </tstamp>
122
123      <property name="abcl.test.log.file"
124                value="abcl-test-${build.stamp}.log"/>
125
126      <property name="java.path"
127                value="${java.home}/bin/java"/>
128
129      <!-- Deprecated. Two main types of build environents: 'unix' or 'windows'. -->
130      <condition property="unix"> 
131        <or>
132          <os family="unix"/>
133          <os family="mac"/>
134        </or>
135      </condition>
136      <condition property="windows"> 
137        <os family="windows"/>
138      </condition>
139
140      <!-- Deprecated. -->
141      <available file="${src.dir}org/armedbear/lisp/Interpreter.java" 
142                 property="abcl.lisp.p"/>
143
144      <echo>java.version: ${java.version}</echo>
145      <condition property="abcl.java.version.p">
146        <or>
147          <matches string="${java.version}" pattern="1\.5"/>
148          <!-- Don't use 1.6.0_09 or earlier. -->
149          <matches string="${java.version}" pattern="1\.6\.0_[12][0-9]"/>
150          <!-- 1.7.0_01 seems to rock. -->
151          <matches string="${java.version}" pattern="1\.7\.0_[0-9]"/>
152        </or> 
153      </condition>
154
155    </target>
156   
157    <target name="abcl.java.warning" 
158            depends="abcl.init"
159            unless="abcl.java.version.p">
160      <echo>WARNING: Use of Java version ${java.version} not recommended.</echo>
161    </target>
162       
163    <target name="abcl.jsr-223.notice"
164            depends="abcl.init"
165            unless="abcl.jsr-223.p">
166      <echo>
167        Notice: JSR-223 support won't be built since it is not
168                supported, neither natively by your JVM nor by
169                libraries in the CLASSPATH.
170      </echo>
171    </target>
172
173    <target name="abcl.compile.java" 
174            depends="abcl.init,abcl.java.warning,abcl.jsr-223.notice">
175      <mkdir dir="${build.dir}"/>
176      <mkdir dir="${build.classes.dir}"/>
177      <javac destdir="${build.classes.dir}"
178             debug="true"
179             target="1.5"
180             source="1.5"
181             includeantruntime="false"
182             failonerror="true">
183        <src path="${src.dir}"/>
184        <patternset refid="abcl.source.java"/>
185      </javac>
186      <echo message="${build}" 
187            file="${build.classes.dir}/org/armedbear/lisp/build"/>
188    </target>
189
190    <target name="abcl.copy.lisp">
191      <copy todir="${build.classes.dir}" preservelastmodified="yes">
192        <fileset dir="${src.dir}">
193          <patternset refid="abcl.source.lisp.dist"/>
194        </fileset>
195      </copy>
196    </target>
197
198    <!-- Adjust the patternset for ABCL source to use the much faster
199         Ant 'uptodate' task to check if we need to compile the system
200         fasls.  Highly inter-dependent with the behavior specified in
201         'compile-system.lisp', i.e. files not listed in
202         there should NOT occur here. -->
203    <patternset id="abcl.source.lisp.fasls">
204      <patternset refid="abcl.source.lisp"/>
205      <exclude name="org/armedbear/lisp/scripting/**/*.lisp"/>
206      <exclude name="org/armedbear/lisp/boot.lisp"/>
207      <exclude name="org/armedbear/lisp/emacs.lisp"/>
208      <exclude name="org/armedbear/lisp/runtime-class.lisp"/>
209      <exclude name="org/armedbear/lisp/run-benchmarks.lisp"/>
210    </patternset>
211
212    <target name="abcl.fasls.uptodate">
213      <uptodate property="abcl.fasls.uptodate.p" value="true">
214        <srcfiles dir="${src.dir}">
215          <patternset refid="abcl.source.lisp.fasls"/>
216        </srcfiles>
217        <mapper type="glob" from="*.lisp" to="${build.classes.dir}/*.abcl"/>
218      </uptodate>
219    </target>
220
221    <path id="abcl.home.dir.path">
222        <path location="${src.dir}/org/armedbear/lisp/"/>
223    </path>         
224    <pathconvert property="abcl.home.dir" refid="abcl.home.dir.path"/>
225
226    <path id="abcl.lisp.output.path"
227          location="${build.classes.dir}/org/armedbear/lisp/"/>
228    <pathconvert dirsep="/" property="abcl.lisp.output" refid="abcl.lisp.output.path"/>
229
230    <property name="system.lisp.file" 
231              value="${build.classes.dir}/org/armedbear/lisp/system.lisp"/>
232   
233    <target name="abcl.compile.lisp" 
234            depends="abcl.copy.lisp,abcl.compile.java,abcl.system.update.maybe,abcl.fasls.uptodate"
235            unless="abcl.fasls.uptodate.p">
236      <echo>
237Compiling Lisp system
238from ${abcl.home.dir}
239 to  ${abcl.lisp.output}</echo>
240 
241     <!-- Not good if ${abcl.home.dir} == ${abcl.lisp.output} -->
242     <delete>
243       <fileset dir="${abcl.home.dir}" includes="**/*.abcl **/*.cls **/*._"/>
244     </delete>
245     <java classpath="${build.classes.dir}" 
246            fork="true"
247            failonerror="true"
248            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))))"
249            classname="org.armedbear.lisp.Main">
250        <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/>
251        <arg value="--noinit"/>
252        <arg value="--nosystem"/>
253        <arg value="--eval"/>
254        <arg value="(setf *load-verbose* t)"/>
255      </java>
256      <concat destfile="${system.lisp.file}" append="true">
257        <fileset file="${abcl.startup.file}"/>
258      </concat>
259    </target>
260
261    <property name="abcl.build.path"
262              value="${build.classes.dir}/org/armedbear/lisp/build"/>
263    <target name="abcl.stamp" 
264            depends="abcl.compile,abcl.stamp.version,abcl.stamp.hostname">
265      <mkdir dir="${abcl.build.path}/.."/>
266      <loadfile property="abcl.version"
267                srcFile="${abcl.version.path}"/>
268      <echo message="${build}" file="${abcl.build.path}"/>   
269    </target>
270
271
272    <!-- Environment variables may be accessed as ${env.NAME} -->
273    <property environment="env"/>
274
275    <!-- Can we derive an SVN version from the current build tree? -->
276    <condition property="abcl.version.svn.p">
277      <and>
278        <available
279            file="${basedir}/.svn"
280            type="dir"/>
281        <or>
282            <available
283                file="svnversion.exe"
284                filepath="${env.Path}"/>
285            <available
286                file="svnversion.exe"
287                filepath="${env.PATH}"/>
288             <available
289                file="svnversion"
290                filepath="${env.Path}"/>
291            <available
292                file="svnversion"
293                filepath="${env.PATH}"/>
294        </or>
295      </and>
296    </condition>
297
298    <target name="abcl.version.src" depends="abcl.version.src.3"/>
299
300    <target name="abcl.version.src.0" if="windows">
301      <exec
302          executable="svnversion.exe"
303          outputproperty="abcl.version.svn.raw"
304          failifexecutionfails="false"
305          searchpath="true" />
306    </target>
307
308    <target name="abcl.version.src.1" depends="abcl.version.src.0">
309      <exec 
310          executable="svnversion"
311          outputproperty="abcl.version.svn.raw"
312          failifexecutionfails="false"
313          searchpath="true" />
314    </target>
315
316    <target name="abcl.version.src.2" 
317            depends="abcl.version.src.1"
318            if="abcl.version.svn.p">
319
320      <!-- Transform all occurances of ":" ==> "-" in the version string -->
321      <tempfile property="version-tmp.path"/>
322      <echo message="${abcl.version.svn.raw}"
323            file="${version-tmp.path}"/>
324      <replace file="${version-tmp.path}"
325               token=":" value="-"/>
326      <loadfile property="abcl.version.svn" srcFile="${version-tmp.path}"/>
327      <delete file="${version-tmp.path}"/>
328
329      <echo>abcl.version.svn: ${abcl.version.svn}</echo>
330      <property name="abcl.version.src"
331                value="svn-${abcl.version.svn}"/>
332    </target>
333
334    <target name="abcl.version.src.3"
335            depends="abcl.version.src.2"
336            unless="abcl.version.svn.p">
337      <property name="abcl.version.src"
338                value=""/>
339    </target>
340
341    <property name="abcl.home.dir"
342              value="${src.dir}/org/armedbear/lisp/"/>
343    <property name="abcl.version.path"
344              value="${build.classes.dir}/org/armedbear/lisp/version"/>
345
346    <target name="abcl.clean.version">
347      <delete file="${abcl.version.path}"/>
348    </target>
349
350    <target name="abcl.stamp.version.uptodate">
351      <uptodate property="abcl.stamp.version.uptodate.p" 
352                targetfile="${abcl.version.path}"
353                srcfile="${build.classes.dir}/org/armedbear/lisp/Version.class"/>
354    </target>
355
356    <target name="abcl.stamp.version" 
357            depends="abcl.version.src,abcl.stamp.version.1,abcl.stamp.version.2"
358            unless="abcl.stamp.version.uptodate.p">
359      <mkdir dir="${abcl.version.path}/.."/>
360      <echo>ABCL implementation version: ${abcl.implementation.version}</echo>
361      <echo file="${abcl.version.path}">${abcl.implementation.version}</echo>
362    </target>
363   
364    <target name="abcl.stamp.version.generate" 
365            depends="abcl.compile.java"
366            unless="abcl.stamp.version.uptodate.p">
367      <java fork="true"
368            classpath="${build.classes.dir}"
369            outputproperty="abcl.version"
370            classname="org.armedbear.lisp.Version"
371            logerror="yes"/> <!-- Don't catch stderr output -->
372    </target>
373
374    <target name="abcl.stamp.version.0" 
375            depends="abcl.stamp.version.uptodate,abcl.stamp.version.generate">
376    </target>
377
378    <target name="abcl.stamp.version.1"
379            depends="abcl.stamp.version.0"
380            unless="abcl.version.svn.p">
381      <property name="abcl.implementation.version"
382                value="${abcl.version}"/>
383    </target>
384
385    <target name="abcl.stamp.version.2" 
386            depends="abcl.stamp.version.0"
387            if="abcl.version.svn.p">
388      <property name="abcl.implementation.version"
389                value="${abcl.version}-${abcl.version.src}"/>
390    </target>
391
392    <target name="abcl.stamp.hostname" if="unix">
393      <exec executable="hostname" outputproperty="abcl.hostname"/>
394      <echo>abcl.hostname: ${abcl.hostname}</echo>
395    </target>
396
397    <target name="abcl.system.uptodate">
398      <condition property="abcl.system.needs-update.p">
399        <and>
400          <available file="${system.lisp.file}"/>
401          <available file="${abcl.startup.file}"/>
402          <uptodate
403                srcfile="${system.lisp.file}"
404                targetfile="${abcl.startup.file}"/>
405        </and>
406      </condition>
407    </target>
408   
409    <target name="abcl.system.update.maybe" depends="abcl.system.uptodate" 
410            if="abcl.system.needs-update.p">
411      <touch file="${src.dir}/org/armedbear/lisp/compile-system.lisp"/>
412    </target>
413
414    <target name="abcl.jar.uptodate" depends="abcl.compile,abcl.stamp">
415      <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}">
416        <srcfiles dir="${build.classes.dir}">
417          <patternset refid="abcl.objects"/>
418        </srcfiles>
419      </uptodate>
420    </target>
421
422    <target name="abcl.jar" depends="abcl.jar.uptodate"
423            unless="abcl.jar.uptodate.p">
424      <mkdir dir="${dist.dir}"/>
425      <jar destfile="${abcl.jar.path}"
426           compress="true"
427           update="true"
428           basedir="${build.classes.dir}">
429        <patternset refid="abcl.objects"/>
430        <manifest>
431          <attribute name="Main-Class" value="org.armedbear.lisp.Main"/>
432          <section name="org/armedbear/lisp">
433            <attribute name="Implementation-Title" 
434                       value="ABCL"/>
435            <attribute name="Implementation-Version" 
436                       value="${abcl.implementation.version}"/>
437            <attribute name="Implementation-Build" 
438                       value="${build}"/>
439          </section>
440        </manifest>
441        <metainf dir="${src.dir}/META-INF"> 
442          <exclude name="services/javax.script.ScriptEngineFactory"
443                   unless="abcl.jsr-223.p"/>
444        </metainf>
445      </jar>
446    </target>
447   
448    <target name="abcl.wrapper" 
449            depends="abcl.jar,abcl.contrib,abcl.wrapper.unix,abcl.wrapper.windows">
450      <description>
451        Creates in-place executable shell wrapper in '${abcl.wrapper.file}'
452      </description>
453      <!-- Set from commandline or in 'build.properties' -->
454      <property name="additional.jars" value=""/>
455      <path id="abcl.runtime.classpath">
456        <pathelement location="${abcl.jar.path}"/>
457        <pathelement path="${additional.jars}"/>
458      </path>
459      <!-- set via '-Djava.options=JAVA_OPTIONS' or in 'build.properties -->
460      <property name="java.options" value=""/>
461
462      <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes">
463        <filterset>
464          <filter token="JAVA" 
465                  value="${java.path}"/>
466          <filter token="ABCL_JAVA_OPTIONS" 
467                  value="${java.options}"/>
468          <filter token="ABCL_CLASSPATH"
469                  value="${toString:abcl.runtime.classpath}"/>
470        </filterset>
471      </copy>
472      <chmod file="${abcl.wrapper.file}" perm="a+x"/>
473
474      <echo>Created executable ABCL wrapper in '${abcl.wrapper.file}'</echo>
475      <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo>
476    </target>
477
478    <target name="abcl.wrapper.unix" if="unix">
479      <property name="abcl.wrapper.file" value="abcl"/>
480      <property name="abcl.wrapper.in.file" value="abcl.in"/>
481    </target>
482
483    <target name="abcl.wrapper.windows" if="windows">
484      <property name="abcl.wrapper.file" value="abcl.bat"/>
485      <property name="abcl.wrapper.in.file" value="abcl.bat.in"/>
486    </target>
487
488    <patternset id="abcl.contrib.source">
489          <include name="**/*.asd"/>
490          <include name="**/*.lisp"/>
491          <include name="**/README.markdown"/>
492    </patternset>
493
494    <patternset id="abcl.contrib.docs">
495          <include name="**/README.markdown"/>
496    </patternset>
497
498    <property name="abcl-contrib.jar"
499              value="${dist.dir}/abcl-contrib.jar"/>
500    <condition property="abcl.contrib.uptodate.p">
501      <uptodate targetfile="${abcl-contrib.jar}">
502        <srcfiles dir="contrib">
503          <patternset refid="abcl.contrib.source"/>
504        </srcfiles>
505      </uptodate>
506    </condition>
507
508    <target name="abcl.contrib" unless="abcl.contrib.uptodate.p">
509      <jar destfile="${abcl-contrib.jar}"
510           compress="true"
511           basedir="contrib">
512        <patternset refid="abcl.contrib.source"/>
513      </jar>
514      <echo>
515Packaged contribs in ${abcl-contrib.jar}. To use contribs, ensure that
516this file is in the same directory as 'abcl.jar', and then
517
518  CL-USER> (require 'abcl-contrib)
519
520will place all the contribs in the ASDF registry.
521
522To load a contrib, something like
523
524  CL-USER> (require 'jss)
525
526will compile (if necessary) and load JSS.
527</echo>
528    </target>
529
530    <target name="abcl.contrib.javadoc.jar">
531      <mkdir dir="${dist.dir}"/>
532      <jar destfile="${dist.dir}/abcl-contrib-javadoc.jar" basedir="contrib">
533        <patternset refid="abcl.contrib.docs" />
534      </jar>
535    </target>
536
537    <target name="abcl.contrib.source.jar">
538      <mkdir dir="${dist.dir}"/>
539      <jar destfile="${dist.dir}/abcl-contrib-sources.jar" basedir="contrib">
540        <patternset refid="abcl.contrib.source" />
541      </jar>
542    </target>
543
544    <target name="abcl.debug.jpda" depends="abcl.jar">
545      <description>Invoke ABCL with JPDA listener on port 6789</description>
546      <java fork="true"
547            classpathref="abcl.classpath.dist"
548            classname="org.armedbear.lisp.Main">
549        <jvmarg 
550            value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
551      </java>
552      <echo>JPDA listening on localhost:6789</echo>
553    </target>
554
555    <target name="abcl.build.debug.jpda" depends="abcl.compile.java">
556      <description>Invoke ABCL with JPDA listener on port 6789</description>
557      <java fork="true"
558            classpathref="abcl.classpath.build"
559            classname="org.armedbear.lisp.Main">
560        <jvmarg
561            value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
562        <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/>
563      </java>
564      <echo>JPDA listening on localhost:6789</echo>
565    </target>
566
567    <target name="abcl.run" depends="abcl.jar">
568      <java fork="true"
569            classpathref="abcl.classpath.dist"
570            classname="org.armedbear.lisp.Main">
571      </java>
572    </target>
573
574    <target name="abcl.clean">
575      <delete dir="${build.dir}"/>
576      <delete file="${abcl.jar.path}"/>
577      <delete file="abcl"/>
578      <delete file="abcl.bat"/>
579    </target>
580
581    <target name="abcl.dist" depends="abcl.jar">
582      <copy file="${abcl.jar.path}"
583            toFile="${dist.dir}/abcl-${abcl.version}.jar"/>
584    </target>
585
586    <target name="abcl.distclean" depends="abcl.clean">
587      <delete dir="${dist.dir}"/>
588      <delete file="abcl"/>
589      <delete file="abcl.bat"/>
590    </target>
591
592    <target name="TAGS">
593      <delete file="TAGS"/>
594      <apply executable="etags" parallel="true" verbose="true" maxparallel="300">
595        <arg value="--append"/>
596        <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/>
597        <arg value='--regex=|[ \t]*@DocString([ \t]*name=\"\([^\"]*\)|\1|'/>
598        <fileset dir="${src.dir}">
599          <patternset refid="abcl.source.java"/>
600          <patternset refid="abcl.source.lisp"/>
601        </fileset>
602      </apply>
603    </target>
604
605    <patternset id="abcl.dist.misc"
606                description="Additional includes in the source distributions relative to basedir">
607      <include name="build.xml"/>
608      <include name="abcl.properties.in"/>
609      <include name="COPYING"/>
610      <include name="README"/>
611      <include name="CHANGES"/>
612      <include name="abcl.in"/>
613      <include name="abcl.bat.in"/>
614
615      <include name="abcl.asd"/>
616     
617      <include name="examples/**"/>
618
619      <include name="contrib/**"/>
620     
621      <include name="test/**"/>
622
623      <include name="build-from-lisp.sh"/>
624     
625      <!-- The remainder of these files are used by the Lisp hosted
626           build in 'build-abcl.lisp' but not used by Ant, so include
627           them in the source distribution. -->
628      <include name="make-jar.in"/>
629      <include name="make-jar.bat.in"/>
630
631      <include name="build-abcl.lisp"/>
632      <include name="customizations.lisp.in"/>
633
634    </patternset>
635
636    <patternset 
637        id="abcl.source.misc"
638        description="Additional includes in the source distribution relative to source root">
639      <include name="org/armedbear/lisp/LICENSE"/>
640      <include name="manifest-abcl"/>
641      <include name="META-INF/services/javax.script.ScriptEngineFactory"/>
642    </patternset>
643
644    <target name="abcl.source.prepare" depends="abcl.stamp.version">
645      <property name="abcl.build.src.dir"
646                value="${build.dir}/abcl-src-${abcl.version}"/>
647      <mkdir dir="${abcl.build.src.dir}/src"/>
648      <copy todir="${abcl.build.src.dir}/src"
649            preservelastmodified="true">
650        <fileset dir="${src.dir}"
651                 id="abcl.source.src">
652            <patternset refid="abcl.source.java"/>
653            <patternset refid="abcl.source.lisp"/>
654            <patternset refid="abcl.source.misc"/>
655        </fileset>
656      </copy>
657      <copy todir="${abcl.build.src.dir}"
658            preservelastmodified="true">
659        <fileset dir="${basedir}">
660            <patternset refid="abcl.dist.misc"/>
661        </fileset>
662      </copy>
663    </target>
664
665    <!--  Files in source distribution that always get LF EOL (aka
666         'unix') -->   
667    <patternset id="abcl.dist.lf">
668      <include name="abcl.in"/>
669    </patternset>
670
671    <!--  Files in source distribution that always get CRLF EOL (aka
672         'dos') -->   
673    <patternset id="abcl.dist.crlf">
674      <include name="abcl.bat.in"/>
675    </patternset>
676
677    <target name="abcl.source.unix" depends="abcl.source.prepare">
678      <fixcrlf srcdir="${abcl.build.src.dir}"
679               preservelastmodified="true"
680               eol="lf">
681      </fixcrlf>
682
683      <fixcrlf srcdir="${abcl.build.src.dir}"
684               preservelastmodified="true"
685               eol="crlf">
686          <patternset refid="abcl.dist.crlf"/>
687      </fixcrlf>
688
689      <fixcrlf srcdir="${abcl.build.src.dir}"
690               preservelastmodified="true"
691               eol="lf">
692          <patternset refid="abcl.dist.lf"/>
693      </fixcrlf>
694    </target>
695
696    <target name="abcl.source.tar" depends="abcl.source.unix">
697      <mkdir dir="${dist.dir}"/>
698      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
699           compression="gzip">
700        <tarfileset dir="${build.dir}">
701          <include name="abcl-src-${abcl.version}/**"/>
702        </tarfileset>
703      </tar>
704    </target>
705
706    <target name="abcl.source.windows" depends="abcl.source.prepare">
707      <fixcrlf srcdir="${abcl.build.src.dir}"
708               preservelastmodified="true"
709               eol="crlf">
710      </fixcrlf>
711
712      <fixcrlf srcdir="${abcl.build.src.dir}"
713               preservelastmodified="true"
714               eol="crlf">
715          <patternset refid="abcl.dist.crlf"/>
716      </fixcrlf>
717
718      <fixcrlf srcdir="${abcl.build.src.dir}"
719               preservelastmodified="true"
720               eol="lf">
721          <patternset refid="abcl.dist.lf"/>
722      </fixcrlf>
723    </target>
724
725    <target name="abcl.source.zip" depends="abcl.source.windows">
726      <mkdir dir="${dist.dir}"/>
727      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
728           compress="true">
729        <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
730      </zip>
731    </target>
732
733    <target name="abcl.source.jar" depends="abcl.source.unix">
734      <mkdir dir="${dist.dir}"/>
735      <jar destfile="${dist.dir}/abcl-${abcl.version}-sources.jar">
736        <metainf dir="${abcl.build.src.dir}">
737          <include name="COPYING"/>
738        </metainf>
739        <fileset dir="${abcl.build.src.dir}/src">
740          <include name="**/*.java"/>
741          <include name="**/*.lisp"/>
742        </fileset>
743      </jar>
744    </target>
745
746    <property name="abcl.javadoc.dir" value="${build.dir}/javadoc"/>
747
748    <target name="abcl.javadoc">
749      <mkdir dir="${abcl.javadoc.dir}"/>
750      <javadoc destdir="${abcl.javadoc.dir}"
751               sourcepath="${src.dir}"/>
752    </target>
753   
754    <target name="abcl.javadoc.jar" depends="abcl.stamp.version,abcl.javadoc">
755      <mkdir dir="${dist.dir}"/>
756      <jar destfile="${dist.dir}/abcl-${abcl.version}-javadoc.jar">
757        <fileset dir="${abcl.javadoc.dir}"/>
758      </jar>
759    </target>
760
761    <target name="abcl.binary.prepare" depends="abcl.jar,abcl.contrib,abcl.stamp.version">
762      <property name="abcl.build.binary.dir"
763                value="${build.dir}/abcl-bin-${abcl.version}"/>
764      <mkdir dir="${abcl.build.binary.dir}"/>
765      <copy todir="${abcl.build.binary.dir}"
766            preservelastmodified="true">
767        <fileset dir="${basedir}/dist">
768          <patternset>
769            <include name="abcl.jar"/>
770            <include name="abcl-contrib.jar"/>
771          </patternset>
772        </fileset>
773        <fileset dir="${basedir}">
774          <patternset>
775            <include name="README"/>
776            <include name="CHANGES"/>
777          </patternset>
778        </fileset>
779      </copy>
780    </target>
781
782    <target name="abcl.binary.tar" depends="abcl.binary.prepare">
783      <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz"
784           compression="gzip">
785        <tarfileset dir="${build.dir}">
786          <include name="abcl-bin-${abcl.version}/**"/>
787          </tarfileset>
788      </tar>
789    </target>
790
791    <target name="abcl.binary.zip" depends="abcl.binary.prepare">
792      <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip"
793           compress="true">
794        <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/>
795      </zip>
796    </target>
797
798    <target name="help.test">
799      <echo>
800The following Ant targets run various test suites:
801 
802  abcl.test
803    --  Run all available tests.
804  abcl.test.java
805    --  Run the ABCL junit Java tests under ${basedir}/test/src
806  abcl.test.lisp
807    --  Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets
808  test.ansi.compiled
809    --  Run the compiled version of the ANSI test suite
810  test.abcl
811    --  Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl
812  test.cl-bench
813    --  Run the cl-bench test suite.
814
815The ANSI tests require that the [ansi-tests][1] be manually installed in
816${basedir}/../ansi-tests.
817
818[1]: svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests
819
820The CL-BENCH tests require that [cl-bench][2] be manually installed in
821${basedir}/../cl-bench
822
823[2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz
824      </echo>
825    </target>
826
827    <property name="abcl.test.classes.dir"
828              value="${build.dir}/classes-test"/>
829
830    <property name="abcl.test.src.dir"
831              value="${basedir}/test/src"/>
832
833    <patternset id="abcl.test.source.java">
834      <!-- For now, we list tests explicitly, because we have to
835           enumerate them later to the JUnit test runner. -->
836      <include name="org/armedbear/lisp/*.java"/>
837    </patternset>
838
839    <property name="junit.path"
840              value="${abcl.ext.dir}/junit-4.8.1.jar"/>
841
842
843    <path id="abcl.test.compile.classpath">
844      <pathelement location="${junit.path}"/>
845      <pathelement location="${build.classes.dir}"/>
846    </path>
847
848    <target name="abcl.test.pre-compile" depends="abcl.ext"/>
849
850    <target name="abcl.ext.p">
851      <!--XXX generalize over enumeration of all contributions to
852           abcl.ext if we get more of them.  -->
853      <available file="${junit.path}" property="abcl.ext.p"/>
854    </target>
855    <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
856
857      <mkdir dir="${abcl.ext.dir}"/>
858      <get 
859          src="http://cloud.github.com/downloads/KentBeck/junit/junit-4.8.1.jar"
860          usetimestamp="true"
861          dest="${junit.path}"/>
862    </target>
863       
864    <target name="abcl.test.compile" 
865            depends="abcl.test.pre-compile">
866      <mkdir dir="${abcl.test.classes.dir}"/>
867      <javac destdir="${abcl.test.classes.dir}"
868             classpathref="abcl.test.compile.classpath"
869             debug="true"
870             target="1.5">
871        <src path="${abcl.test.src.dir}"/>
872        <patternset refid="abcl.test.source.java"/>
873      </javac>
874    </target>
875
876    <path id="abcl.test.run.classpath">
877      <path refid="abcl.test.compile.classpath"/>
878      <pathelement location="${abcl.test.classes.dir}"/>
879    </path>
880
881    <target name="abcl.test" 
882            depends="abcl.test.java,abcl.test.lisp"/>
883       
884    <target name="abcl.test.java" depends="abcl.test.compile">
885      <java fork="true"
886            classpathref="abcl.test.run.classpath"
887            classname="org.junit.runner.JUnitCore">
888        <arg value="org.armedbear.lisp.PathnameTest"/>
889        <arg value="org.armedbear.lisp.StreamTest"/>
890        <arg value="org.armedbear.lisp.UtilitiesTest"/>
891      </java>
892    </target>
893
894    <target name="abcl.test.lisp" 
895            depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
896
897    <target name="test.ansi.interpreted" depends="abcl.jar">
898      <echo>Recording test output in ${abcl.test.log.file}.</echo>
899      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
900      <java fork="true" dir="${basedir}"
901            classpathref="abcl.classpath.dist"
902            classname="org.armedbear.lisp.Main">
903        <arg value="--noinit"/> 
904        <arg value="--eval"/><arg value="(require (quote asdf))"/>
905        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
906        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-interpreted)"/>
907        <arg value="--eval"/><arg value="(ext:exit)"/>
908      </java>
909      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
910      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
911    </target>
912
913    <target name="test.ansi.compiled" depends="abcl.jar">
914      <echo>Recording test output in ${abcl.test.log.file}.</echo>
915      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
916      <java fork="true" dir="${basedir}"
917            classpathref="abcl.classpath.dist"
918            classname="org.armedbear.lisp.Main">
919        <arg value="--noinit"/> 
920        <arg value="--eval"/><arg value="(require (quote asdf))"/>
921        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
922        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-compiled)"/>
923        <arg value="--eval"/><arg value="(ext:exit)"/>
924      </java>
925      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
926      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
927    </target>
928
929    <target name="test.abcl" depends="abcl.jar">
930      <echo>Recording test output in ${abcl.test.log.file}.</echo>
931      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
932      <java fork="true" dir="${basedir}"
933            classpathref="abcl.classpath.dist"
934            classname="org.armedbear.lisp.Main">
935        <arg value="--noinit"/> 
936        <arg value="--eval"/><arg value="(require (quote asdf))"/>
937        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
938        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :abcl-test-lisp)"/>
939        <arg value="--eval"/><arg value="(ext:exit)"/>
940      </java>
941      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
942      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
943    </target>
944
945    <target name="test.cl-bench" depends="abcl.jar">
946      <echo>Recording test output in ${abcl.test.log.file}.</echo>
947      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
948      <java fork="true" dir="${basedir}"
949            classpathref="abcl.classpath.dist"
950            classname="org.armedbear.lisp.Main">
951        <arg value="--noinit"/> 
952        <arg value="--eval"/><arg value="(require (quote asdf))"/>
953        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
954        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :cl-bench)"/>
955        <arg value="--eval"/><arg value="(ext:exit)"/>
956      </java>
957      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
958      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
959    </target>
960   
961    <target name="abcl.release" 
962            depends="abcl.binary.tar,abcl.source.tar,abcl.binary.zip,abcl.source.zip">
963      <copy file="${abcl.jar.path}"
964            tofile="${dist.dir}/abcl-${abcl.version}.jar"/>
965      <copy file="${abcl-contrib.jar}"
966            tofile="${dist.dir}/abcl-contrib-${abcl.version}.jar"/>
967    </target>
968
969    <import file="netbeans-build.xml" optional="true"/> 
970<!--    <import file="j-build.xml" optional="true"/>  -->
971    <import file="not.org-build.xml" optional="true"/> 
972</project>
973
974
975
976
Note: See TracBrowser for help on using the repository browser.