source: branches/1.2.x/build.xml

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

abcl-1.2.0-rc-0: Non-functional changes for release.

Remove common-lisp.net as domain for abcl.org artifacts where possible.

  • Property svn:eol-style set to LF
File size: 39.5 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    <target name="abcl.distclean" depends="abcl.clean">
629      <delete dir="${dist.dir}"/>
630      <delete file="abcl"/>
631      <delete file="abcl.bat"/>
632    </target>
633
634    <target name="TAGS">
635      <delete file="TAGS"/>
636      <apply executable="etags" parallel="true" verbose="true" maxparallel="300">
637        <arg value="--append"/>
638        <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/>
639        <arg value='--regex=|[ \t]*@DocString([ \n\r\t]*name=\"\([^\"]*\)|\1|m'/>
640        <fileset dir="${src.dir}">
641          <patternset refid="abcl.source.java"/>
642          <patternset refid="abcl.source.lisp"/>
643        </fileset>
644      </apply>
645    </target>
646
647    <patternset id="abcl.dist.misc"
648                description="Additional includes in the source distributions relative to basedir">
649      <include name="build.xml"/>
650      <include name="abcl.properties.in"/>
651      <include name="COPYING"/>
652      <include name="README"/>
653      <include name="CHANGES"/>
654      <include name="abcl.in"/>
655      <include name="abcl.bat.in"/>
656
657      <include name="abcl.asd"/>
658     
659      <include name="examples/**"/>
660
661      <include name="contrib/**"/>
662     
663      <include name="test/**"/>
664
665      <include name="build-from-lisp.sh"/>
666     
667      <!-- The remainder of these files are used by the Lisp hosted
668           build in 'build-abcl.lisp' but not used by Ant, so include
669           them in the source distribution. -->
670      <include name="make-jar.in"/>
671      <include name="make-jar.bat.in"/>
672
673      <include name="build-abcl.lisp"/>
674      <include name="customizations.lisp.in"/>
675
676    </patternset>
677
678    <patternset 
679        id="abcl.source.misc"
680        description="Additional includes in the source distribution relative to source root">
681      <include name="org/armedbear/lisp/LICENSE"/>
682      <include name="manifest-abcl"/>
683      <include name="META-INF/services/javax.script.ScriptEngineFactory"/>
684    </patternset>
685
686    <target name="abcl.source.prepare" depends="abcl.stamp.version">
687      <property name="abcl.build.src.dir"
688                value="${build.dir}/abcl-src-${abcl.version}"/>
689      <mkdir dir="${abcl.build.src.dir}/src"/>
690      <copy todir="${abcl.build.src.dir}/src"
691            preservelastmodified="true">
692        <fileset dir="${src.dir}"
693                 id="abcl.source.src">
694            <patternset refid="abcl.source.java"/>
695            <patternset refid="abcl.source.lisp"/>
696            <patternset refid="abcl.source.misc"/>
697        </fileset>
698      </copy>
699      <copy todir="${abcl.build.src.dir}"
700            preservelastmodified="true">
701        <fileset dir="${basedir}">
702            <patternset refid="abcl.dist.misc"/>
703        </fileset>
704      </copy>
705    </target>
706
707    <!--  Files in source distribution that always get LF EOL (aka
708         'unix') -->   
709    <patternset id="abcl.dist.lf">
710      <include name="abcl.in"/>
711    </patternset>
712
713    <!--  Files in source distribution that always get CRLF EOL (aka
714         'dos') -->   
715    <patternset id="abcl.dist.crlf">
716      <include name="abcl.bat.in"/>
717    </patternset>
718
719    <target name="abcl.source.unix" depends="abcl.source.prepare">
720      <fixcrlf srcdir="${abcl.build.src.dir}"
721               preservelastmodified="true"
722               eol="lf">
723      </fixcrlf>
724
725      <fixcrlf srcdir="${abcl.build.src.dir}"
726               preservelastmodified="true"
727               eol="crlf">
728          <patternset refid="abcl.dist.crlf"/>
729      </fixcrlf>
730
731      <fixcrlf srcdir="${abcl.build.src.dir}"
732               preservelastmodified="true"
733               eol="lf">
734          <patternset refid="abcl.dist.lf"/>
735      </fixcrlf>
736    </target>
737
738    <target name="abcl.source.tar" depends="abcl.source.unix">
739      <mkdir dir="${dist.dir}"/>
740      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
741           compression="gzip">
742        <tarfileset dir="${build.dir}">
743          <include name="abcl-src-${abcl.version}/**"/>
744        </tarfileset>
745      </tar>
746    </target>
747
748    <target name="abcl.source.windows" depends="abcl.source.prepare">
749      <fixcrlf srcdir="${abcl.build.src.dir}"
750               preservelastmodified="true"
751               eol="crlf">
752      </fixcrlf>
753
754      <fixcrlf srcdir="${abcl.build.src.dir}"
755               preservelastmodified="true"
756               eol="crlf">
757          <patternset refid="abcl.dist.crlf"/>
758      </fixcrlf>
759
760      <fixcrlf srcdir="${abcl.build.src.dir}"
761               preservelastmodified="true"
762               eol="lf">
763          <patternset refid="abcl.dist.lf"/>
764      </fixcrlf>
765    </target>
766
767    <target name="abcl.source.zip" depends="abcl.source.windows">
768      <mkdir dir="${dist.dir}"/>
769      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
770           compress="true">
771        <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
772      </zip>
773    </target>
774
775    <target name="abcl.source.jar" depends="abcl.source.unix">
776      <mkdir dir="${dist.dir}"/>
777      <jar destfile="${dist.dir}/abcl-${abcl.version}-sources.jar">
778        <metainf dir="${abcl.build.src.dir}">
779          <include name="COPYING"/>
780        </metainf>
781        <fileset dir="${abcl.build.src.dir}/src">
782          <include name="**/*.java"/>
783          <include name="**/*.lisp"/>
784        </fileset>
785      </jar>
786    </target>
787
788    <property name="abcl.javadoc.dir" value="${build.dir}/javadoc"/>
789
790    <target name="abcl.javadoc">
791      <mkdir dir="${abcl.javadoc.dir}"/>
792      <javadoc destdir="${abcl.javadoc.dir}"
793               sourcepath="${src.dir}"/>
794    </target>
795   
796    <target name="abcl.javadoc.jar" depends="abcl.stamp.version,abcl.javadoc">
797      <mkdir dir="${dist.dir}"/>
798      <jar destfile="${dist.dir}/abcl-${abcl.version}-javadoc.jar">
799        <fileset dir="${abcl.javadoc.dir}"/>
800      </jar>
801    </target>
802
803    <target name="abcl.binary.prepare" depends="abcl.jar,abcl.contrib,abcl.stamp.version">
804      <property name="abcl.build.binary.dir"
805                value="${build.dir}/abcl-bin-${abcl.version}"/>
806      <mkdir dir="${abcl.build.binary.dir}"/>
807      <copy todir="${abcl.build.binary.dir}"
808            preservelastmodified="true">
809        <fileset dir="${basedir}/dist">
810          <patternset>
811            <include name="abcl.jar"/>
812            <include name="abcl-contrib.jar"/>
813          </patternset>
814        </fileset>
815        <fileset dir="${basedir}">
816          <patternset>
817            <include name="README"/>
818            <include name="CHANGES"/>
819          </patternset>
820        </fileset>
821      </copy>
822    </target>
823
824    <target name="abcl.binary.tar" depends="abcl.binary.prepare">
825      <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz"
826           compression="gzip">
827        <tarfileset dir="${build.dir}">
828          <include name="abcl-bin-${abcl.version}/**"/>
829          </tarfileset>
830      </tar>
831    </target>
832
833    <target name="abcl.binary.zip" depends="abcl.binary.prepare">
834      <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip"
835           compress="true">
836        <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/>
837      </zip>
838    </target>
839
840    <target name="help.test">
841      <echo>
842The following Ant targets run various test suites:
843 
844  abcl.test
845    --  Run all available tests.
846  abcl.test.java
847    --  Run the ABCL junit Java tests under ${basedir}/test/src
848  abcl.test.lisp
849    --  Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets
850  test.ansi.compiled
851    --  Run the compiled version of the ANSI test suite
852  test.abcl
853    --  Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl
854  test.cl-bench
855    --  Run the cl-bench test suite.
856
857The ANSI tests require that the [ansi-tests][1] be manually installed in
858${basedir}/../ansi-tests.
859
860[1]: http://lisp.not.org/project/ansi-test/
861
862The CL-BENCH tests require that [cl-bench][2] be manually installed in
863${basedir}/../cl-bench
864
865[2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz
866      </echo>
867    </target>
868
869    <property name="abcl.test.classes.dir"
870              value="${build.dir}/classes-test"/>
871
872    <property name="abcl.test.src.dir"
873              value="${basedir}/test/src"/>
874
875    <patternset id="abcl.test.source.java">
876      <!-- For now, we list tests explicitly, because we have to
877           enumerate them later to the JUnit test runner. -->
878      <include name="org/armedbear/lisp/*.java"/>
879    </patternset>
880
881    <property name="junit.path"
882              value="${abcl.ext.dir}/junit-4.8.1.jar"/>
883
884
885    <path id="abcl.test.compile.classpath">
886      <pathelement location="${junit.path}"/>
887      <pathelement location="${build.classes.dir}"/>
888    </path>
889
890    <target name="abcl.test.pre-compile" depends="abcl.ext"/>
891
892    <target name="abcl.ext.p">
893      <!--XXX generalize over enumeration of all contributions to
894           abcl.ext if we get more of them.  -->
895      <available file="${junit.path}" property="abcl.ext.p"/>
896    </target>
897    <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
898
899      <mkdir dir="${abcl.ext.dir}"/>
900      <get 
901          src="http://cloud.github.com/downloads/KentBeck/junit/junit-4.8.1.jar"
902          usetimestamp="true"
903          dest="${junit.path}"/>
904    </target>
905       
906    <target name="abcl.test.compile" 
907            depends="abcl.test.pre-compile">
908      <mkdir dir="${abcl.test.classes.dir}"/>
909      <javac destdir="${abcl.test.classes.dir}"
910             classpathref="abcl.test.compile.classpath"
911             debug="true"
912             target="1.5">
913        <src path="${abcl.test.src.dir}"/>
914        <patternset refid="abcl.test.source.java"/>
915      </javac>
916    </target>
917
918    <path id="abcl.test.run.classpath">
919      <path refid="abcl.test.compile.classpath"/>
920      <pathelement location="${abcl.test.classes.dir}"/>
921    </path>
922
923    <target name="abcl.test" 
924            depends="abcl.test.java,abcl.test.lisp"/>
925       
926    <target name="abcl.test.java" depends="abcl.test.compile">
927      <java fork="true"
928            classpathref="abcl.test.run.classpath"
929            classname="org.junit.runner.JUnitCore">
930        <arg value="org.armedbear.lisp.PathnameTest"/>
931        <arg value="org.armedbear.lisp.StreamTest"/>
932        <arg value="org.armedbear.lisp.UtilitiesTest"/>
933      </java>
934    </target>
935
936    <target name="abcl.test.lisp" 
937            depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
938
939    <target name="test.ansi.interpreted" depends="abcl.jar">
940      <echo>Recording test output in ${abcl.test.log.file}.</echo>
941      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
942      <java fork="true" dir="${basedir}"
943            classpathref="abcl.classpath.dist"
944            classname="org.armedbear.lisp.Main">
945        <arg value="--noinit"/> 
946        <arg value="--eval"/><arg value="(require (quote asdf))"/>
947        <arg value="--eval"/>
948          <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration)))"/>
949        <arg value="--eval"/><arg value="(asdf:load-system :abcl)"/>
950        <arg value="--eval"/><arg value="(asdf:test-system :ansi-interpreted)"/>
951        <arg value="--eval"/><arg value="(ext:exit)"/>
952      </java>
953      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
954      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
955    </target>
956
957    <target name="test.ansi.compiled" depends="abcl.jar">
958      <echo>Recording test output in ${abcl.test.log.file}.</echo>
959      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
960      <java fork="true" dir="${basedir}"
961            classpathref="abcl.classpath.dist"
962            classname="org.armedbear.lisp.Main">
963        <!-- Run in 64bit mode-->
964        <jvmarg value="-d64"/> 
965
966        <!-- Enable JVM assertions -->
967        <jvmarg value="-ea"/> 
968       
969        <!-- (Possibly) unload classes when reference count reaches zero -->
970        <jvmarg value="-XX:+CMSClassUnloadingEnabled"/> 
971
972        <!-- Increase the size of the space used to store JVM class metadata. -->
973        <jvmarg value="-XX:MaxPermSize=768m"/> 
974
975        <arg value="--noinit"/> 
976        <arg value="--eval"/><arg value="(require (quote asdf))"/>
977        <arg value="--eval"/>
978          <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration)))"/>
979        <arg value="--eval"/><arg value="(asdf:load-system :abcl)"/>
980        <arg value="--eval"/><arg value="(asdf:test-system :ansi-compiled)"/>
981        <arg value="--eval"/><arg value="(ext:exit)"/>
982      </java>
983      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
984      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
985    </target>
986
987    <target name="test.abcl" depends="abcl.jar">
988      <echo>Recording test output in ${abcl.test.log.file}.</echo>
989      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
990      <java fork="true" dir="${basedir}"
991            classpathref="abcl.classpath.dist"
992            classname="org.armedbear.lisp.Main">
993        <arg value="--noinit"/> 
994        <arg value="--eval"/><arg value="(require (quote asdf))"/>
995        <arg value="--eval"/>
996          <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration)))"/>
997        <arg value="--eval"/><arg value="(asdf:load-system :abcl)"/>
998        <arg value="--eval"/><arg value="(asdf:test-system :abcl-test-lisp)"/>
999        <arg value="--eval"/><arg value="(ext:exit)"/>
1000      </java>
1001      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
1002      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
1003    </target>
1004
1005    <target name="test.cl-bench" depends="abcl.jar">
1006      <echo>Recording test output in ${abcl.test.log.file}.</echo>
1007      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
1008      <java fork="true" dir="${basedir}"
1009            classpathref="abcl.classpath.dist"
1010            classname="org.armedbear.lisp.Main">
1011        <arg value="--noinit"/> 
1012        <arg value="--eval"/><arg value="(require (quote asdf))"/>
1013        <arg value="--eval"/>
1014          <arg value="(asdf:initialize-source-registry `(:source-registry (:directory ,*default-pathname-defaults*) :inherit-configuration)))"/>
1015        <arg value="--eval"/><arg value="(asdf:load-system :abcl)"/>
1016        <arg value="--eval"/><arg value="(asdf:test-system :cl-bench)"/>
1017        <arg value="--eval"/><arg value="(ext:exit)"/>
1018      </java>
1019      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
1020      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
1021    </target>
1022
1023
1024<target name="abcl.diagnostic" 
1025        description="Emit diagnostics describing available hosting JVM properties."
1026        depends="abcl.build.diagnostic"/>
1027<!--
1028
1029urn:org.abcl.build.ant.targets.diagnostic
1030
1031"Possible JVM values from"
1032
1033http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties
1034
1035.
1036
1037
1038java.version  Java Runtime Environment version
1039java.vendor   Java Runtime Environment vendor
1040java.vendor.url   Java vendor URL
1041java.home   Java installation directory
1042java.vm.specification.version   Java Virtual Machine specification version
1043java.vm.specification.vendor  Java Virtual Machine specification vendor
1044java.vm.specification.name  Java Virtual Machine specification name
1045java.vm.version   Java Virtual Machine implementation version
1046java.vm.vendor  Java Virtual Machine implementation vendor
1047java.vm.name  Java Virtual Machine implementation name
1048java.specification.version  Java Runtime Environment specification version
1049java.specification.vendor   Java Runtime Environment specification vendor
1050java.specification.name   Java Runtime Environment specification name
1051java.class.version  Java class format version number
1052java.class.path   Java class path
1053java.library.path   List of paths to search when loading libraries
1054java.io.tmpdir  Default temp file path
1055java.compiler   Name of JIT compiler to use
1056java.ext.dirs   Path of extension directory or directories
1057os.name   Operating system name
1058os.arch   Operating system architecture
1059os.version  Operating system version
1060file.separator  File separator ("/" on UNIX)
1061path.separator  Path separator (":" on UNIX)
1062line.separator  Line separator ("\n" on UNIX)
1063user.name   User's account name
1064user.home   User's home directory
1065user.dir
1066
1067-->
1068
1069<target name="abcl.build.diagnostic" description="Emit diagnostics describing available hosting JVM properties.">
1070  <echo>:java.version    ${java.version}</echo>
1071  <echo>:java.vendor     ${java.vendor}</echo>
1072  <echo>:java.vm.vendor  ${java.vm.vendor}</echo>
1073  <echo>:java.vm.name    ${java.vm.name}</echo>
1074
1075  <echo>:os.name    ${os.name}</echo>
1076  <echo>:os.arch    ${os.arch}</echo>
1077  <echo>:os.version ${os.version}</echo>
1078 
1079  <echo>:java.specification.version       ${java.specification.version}</echo>
1080  <echo>:java.vm.specification.version    ${java.vm.specification.version}</echo>
1081</target>
1082
1083    <target name="abcl.release" 
1084            depends="abcl.clean,abcl.binary.tar,abcl.source.tar,abcl.binary.zip,abcl.source.zip">
1085      <copy file="${abcl.jar.path}"
1086            tofile="${dist.dir}/abcl-${abcl.version}.jar"/>
1087      <copy file="${abcl-contrib.jar}"
1088            tofile="${dist.dir}/abcl-contrib-${abcl.version}.jar"/>
1089    </target>
1090
1091    <import file="netbeans-build.xml" optional="true"/> 
1092<!--    <import file="j-build.xml" optional="true"/>  -->
1093    <import file="not.org-build.xml" optional="true"/> 
1094   
1095    <import file="build-snapshot.xml" optional="true"/>
1096</project>
1097
1098
1099
1100
Note: See TracBrowser for help on using the repository browser.