source: trunk/abcl/build.xml @ 14165

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

Ant target to 'abcl.compile.lisp.debug' via JDWP.

With this target, he Lisp compilation is invoked with the contents of
the JVM property "abcl.compile.lisp.debug.jvmarg". The default value
of this property suspends the JVM at the start of the compilation,
listening on port 6789.

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