source: branches/typed-asm/abcl/build.xml

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

build: TAGS target now matches multiline @DocString? tags.

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