source: branches/1.1.x/build.xml

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

1.1.0: Final annotation changes for abcl-1.1.0.

Semi-groveled from previous commit.

  • Property svn:eol-style set to LF
File size: 39.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    </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-9][3-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      <delete file="${build.classes.dir}/org/armedbear/lisp/version"/>
380      <uptodate property="abcl.stamp.version.uptodate.p" 
381                targetfile="${abcl.version.path}"
382                srcfile="${build.classes.dir}/org/armedbear/lisp/Version.class"/>
383    </target>
384
385    <target name="abcl.stamp.version" 
386            depends="abcl.version.src,abcl.stamp.version.1,abcl.stamp.version.2"
387            unless="abcl.stamp.version.uptodate.p">
388      <mkdir dir="${abcl.version.path}/.."/>
389      <echo>ABCL implementation version: ${abcl.implementation.version}</echo>
390      <echo file="${abcl.version.path}">${abcl.implementation.version}</echo>
391    </target>
392   
393    <target name="abcl.stamp.version.generate" 
394            depends="abcl.compile.java"
395            unless="abcl.stamp.version.uptodate.p">
396      <java fork="true"
397            classpath="${build.classes.dir}"
398            outputproperty="abcl.version"
399            classname="org.armedbear.lisp.Version"
400            logerror="yes"/> <!-- Don't catch stderr output -->
401    </target>
402
403    <target name="abcl.stamp.version.0" 
404            depends="abcl.stamp.version.uptodate,abcl.stamp.version.generate">
405    </target>
406
407    <target name="abcl.stamp.version.1"
408            depends="abcl.stamp.version.0"
409            unless="abcl.version.svn.p">
410      <property name="abcl.implementation.version"
411                value="${abcl.version}"/>
412    </target>
413
414    <target name="abcl.stamp.version.2" 
415            depends="abcl.stamp.version.0"
416            if="abcl.version.svn.p">
417      <property name="abcl.implementation.version"
418                value="${abcl.version}-${abcl.version.src}"/>
419    </target>
420
421    <target name="abcl.stamp.hostname" if="unix">
422      <exec executable="hostname" outputproperty="abcl.hostname"/>
423      <echo>abcl.hostname: ${abcl.hostname}</echo>
424    </target>
425
426    <target name="abcl.system.uptodate">
427      <condition property="abcl.system.needs-update.p">
428        <and>
429          <available file="${system.lisp.file}"/>
430          <available file="${abcl.startup.file}"/>
431          <uptodate
432                srcfile="${system.lisp.file}"
433                targetfile="${abcl.startup.file}"/>
434        </and>
435      </condition>
436    </target>
437   
438    <target name="abcl.system.update.maybe" depends="abcl.system.uptodate" 
439            if="abcl.system.needs-update.p">
440      <touch file="${src.dir}/org/armedbear/lisp/compile-system.lisp"/>
441    </target>
442
443    <target name="abcl.jar.uptodate" depends="abcl.compile,abcl.stamp">
444      <uptodate property="abcl.jar.uptodate.p" targetfile="${abcl.jar.path}">
445        <srcfiles dir="${build.classes.dir}">
446          <patternset refid="abcl.objects"/>
447        </srcfiles>
448      </uptodate>
449    </target>
450
451    <target name="abcl.jar" depends="abcl.jar.uptodate,abcl-contrib.jar"
452            unless="abcl.jar.uptodate.p">
453      <mkdir dir="${dist.dir}"/>
454      <jar destfile="${abcl.jar.path}"
455           compress="true"
456           update="true"
457           basedir="${build.classes.dir}">
458        <patternset refid="abcl.objects"/>
459        <manifest>
460          <attribute name="Main-Class" value="org.armedbear.lisp.Main"/>
461          <section name="org/armedbear/lisp">
462            <attribute name="Implementation-Title" 
463                       value="ABCL"/>
464            <attribute name="Implementation-Version" 
465                       value="${abcl.implementation.version}"/>
466            <attribute name="Implementation-Build" 
467                       value="${build}"/>
468          </section>
469        </manifest>
470        <metainf dir="${src.dir}/META-INF"> 
471          <exclude name="services/javax.script.ScriptEngineFactory"
472                   unless="abcl.jsr-223.p"/>
473        </metainf>
474      </jar>
475    </target>
476   
477    <target name="abcl.wrapper" 
478            depends="abcl.jar,abcl.contrib,abcl.wrapper.unix,abcl.wrapper.windows">
479      <description>
480        Creates in-place executable shell wrapper in '${abcl.wrapper.file}'
481      </description>
482      <!-- Set from commandline or in 'build.properties' -->
483      <property name="additional.jars" value=""/>
484      <path id="abcl.runtime.classpath">
485        <pathelement location="${abcl.runtime.jar.path}"/>
486        <pathelement path="${additional.jars}"/>
487      </path>
488      <!-- set via '-Djava.options=JAVA_OPTIONS' or in 'build.properties -->
489      <property name="java.options" value=""/>
490
491      <copy file="${abcl.wrapper.in.file}" toFile="${abcl.wrapper.file}" overwrite="yes">
492        <filterset>
493          <filter token="JAVA" 
494                  value="${java.path}"/>
495          <filter token="ABCL_JAVA_OPTIONS" 
496                  value="${java.options}"/>
497          <filter token="ABCL_CLASSPATH"
498                  value="${toString:abcl.runtime.classpath}"/>
499        </filterset>
500      </copy>
501      <chmod file="${abcl.wrapper.file}" perm="a+x"/>
502
503      <echo>Created executable ABCL wrapper in '${abcl.wrapper.file}'</echo>
504      <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo>
505    </target>
506
507    <target name="abcl.wrapper.unix" if="unix">
508      <property name="abcl.wrapper.file" value="abcl"/>
509      <property name="abcl.wrapper.in.file" value="abcl.in"/>
510    </target>
511
512    <target name="abcl.wrapper.windows" if="windows">
513      <property name="abcl.wrapper.file" value="abcl.bat"/>
514      <property name="abcl.wrapper.in.file" value="abcl.bat.in"/>
515    </target>
516
517    <patternset id="abcl.contrib.source">
518          <include name="**/*.asd"/>
519          <include name="**/*.lisp"/>
520          <include name="**/README.markdown"/>
521    </patternset>
522
523    <patternset id="abcl.contrib.docs">
524          <include name="**/README.markdown"/>
525    </patternset>
526
527    <property name="abcl-contrib.jar"
528              value="${dist.dir}/abcl-contrib.jar"/>
529    <condition property="abcl.contrib.uptodate.p">
530      <uptodate targetfile="${abcl-contrib.jar}">
531        <srcfiles dir="contrib">
532          <patternset refid="abcl.contrib.source"/>
533        </srcfiles>
534      </uptodate>
535    </condition>
536
537    <target name="abcl-contrib.jar" depends="abcl.contrib"/>
538    <target name="abcl.contrib" unless="abcl.contrib.uptodate.p">
539      <jar destfile="${abcl-contrib.jar}"
540           compress="true"
541           basedir="contrib">
542        <patternset refid="abcl.contrib.source"/>
543      </jar>
544      <echo>
545Packaged contribs in ${abcl-contrib.jar}. To use contribs, ensure that
546this file is in the same directory as 'abcl.jar', and then
547
548  CL-USER> (require 'abcl-contrib)
549
550will place all the contribs in the ASDF registry.
551
552To load a contrib, something like
553
554  CL-USER> (require 'jss)
555
556will compile (if necessary) and load JSS.
557</echo>
558    </target>
559
560    <target name="abcl.contrib.javadoc.jar">
561      <mkdir dir="${dist.dir}"/>
562      <jar destfile="${dist.dir}/abcl-contrib-javadoc.jar" basedir="contrib">
563        <patternset refid="abcl.contrib.docs" />
564      </jar>
565    </target>
566
567    <target name="abcl.contrib.source.jar">
568      <mkdir dir="${dist.dir}"/>
569      <jar destfile="${dist.dir}/abcl-contrib-sources.jar" basedir="contrib">
570        <patternset refid="abcl.contrib.source" />
571      </jar>
572    </target>
573
574    <target name="abcl.debug.jpda" depends="abcl.jar">
575      <description>Invoke ABCL with JPDA listener on port 6789</description>
576      <java fork="true"
577            classpathref="abcl.classpath.dist"
578            classname="org.armedbear.lisp.Main">
579        <jvmarg 
580            value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
581      </java>
582      <echo>JPDA listening on localhost:6789</echo>
583    </target>
584
585    <target name="abcl.build.debug.jpda" depends="abcl.compile.java">
586      <description>Invoke ABCL with JPDA listener on port 6789</description>
587      <java fork="true"
588            classpathref="abcl.classpath.build"
589            classname="org.armedbear.lisp.Main">
590        <jvmarg
591            value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
592        <jvmarg value="-Dabcl.home=${abcl.home.dir}${file.separator}"/>
593      </java>
594      <echo>JPDA listening on localhost:6789</echo>
595    </target>
596
597    <target name="abcl.run" depends="abcl.jar">
598      <java fork="true"
599            classpathref="abcl.classpath.dist"
600            classname="org.armedbear.lisp.Main">
601      </java>
602    </target>
603
604    <target name="abcl.clean">
605      <delete dir="${build.dir}"/>
606      <delete file="${abcl.jar.path}"/>
607      <delete file="abcl"/>
608      <delete file="abcl.bat"/>
609    </target>
610
611    <property name="slime.fasls" 
612              value="${user.home}/.slime/"/>
613    <property name="quicklisp.common-lisp.fasls"
614              value="${user.home}/.cache/common-lisp/"/>
615    <target name="abcl.clean.application.fasls">
616      <echo>WARNING:  This target is removing local application inter-Lisp fasls, forcing recompilation.
617      </echo>
618      <echo>Deleting local SLIME fasls under ${slime.fasls}</echo>
619      <delete dir="${slime.fasls}"/>
620      <echo>Deleting local Quicklisp fasls under ${quicklisp.common-lisp.fasls}</echo>
621      <delete dir="${quicklisp.common-lisp.fasls}"/>
622    </target>
623
624    <target name="abcl.dist" depends="abcl.jar">
625      <copy file="${abcl.jar.path}"
626            toFile="${dist.dir}/abcl-${abcl.version}.jar"/>
627    </target>
628
629
630
631
632    <target name="abcl.distclean" depends="abcl.clean">
633      <delete dir="${dist.dir}"/>
634      <delete file="abcl"/>
635      <delete file="abcl.bat"/>
636    </target>
637
638    <target name="TAGS">
639      <delete file="TAGS"/>
640      <apply executable="etags" parallel="true" verbose="true" maxparallel="300">
641        <arg value="--append"/>
642        <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/>
643        <arg value='--regex=|[ \t]*@DocString([ \t]*name=\"\([^\"]*\)|\1|'/>
644        <fileset dir="${src.dir}">
645          <patternset refid="abcl.source.java"/>
646          <patternset refid="abcl.source.lisp"/>
647        </fileset>
648      </apply>
649    </target>
650
651    <patternset id="abcl.dist.misc"
652                description="Additional includes in the source distributions relative to basedir">
653
654      <include name="abcl.rdf"/>
655      <include name="build.xml"/>
656      <include name="abcl.properties.in"/>
657      <include name="COPYING"/>
658      <include name="README"/>
659      <include name="CHANGES"/>
660      <include name="abcl.in"/>
661      <include name="abcl.bat.in"/>
662
663      <include name="abcl.asd"/>
664     
665      <include name="examples/**"/>
666
667      <include name="contrib/**"/>
668     
669      <include name="test/**"/>
670
671      <include name="build-from-lisp.sh"/>
672     
673      <!-- The remainder of these files are used by the Lisp hosted
674           build in 'build-abcl.lisp' but not used by Ant, so include
675           them in the source distribution. -->
676      <include name="make-jar.in"/>
677      <include name="make-jar.bat.in"/>
678
679      <include name="build-abcl.lisp"/>
680      <include name="customizations.lisp.in"/>
681
682    </patternset>
683
684    <patternset 
685        id="abcl.source.misc"
686        description="Additional includes in the source distribution relative to source root">
687      <include name="org/armedbear/lisp/LICENSE"/>
688      <include name="manifest-abcl"/>
689      <include name="META-INF/services/javax.script.ScriptEngineFactory"/>
690    </patternset>
691
692    <target name="abcl.source.prepare" depends="abcl.stamp.version">
693      <property name="abcl.build.src.dir"
694                value="${build.dir}/abcl-src-${abcl.version}"/>
695      <mkdir dir="${abcl.build.src.dir}/src"/>
696      <copy todir="${abcl.build.src.dir}/src"
697            preservelastmodified="true">
698        <fileset dir="${src.dir}"
699                 id="abcl.source.src">
700            <patternset refid="abcl.source.java"/>
701            <patternset refid="abcl.source.lisp"/>
702            <patternset refid="abcl.source.misc"/>
703        </fileset>
704      </copy>
705      <copy todir="${abcl.build.src.dir}"
706            preservelastmodified="true">
707        <fileset dir="${basedir}">
708            <patternset refid="abcl.dist.misc"/>
709        </fileset>
710      </copy>
711    </target>
712
713    <!--  Files in source distribution that always get LF EOL (aka
714         'unix') -->   
715    <patternset id="abcl.dist.lf">
716      <include name="abcl.in"/>
717    </patternset>
718
719    <!--  Files in source distribution that always get CRLF EOL (aka
720         'dos') -->   
721    <patternset id="abcl.dist.crlf">
722      <include name="abcl.bat.in"/>
723    </patternset>
724
725    <target name="abcl.source.unix" depends="abcl.source.prepare">
726      <fixcrlf srcdir="${abcl.build.src.dir}"
727               preservelastmodified="true"
728               eol="lf">
729      </fixcrlf>
730
731      <fixcrlf srcdir="${abcl.build.src.dir}"
732               preservelastmodified="true"
733               eol="crlf">
734          <patternset refid="abcl.dist.crlf"/>
735      </fixcrlf>
736
737      <fixcrlf srcdir="${abcl.build.src.dir}"
738               preservelastmodified="true"
739               eol="lf">
740          <patternset refid="abcl.dist.lf"/>
741      </fixcrlf>
742    </target>
743
744    <target name="abcl.source.tar" depends="abcl.source.unix">
745      <mkdir dir="${dist.dir}"/>
746      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
747           compression="gzip">
748        <tarfileset dir="${build.dir}">
749          <include name="abcl-src-${abcl.version}/**"/>
750        </tarfileset>
751      </tar>
752    </target>
753
754    <target name="abcl.source.windows" depends="abcl.source.prepare">
755      <fixcrlf srcdir="${abcl.build.src.dir}"
756               preservelastmodified="true"
757               eol="crlf">
758      </fixcrlf>
759
760      <fixcrlf srcdir="${abcl.build.src.dir}"
761               preservelastmodified="true"
762               eol="crlf">
763          <patternset refid="abcl.dist.crlf"/>
764      </fixcrlf>
765
766      <fixcrlf srcdir="${abcl.build.src.dir}"
767               preservelastmodified="true"
768               eol="lf">
769          <patternset refid="abcl.dist.lf"/>
770      </fixcrlf>
771    </target>
772
773    <target name="abcl.source.zip" depends="abcl.source.windows">
774      <mkdir dir="${dist.dir}"/>
775      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
776           compress="true">
777        <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
778      </zip>
779    </target>
780
781    <target name="abcl.source.jar" depends="abcl.source.unix">
782      <mkdir dir="${dist.dir}"/>
783      <jar destfile="${dist.dir}/abcl-${abcl.version}-sources.jar">
784        <metainf dir="${abcl.build.src.dir}">
785          <include name="COPYING"/>
786        </metainf>
787        <fileset dir="${abcl.build.src.dir}/src">
788          <include name="**/*.java"/>
789          <include name="**/*.lisp"/>
790        </fileset>
791      </jar>
792    </target>
793
794    <property name="abcl.javadoc.dir" value="${build.dir}/javadoc"/>
795
796    <target name="abcl.javadoc">
797      <mkdir dir="${abcl.javadoc.dir}"/>
798      <javadoc destdir="${abcl.javadoc.dir}"
799               sourcepath="${src.dir}"/>
800    </target>
801   
802    <target name="abcl.javadoc.jar" depends="abcl.stamp.version,abcl.javadoc">
803      <mkdir dir="${dist.dir}"/>
804      <jar destfile="${dist.dir}/abcl-${abcl.version}-javadoc.jar">
805        <fileset dir="${abcl.javadoc.dir}"/>
806      </jar>
807    </target>
808
809    <target name="abcl.binary.prepare" depends="abcl.jar,abcl.contrib,abcl.stamp.version">
810      <property name="abcl.build.binary.dir"
811                value="${build.dir}/abcl-bin-${abcl.version}"/>
812      <mkdir dir="${abcl.build.binary.dir}"/>
813      <copy todir="${abcl.build.binary.dir}"
814            preservelastmodified="true">
815        <fileset dir="${basedir}/dist">
816          <patternset>
817            <include name="abcl.jar"/>
818            <include name="abcl-contrib.jar"/>
819          </patternset>
820        </fileset>
821        <fileset dir="${basedir}">
822          <patternset>
823            <include name="README"/>
824            <include name="CHANGES"/>
825          </patternset>
826        </fileset>
827      </copy>
828    </target>
829
830    <target name="abcl.binary.tar" depends="abcl.binary.prepare">
831      <tar destfile="${dist.dir}/abcl-bin-${abcl.version}.tar.gz"
832           compression="gzip">
833        <tarfileset dir="${build.dir}">
834          <include name="abcl-bin-${abcl.version}/**"/>
835          </tarfileset>
836      </tar>
837    </target>
838
839    <target name="abcl.binary.zip" depends="abcl.binary.prepare">
840      <zip destfile="${dist.dir}/abcl-bin-${abcl.version}.zip"
841           compress="true">
842        <zipfileset dir="${abcl.build.binary.dir}" prefix="abcl-bin-${abcl.version}"/>
843      </zip>
844    </target>
845
846    <target name="help.test">
847      <echo>
848The following Ant targets run various test suites:
849 
850  abcl.test
851    --  Run all available tests.
852  abcl.test.java
853    --  Run the ABCL junit Java tests under ${basedir}/test/src
854  abcl.test.lisp
855    --  Run the 'test.ansi.compiled', 'test.abcl', 'test.cl-bench' targets
856  test.ansi.compiled
857    --  Run the compiled version of the ANSI test suite
858  test.abcl
859    --  Run the Lisp RT tests collected in ${basedir}/test/lisp/abcl
860  test.cl-bench
861    --  Run the cl-bench test suite.
862
863The ANSI tests require that the [ansi-tests][1] be manually installed in
864${basedir}/../ansi-tests.
865
866[1]: svn://common-lisp.net/project/ansi-test/svn/trunk/ansi-tests
867
868The CL-BENCH tests require that [cl-bench][2] be manually installed in
869${basedir}/../cl-bench
870
871[2]: http://www.chez.com/emarsden/downloads/cl-bench.tar.gz
872      </echo>
873    </target>
874
875    <property name="abcl.test.classes.dir"
876              value="${build.dir}/classes-test"/>
877
878    <property name="abcl.test.src.dir"
879              value="${basedir}/test/src"/>
880
881    <patternset id="abcl.test.source.java">
882      <!-- For now, we list tests explicitly, because we have to
883           enumerate them later to the JUnit test runner. -->
884      <include name="org/armedbear/lisp/*.java"/>
885    </patternset>
886
887    <property name="junit.path"
888              value="${abcl.ext.dir}/junit-4.8.1.jar"/>
889
890
891    <path id="abcl.test.compile.classpath">
892      <pathelement location="${junit.path}"/>
893      <pathelement location="${build.classes.dir}"/>
894    </path>
895
896    <target name="abcl.test.pre-compile" depends="abcl.ext"/>
897
898    <target name="abcl.ext.p">
899      <!--XXX generalize over enumeration of all contributions to
900           abcl.ext if we get more of them.  -->
901      <available file="${junit.path}" property="abcl.ext.p"/>
902    </target>
903    <target name="abcl.ext" depends="abcl.ext.p" unless="abcl.ext.p">
904
905      <mkdir dir="${abcl.ext.dir}"/>
906      <get 
907          src="http://cloud.github.com/downloads/KentBeck/junit/junit-4.8.1.jar"
908          usetimestamp="true"
909          dest="${junit.path}"/>
910    </target>
911       
912    <target name="abcl.test.compile" 
913            depends="abcl.test.pre-compile">
914      <mkdir dir="${abcl.test.classes.dir}"/>
915      <javac destdir="${abcl.test.classes.dir}"
916             classpathref="abcl.test.compile.classpath"
917             debug="true"
918             target="1.5">
919        <src path="${abcl.test.src.dir}"/>
920        <patternset refid="abcl.test.source.java"/>
921      </javac>
922    </target>
923
924    <path id="abcl.test.run.classpath">
925      <path refid="abcl.test.compile.classpath"/>
926      <pathelement location="${abcl.test.classes.dir}"/>
927    </path>
928
929    <target name="abcl.test" 
930            depends="abcl.test.java,abcl.test.lisp"/>
931       
932    <target name="abcl.test.java" depends="abcl.test.compile">
933      <java fork="true"
934            classpathref="abcl.test.run.classpath"
935            classname="org.junit.runner.JUnitCore">
936        <arg value="org.armedbear.lisp.PathnameTest"/>
937        <arg value="org.armedbear.lisp.StreamTest"/>
938        <arg value="org.armedbear.lisp.UtilitiesTest"/>
939      </java>
940    </target>
941
942    <target name="abcl.test.lisp" 
943            depends="test.ansi.compiled,test.abcl,test.cl-bench"/>
944
945    <target name="test.ansi.interpreted" depends="abcl.jar">
946      <echo>Recording test output in ${abcl.test.log.file}.</echo>
947      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
948      <java fork="true" dir="${basedir}"
949            classpathref="abcl.classpath.dist"
950            classname="org.armedbear.lisp.Main">
951        <arg value="--noinit"/> 
952        <arg value="--eval"/><arg value="(require (quote asdf))"/>
953        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
954        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-interpreted)"/>
955        <arg value="--eval"/><arg value="(ext:exit)"/>
956      </java>
957      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
958      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
959    </target>
960
961    <target name="test.ansi.compiled" depends="abcl.jar">
962      <echo>Recording test output in ${abcl.test.log.file}.</echo>
963      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
964      <java fork="true" dir="${basedir}"
965            classpathref="abcl.classpath.dist"
966            classname="org.armedbear.lisp.Main">
967        <!-- Run in 64bit mode-->
968        <jvmarg value="-d64"/> 
969
970        <!-- Enable JVM assertions -->
971        <jvmarg value="-ea"/> 
972       
973        <!-- (Possibly) unload classes when reference count reaches zero -->
974        <jvmarg value="-XX:+CMSClassUnloadingEnabled"/> 
975
976        <!-- Increase the size of the space used to store JVM class metadata. -->
977        <jvmarg value="-XX:MaxPermSize=768m"/> 
978
979        <arg value="--noinit"/> 
980        <arg value="--eval"/><arg value="(require (quote asdf))"/>
981        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
982        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :ansi-compiled)"/>
983        <arg value="--eval"/><arg value="(ext:exit)"/>
984      </java>
985      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
986      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
987    </target>
988
989    <target name="test.abcl" depends="abcl.jar">
990      <echo>Recording test output in ${abcl.test.log.file}.</echo>
991      <record name="${abcl.test.log.file}" emacsmode="true" action="start" append="yes"/>
992      <java fork="true" dir="${basedir}"
993            classpathref="abcl.classpath.dist"
994            classname="org.armedbear.lisp.Main">
995        <arg value="--noinit"/> 
996        <arg value="--eval"/><arg value="(require (quote asdf))"/>
997        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
998        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :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"/><arg value="(asdf:operate (quote asdf:load-op) :abcl)"/>
1014        <arg value="--eval"/><arg value="(asdf:operate (quote asdf:test-op) :cl-bench)"/>
1015        <arg value="--eval"/><arg value="(ext:exit)"/>
1016      </java>
1017      <record name="${abcl.test.log.file}" emacsmode="true" action="stop"/>
1018      <echo>Finished recording test output in ${abcl.test.log.file}.</echo>
1019    </target>
1020
1021
1022<target name="abcl.diagnostic" 
1023        description="Emit diagnostics describing available hosting JVM properties."
1024        depends="abcl.build.diagnostic"/>
1025<!--
1026
1027urn:org.abcl.build.ant.targets.diagnostic
1028
1029"Possible JVM values from"
1030
1031http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties
1032
1033.
1034
1035
1036java.version  Java Runtime Environment version
1037java.vendor   Java Runtime Environment vendor
1038java.vendor.url   Java vendor URL
1039java.home   Java installation directory
1040java.vm.specification.version   Java Virtual Machine specification version
1041java.vm.specification.vendor  Java Virtual Machine specification vendor
1042java.vm.specification.name  Java Virtual Machine specification name
1043java.vm.version   Java Virtual Machine implementation version
1044java.vm.vendor  Java Virtual Machine implementation vendor
1045java.vm.name  Java Virtual Machine implementation name
1046java.specification.version  Java Runtime Environment specification version
1047java.specification.vendor   Java Runtime Environment specification vendor
1048java.specification.name   Java Runtime Environment specification name
1049java.class.version  Java class format version number
1050java.class.path   Java class path
1051java.library.path   List of paths to search when loading libraries
1052java.io.tmpdir  Default temp file path
1053java.compiler   Name of JIT compiler to use
1054java.ext.dirs   Path of extension directory or directories
1055os.name   Operating system name
1056os.arch   Operating system architecture
1057os.version  Operating system version
1058file.separator  File separator ("/" on UNIX)
1059path.separator  Path separator (":" on UNIX)
1060line.separator  Line separator ("\n" on UNIX)
1061user.name   User's account name
1062user.home   User's home directory
1063user.dir
1064
1065-->
1066
1067<target name="abcl.build.diagnostic" description="Emit diagnostics describing available hosting JVM properties.">
1068  <echo>:java.version    ${java.version}</echo>
1069  <echo>:java.vendor     ${java.vendor}</echo>
1070  <echo>:java.vm.vendor  ${java.vm.vendor}</echo>
1071  <echo>:java.vm.name    ${java.vm.name}</echo>
1072
1073  <echo>:os.name    ${os.name}</echo>
1074  <echo>:os.arch    ${os.arch}</echo>
1075  <echo>:os.version ${os.version}</echo>
1076 
1077  <echo>:java.specification.version       ${java.specification.version}</echo>
1078  <echo>:java.vm.specification.version    ${java.vm.specification.version}</echo>
1079</target>
1080
1081    <target name="abcl.release" 
1082            depends="abcl.clean,abcl.binary.tar,abcl.source.tar,abcl.binary.zip,abcl.source.zip">
1083      <copy file="${abcl.jar.path}"
1084            tofile="${dist.dir}/abcl-${abcl.version}.jar"/>
1085      <copy file="${abcl-contrib.jar}"
1086            tofile="${dist.dir}/abcl-contrib-${abcl.version}.jar"/>
1087    </target>
1088
1089    <import file="netbeans-build.xml" optional="true"/> 
1090<!--    <import file="j-build.xml" optional="true"/>  -->
1091    <import file="not.org-build.xml" optional="true"/> 
1092   
1093    <import file="build-snapshot.xml" optional="true"/>
1094</project>
1095
1096
1097
1098
Note: See TracBrowser for help on using the repository browser.