source: trunk/abcl/build.xml @ 14042

Last change on this file since 14042 was 14042, checked in by Mark Evenson, 8 years ago

ant:abcl.test: Specify JVM args for permgen size so ansi-compiled runs.

TODO These should probably be parameterized, and settable from
properties, for all ABCL invocations.

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