source: tags/1.3.1/build.xml

Last change on this file was 14671, checked in by Mark Evenson, 10 years ago

Backport r14660: Don't emit warnings for JDK8 in build process: it seems to work just fine.

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