Changeset 11338


Ignore:
Timestamp:
10/10/08 19:57:48 (13 years ago)
Author:
ehuelsmann
Message:

Ant build script update.

Patch by: Mark Evenson <evenson at panix dot com>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/build.xml

    r10795 r11338  
    1 <project name="j" default="compile" basedir="./src">
    2 
    3   <!-- Set global properties for this build -->
    4   <property name="version" value="0.21.0.4+"/>
    5   <property name="topdir" value="${basedir}/.."/>
    6   <property name="distdir" value="/tmp/j-${version}"/>
    7   <property file="${topdir}/build.properties"/>
    8   <property name="java" value="${jdk}/jre/bin/java"/>
    9   <property name="java_options" value=""/>
    10   <property name="extensions" value=""/>
    11   <property name="junit" value=""/>
    12   <property name="datadir" value="/usr/local/share"/>
    13   <property name="bindir" value="/usr/local/bin"/>
    14 
    15   <property name="build.compiler.emacs" value="yes"/>
    16 
    17   <property name="JAVA" value="${java}"/>
    18   <property name="JAVA_OPTIONS" value="${java_options}"/>
    19 
    20   <property name="debug" value="no"/>
    21 
    22   <path id="classpath">
    23     <pathelement location="${basedir}"/>
    24     <pathelement location="${datadir}/j/j.jar"/>
    25     <pathelement path="${extensions}"/>
    26     <pathelement path="${jdk}/lib/tools.jar"/>
    27   </path>
    28 
    29   <property name="CLASSPATH" refid="classpath"/>
    30 
    31   <path id="abcl_classpath">
    32     <pathelement location="${basedir}"/>
    33   </path>
    34 
    35   <property name="ABCL_CLASSPATH" refid="abcl_classpath"/>
    36 
    37   <target name="prepare">
    38     <!-- Create the time stamp -->
    39     <tstamp>
    40       <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/>
    41     </tstamp>
    42     <condition property="unix">
    43       <os family="unix"/>
    44     </condition>
    45     <condition property="windows">
    46       <os family="windows"/>
    47     </condition>
    48     <available
    49       classname="com.sun.jdi.Bootstrap"
    50       classpath="${jdk}/jre/lib/rt.jar:${extensions}:${jdk}/lib/tools.jar"
    51       property="jpda.present"
    52     />
    53     <available file="org/armedbear/lisp/Interpreter.java" property="lisp.present"/>
    54   </target>
    55 
    56   <target
    57     name="compile"
    58     depends="classes, jdbclasses, lispclasses, stamp, stamp.hostname"
    59   />
    60 
    61   <target name="lisp" depends="lispclasses"/>
    62 
    63   <target name="classes" depends="prepare">
    64     <echo message="debug=${debug}" />
    65     <javac
    66       srcdir="."
    67       destdir="${basedir}"
    68       classpath="${basedir}:${jdk}/jre/lib/rt.jar:${extensions}"
    69       includeAntRuntime="no"
    70       excludes="org/armedbear/j/_darcs/**/*,org/armedbear/lisp/**/*, org/armedbear/j/jdb/**/*"
    71       debug="${debug}"
    72     />
    73   </target>
    74 
    75   <target name="jdbclasses" depends="prepare" if="jpda.present">
    76     <echo message="debug=${debug}" />
    77     <javac
    78       srcdir="."
    79       destdir="${basedir}"
    80       classpath="${basedir}:${jdk}/jre/lib/rt.jar:${extensions}:${jdk}/lib/tools.jar"
    81       includeAntRuntime="no"
    82       includes="org/armedbear/j/jdb/*"
    83       debug="${debug}"
    84     />
    85   </target>
    86 
    87   <target name="lispclasses" depends="prepare" if="lisp.present">
    88     <echo message="debug=${debug}" />
    89     <javac
    90       srcdir="."
    91       destdir="${basedir}"
    92       classpath="${basedir}:${jdk}/jre/lib/rt.jar:${junit}"
    93       includeAntRuntime="no"
    94       includes="org/armedbear/lisp/**/*"
    95       excludes="org/armedbear/lisp/_darcs/**/*"
    96       debug="${debug}"
    97     />
    98     <echo message="${build}&#10;" file="${basedir}/org/armedbear/lisp/build"/>
    99   </target>
    100 
    101   <target name="stamp">
    102     <echo message="${version}&#10;" file="${basedir}/org/armedbear/j/version"/>
    103     <echo message="${build}&#10;" file="${basedir}/org/armedbear/j/build"/>
    104     <exec executable="hostname" os="Linux" outputproperty="hostname"/>
    105   </target>
    106 
    107   <target name="stamp.hostname" if="unix">
    108     <exec executable="hostname" outputproperty="hostname"/>
    109     <echo message="${hostname}&#10;" file="${basedir}/org/armedbear/j/build" append="yes"/>
    110   </target>
    111 
    112   <!-- FIXME If snapshots have version numbers, we don't need this any more. -->
    113   <target name="stamp.snapshot">
    114     <echo message="${build}&#10;" file="${basedir}/org/armedbear/j/snapshot"/>
    115   </target>
    116 
    117   <target name="all" depends="all.unix, all.windows"/>
    118 
    119   <target name="all.unix" depends="j.jar, jpty" if="unix">
    120     <filter token="JAVA" value="${JAVA}"/>
    121     <filter token="JAVA_OPTIONS" value="${JAVA_OPTIONS}"/>
    122     <filter token="CLASSPATH" value="${CLASSPATH}"/>
    123     <copy file="${topdir}/j.in" tofile="${topdir}/j" filtering="yes" overwrite="yes"/>
    124     <chmod file="${topdir}/j" perm="ugo+rx"/>
    125   </target>
    126 
    127   <target name="all.windows" depends="j.jar, jpty" if="windows">
    128     <filter token="JAVA" value="${JAVA}"/>
    129     <filter token="JAVA_OPTIONS" value="${JAVA_OPTIONS}"/>
    130     <filter token="CLASSPATH" value="${CLASSPATH}"/>
    131     <filter token="ABCL_CLASSPATH" value="${ABCL_CLASSPATH}"/>
    132     <copy file="${topdir}/j.bat.in" tofile="${topdir}/j.bat" filtering="yes" overwrite="yes"/>
    133     <copy file="${topdir}/abcl.bat.in" tofile="${topdir}/abcl.bat" filtering="yes" overwrite="yes"/>
    134   </target>
    135 
    136   <target name="j.jar" depends="compile, fasls">
    137     <jar jarfile="../j.jar" manifest="manifest" basedir="${basedir}">
    138       <exclude name="pg.class"/>
    139       <exclude name="SampleExtension.class"/>
    140       <exclude name="org/armedbear/lisp/Tests.class"/>
    141       <include name="**/*.class"/>
     1<?xml version="1.0" encoding="UTF-8"?>
     2<project xmlns="antlib:org.apache.tools.ant"
     3   name="abcl-master" default="help" basedir=".">
     4    <description>Armed Bear Common Lisp</description>
     5
     6    <target name="abcl" depends="abcl.wrapper"/>
     7
     8    <property file="build.properties"/>
     9
     10    <property name="build.dir"
     11        value="${basedir}/build"/>
     12    <property name="build.classes.dir"
     13        value="${build.dir}/classes"/>
     14    <property name="src.dir"
     15        value="${basedir}/src"/>
     16    <property name="dist.dir"
     17        value="${basedir}/dist"/>
     18    <property name="abcl.jar.path"
     19        value="${dist.dir}/abcl.jar"/>
     20    <property name="j.jar.path"
     21        value="${dist.dir}/j.jar"/>
     22
     23    <target name="help">
     24      <echo>Main Ant targets:
     25 abcl.compile 
     26   -- compile ABCL to ${build.classes.dir}
     27 abcl.jar     
     28   -- create packaged ${abcl.jar.path}
     29 abcl.wrapper 
     30   -- create executable wrapper for ABCL
     31 abcl.source.zip abcl.source.tar
     32    -- create source distributions in ${dist.dir}
     33 abcl.clean
     34    -- remove ABCL intermediate files</echo>
     35      <echo>Corresponding targets for J exist, but currently aren't as well tested.
     36      </echo>
     37    </target>
     38
     39    <property name="abcl.version.path"
     40        value="${build.classes.dir}/org/armedbear/lisp/version"/>
     41    <property name="abcl.build.path"
     42        value="${build.classes.dir}/org/armedbear/lisp/build"/>
     43    <property name="j.version.path"
     44        value="${build.classes.dir}/org/armedbear/j/version"/>
     45    <property name="j.build.path"
     46        value="${build.classes.dir}/org/armedbear/j/build"/>
     47
     48    <target name="abcl.stamp" depends="abcl.compile">
     49      <tstamp>
     50         <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/>
     51      </tstamp>
     52      <mkdir dir="${abcl.build.path}/.."/>
     53      <echo message="${build}" file="${abcl.build.path}"/>   
     54      <condition property="unix">
     55  <or>
     56    <os family="unix"/>
     57    <os family="mac"/>
     58  </or>
     59      </condition>
     60
     61      <condition property="windows"> <os family="windows"/></condition>
     62
     63      <available file="${src.dir}org/armedbear/lisp/Interpreter.java"
     64     property="abcl.lisp.p"/>
     65
     66      <antcall target="abcl.stamp.version"/>
     67      <antcall target="abcl.stamp.hostname"/>
     68    </target>
     69
     70    <target name="j.stamp" depends="j.compile">
     71      <echo message="${build}" file="${j.build.path}"/>   
     72    </target>
     73
     74    <target name="abcl.stamp.version">
     75<!-- XXX Not working, so use grep instead. 
     76      <java fork="true"
     77      classpath="${build.classes.dir}"
     78      outputproperty="abcl.version"
     79      classname="org.armedbear.lisp.Main">
     80  <arg value="- -noinit"/>
     81  <arg value="- -eval"/>
     82  <arg value="(lisp-implementation-version)"/>
     83      </java>
     84-->
     85      <exec executable="grep"
     86      outputproperty="abcl.version">
     87  <arg value="--only-matching"/>
     88  <arg value="--max-count"/><arg value="1"/>
     89  <arg value="--regexp"/>
     90  <arg value="\([0-9]\+\.\)\+[0-9]"/>
     91  <arg value="${src.dir}/org/armedbear/lisp/Version.java"/>
     92      </exec>
     93      <echo>Building ABCL version: ${abcl.version}</echo>
     94      <mkdir dir="${abcl.version.path}/.."/>
     95      <echo message="${abcl.version}" file="${abcl.version.path}"/>
     96    </target>
     97
     98    <target name="abcl.stamp.hostname">
     99      <property name="j.build.path"
     100    value="${build.classes.dir}/org/armedbear/j/build"/>
     101      <exec executable="hostname" outputproperty="abcl.hostname"/>
     102      <echo>abcl.hostname: ${abcl.hostname}</echo>
     103    </target>
     104
     105    <target name="j.stamp.hostname">
     106      <echo message="${abcl.hostname}" file="${j.build.path}" append="yes"/>
     107    </target>
     108
     109    <patternset id="abcl.source.java">
     110      <include name="org/armedbear/lisp/*.java"/>
     111      <include name="org/armedbear/Main.java"/>
     112    </patternset>
     113   
     114    <patternset id="abcl.source.lisp">
     115      <include name="org/armedbear/lisp/*.lisp"/>
     116      <include name="org/armedbear/lisp/tests/*.lisp"/>
     117<!--      <include name="org/armedbear/lisp/awt/*.lisp"/> -->
     118    </patternset>
     119
     120    <!-- Lisp files required at runtime -->
     121    <patternset id="abcl.source.lisp.dist">
     122      <include name="org/armedbear/lisp/boot.lisp"/>
     123      <include name="org/armedbear/lisp/top-level.lisp"/>
     124      <include name="org/armedbear/lisp/*.lisp"/>
     125    </patternset>
     126
     127    <patternset id="abcl.objects">
     128      <include name="org/armedbear/lisp/*.class"/>
     129      <include name="org/armedbear/lisp/*.cls"/>
     130      <include name="org/armedbear/lisp/*.abcl"/>
     131      <patternset refid="abcl.source.lisp.dist"/>
     132    </patternset>
     133   
     134    <patternset id="j.source">
     135      <include name="Main.java"/>
     136      <include name="gnu/regexp/*.java"/>
     137      <include name="org/armedbear/j/**/*.java"/>
     138      <!-- Assumed to need the org.armedbear.lisp.awt.* classes as ABCL
     139           itself doesn't seem to need them. -->
     140      <include name="org/armedbear/lisp/awt/*.class"/>
     141    </patternset>
     142
     143    <patternset id="j.objects">
     144      <patternset refid="abcl.objects"/>
     145      <include name="Main.class"/>
     146      <include name="gnu/regexp/*.class"/>
     147      <include name="org/armedbear/j/**/*.class"/>
     148    </patternset>
     149
     150    <patternset id="j.resources.src">
    142151      <include name="**/*.keywords"/>
    143152      <include name="org/armedbear/j/version"/>
     
    146155      <include name="org/armedbear/j/images/*.png"/>
    147156      <include name="gnu/regexp/MessagesBundle.properties"/>
    148       <include name="org/armedbear/lisp/build"/>
    149       <include name="org/armedbear/lisp/*.lisp"/>
    150       <include name="org/armedbear/lisp/*.abcl"/>
    151       <include name="org/armedbear/lisp/*.cls"/>
    152     </jar>
    153   </target>
    154 
    155   <target name="jpty" if="jpty">
    156     <ant antfile="jpty/build.xml"/>
    157   </target>
    158 
    159   <target name="fasls">
    160     <exec executable="${java}" dir="${basedir}">
    161       <!-- Use the server VM to avoid stack overflow (Java 1.5, Windows).-->
    162       <arg line="-server -cp . org.armedbear.lisp.Main --noinit --eval '(compile-system :zip nil :quit t)'"/>
    163     </exec>
    164   </target>
    165 
    166   <!-- Install -->
    167   <target name="install" depends="install.unix, install.windows"/>
    168 
    169   <target name="install.unix" depends="all" if="unix">
    170     <mkdir dir="${datadir}/j"/>
    171     <mkdir dir="${datadir}/j/themes"/>
    172     <mkdir dir="${datadir}/doc/j" />
    173     <copy file="${topdir}/j.jar" todir="${datadir}/j"/>
    174     <copy file="${topdir}/j" todir="${bindir}"/>
    175     <chmod file="${bindir}/j" perm="ugo+rx"/>
    176     <copy file="${basedir}/jpty/jpty" todir="${bindir}"/>
    177     <chmod file="${bindir}/jpty" perm="ugo+rx"/>
    178     <copy todir="${datadir}/j/themes">
    179       <fileset dir="${topdir}/themes"/>
    180     </copy>
    181     <copy todir="${datadir}/doc/j">
    182       <fileset dir="${topdir}/doc"/>
    183     </copy>
    184   </target>
    185 
    186   <target name="install.windows" depends="all" if="windows">
    187     <mkdir dir="${datadir}/j"/>
    188     <mkdir dir="${datadir}/j/themes"/>
    189     <mkdir dir="${datadir}/doc/j" />
    190     <copy file="${topdir}/j.jar" todir="${datadir}/j"/>
    191     <copy file="${topdir}/j.bat" todir="${bindir}"/>
    192     <copy file="${basedir}/jpty/jpty.exe" todir="${bindir}"/>
    193     <copy todir="${datadir}/j/themes">
    194       <fileset dir="${topdir}/themes"/>
    195     </copy>
    196     <copy todir="${datadir}/doc/j">
    197       <fileset dir="${topdir}/doc"/>
    198     </copy>
    199   </target>
    200 
    201   <!-- Uninstall -->
    202   <target name="uninstall">
    203     <delete file="${datadir}/j/j.jar" verbose="true"/>
    204     <delete file="${bindir}/j" verbose="true"/>
    205     <delete file="${bindir}/jpty" verbose="true"/>
    206     <delete file="${bindir}/jpty.exe" verbose="true"/>
    207     <delete verbose="true">
    208       <fileset dir="${datadir}/j/themes"/>
    209     </delete>
    210     <delete verbose="true">
    211       <fileset dir="${datadir}/doc/j"/>
    212     </delete>
    213   </target>
    214 
    215   <target name="clean">
    216     <delete>
    217       <fileset dir="${topdir}" includes="**/*.zip"/>
    218       <fileset dir="${topdir}" includes="**/*.tar.gz"/>
    219       <fileset dir="${topdir}" includes="**/*.jar"/>
    220       <fileset dir="${topdir}" includes="**/*.class"/>
    221       <fileset dir="${topdir}" includes="**/*.abcl"/>
    222       <fileset dir="${topdir}" includes="**/*.cls"/>
    223       <fileset dir="${topdir}" includes="**/*~"/>
    224       <fileset dir="${topdir}" includes="**/.#*"/>
    225       <fileset dir="${topdir}" includes="**/TEST-*.txt"/>
    226     </delete>
    227     <delete dir="${topdir}/autom4te.cache"/>
    228     <delete file="${topdir}/j"/>
    229     <delete file="${topdir}/j.bat"/>
    230     <delete file="${basedir}/jpty/jpty"/>
    231     <delete file="${basedir}/jpty/jpty.exe"/>
    232     <delete file="${basedir}/org/armedbear/j/version"/>
    233     <delete file="${basedir}/org/armedbear/j/build"/>
    234   </target>
    235 
    236   <!-- Distribution -->
    237   <target name="dist" depends="prepare, distdir" if="unix">
    238     <tar tarfile="${topdir}/j-${version}.tar" basedir="/tmp">
    239       <include name="j-${version}/**"/>
    240     </tar>
    241     <gzip zipfile="${topdir}/j-${version}.tar.gz" src="${topdir}/j-${version}.tar"/>
    242     <delete file="${topdir}/j-${version}.tar"/>
    243     <zip zipfile="${topdir}/j-${version}.zip" basedir="/tmp">
    244       <include name="j-${version}/**"/>
    245     </zip>
    246   </target>
    247 
    248   <target name="distdir" depends="prepare" if="unix">
    249     <delete dir="${distdir}"/>
    250     <mkdir dir="${distdir}"/>
    251     <copy todir="${distdir}">
    252       <fileset dir="${topdir}">
    253         <exclude name="**/*.orig"/>
    254         <exclude name="**/*.class"/>
    255         <exclude name="**/*.jar"/>
    256         <exclude name="**/*.zip"/>
    257         <exclude name="**/*.tar"/>
    258         <exclude name="**/*.tar.gz"/>
    259         <exclude name="src/test/**"/>
    260         <exclude name="src/org/armedbear/lisp/lisp"/>
    261         <exclude name="**/Makefile"/>
    262         <exclude name="config.*"/>
    263         <exclude name="autom4te.cache/**"/>
    264         <exclude name="**/classes.stamp"/>
    265         <exclude name="**/build"/>
    266         <exclude name="**/version"/>
    267         <exclude name="**/j"/>
    268         <exclude name="**/j.bat"/>
    269         <exclude name="**/jpty"/>
    270         <exclude name="**/ChangeLog"/>
    271       </fileset>
    272     </copy>
    273   </target>
    274 
    275   <target name="bindist" depends="prepare, bindistdir" if="unix">
    276     <tar tarfile="${topdir}/j-${version}-binary.tar" basedir="/tmp">
    277       <include name="j-${version}/**"/>
    278     </tar>
    279     <gzip zipfile="${topdir}/j-${version}-binary.tar.gz" src="${topdir}/j-${version}-binary.tar"/>
    280     <delete file="${topdir}/j-${version}-binary.tar"/>
    281     <zip zipfile="${topdir}/j-${version}-binary.zip" basedir="/tmp">
    282       <include name="j-${version}/**"/>
    283     </zip>
    284   </target>
    285 
    286   <target name="bindistdir" depends="release" if="unix">
    287     <delete dir="${distdir}"/>
    288     <mkdir dir="${distdir}"/>
    289     <copy todir="${distdir}">
    290       <fileset dir="${topdir}">
    291         <include name="j.jar"/>
    292         <include name="COPYING"/>
    293         <include name="doc/*.html"/>
    294         <include name="doc/*.css"/>
    295         <include name="themes/*"/>
    296         <include name="examples/*"/>
    297       </fileset>
    298     </copy>
    299   </target>
    300 
    301   <!-- Build j.jar from scratch without debug information -->
    302   <target name="release" depends="prepare, clean">
    303     <antcall target="j.jar">
    304       <param name="debug" value="no"/>
    305       <param name="build.compiler" value="javac1.4"/>
    306     </antcall>
    307   </target>
    308 
    309   <target name="snapshot" depends="clean, prepare, stamp.snapshot, j.zip, j-jar.zip">
    310     <delete file="${basedir}/org/armedbear/j/snapshot"/>
    311   </target>
    312 
    313   <target name="j.zip">
    314     <delete file="${topdir}/j.zip"/>
    315     <zip
    316       zipfile="${topdir}/j.zip"
    317       basedir="${topdir}"
    318       excludes="src/TEST-*.txt, **/*.orig, **/*.class, **/*.jar, **/*.zip,
    319         src/test/**, **/Makefile,
    320         config.status, config.cache, config.log, autom4te.cache/**,
    321         **/classes.stamp, **/build, **/version,
    322         **/j, **/j.bat, **/jpty, **/ChangeLog, src/org/armedbear/lisp/lisp"
    323     />
    324   </target>
    325 
    326   <target name="j-jar.zip">
    327     <delete file="${topdir}/j-jar.zip"/>
    328     <delete file="${topdir}/j.jar"/>
    329     <antcall target="j.jar">
    330       <param name="debug" value="yes"/>
    331       <param name="build.compiler" value="javac1.4"/>
    332     </antcall>
    333     <zip zipfile="${topdir}/j-jar.zip" basedir="${topdir}" includes="j.jar"/>
    334   </target>
    335 
     157    </patternset>
     158
     159    <patternset id="j.resources.top">
     160      <include name="COPYING"/>
     161      <include name="doc/*.html"/>
     162      <include name="doc/*.css"/>
     163      <include name="themes/*"/>
     164      <include name="examples/*"/>
     165    </patternset>
     166
     167    <path id="abcl.classpath.dist">
     168      <pathelement location="${abcl.jar.path}"/>
     169    </path>
     170   
     171    <path id="abcl.classpath.build">
     172      <pathelement location="${build.classes.dir}"/>
     173    </path>
     174
     175    <target name="abcl.compile" depends="abcl.pre-compile,abcl.compile.lisp">
     176      <echo>Compiled ABCL with java version: ${java.version}</echo>
     177    </target>
     178
     179    <target name="abcl.pre-compile">
     180      <!--- antversion fails in ant 1.7.1 <antversion property="ant.version"
     181                                                atleast="1.7"/> -->
     182      <mkdir dir="${build.dir}"/>
     183      <mkdir dir="${build.classes.dir}"/>
     184
     185      <property name="j.compile.version.path"
     186    value="${build.classes.dir}/org/armedbear/j/version"/>
     187      <exec executable="which"
     188      outputproperty="java.pathname">
     189  <arg value="java"/>
     190      </exec>
     191
     192      <exec executable="hostname" os="unix"
     193      outputproperty="abcl.compile.hostname"/>
     194      <exec executable="uname" os="unix"
     195      outputproperty="abcl.compile.uname">
     196  <arg value="-a"/>
     197      </exec>
     198
     199      <exec executable="hostname" os="Linux" outputproperty="hostname"/>
     200
     201      <condition property="abcl.java.version">
     202  <matches string="${java.version}" pattern="1\.5"/>
     203      </condition>
     204      <echo>java.version: ${java.version}</echo>
     205    </target>
     206   
     207    <target name="abcl.java.warning" unless="abcl.java.version">
     208      <echo>WARNING: Java version ${java.version} not recommended.</echo>
     209    </target>
     210 
     211    <target name="abcl.compile.java"
     212      depends="abcl.pre-compile,abcl.java.warning">
     213      <tstamp>
     214  <format property="build" pattern="EEE MMM dd yyyy HH:mm:ss zzz"/>
     215      </tstamp>
     216
     217      <javac destdir="${build.classes.dir}"
     218       debug="true"
     219       target="1.5">
     220  <src path="${src.dir}"/>
     221  <patternset refid="abcl.source.java"/>
     222      </javac>
     223      <echo message="${build}"
     224      file="${build.classes.dir}/org/armedbear/lisp/build"/>
     225    </target>
     226
     227    <target name="j.compile" depends="abcl.compile">
     228      <javac destdir="${build.classes.dir}"
     229       debug="true"
     230       target="1.5">
     231  <src path="${src.dir}"/>
     232  <patternset refid="j.source"/>
     233      </javac>
     234    </target>
     235
     236    <target name="abcl.copy.lisp">
     237      <copy todir="${build.classes.dir}" preservelastmodified="yes">
     238  <fileset dir="${src.dir}">
     239    <patternset refid="abcl.source.lisp"/>
     240  </fileset>
     241      </copy>
     242    </target>
     243
     244
     245    <!-- Adjust the patternset for ABCL source to use the much faster
     246         Ant 'uptodate' task to check if we need to compile the system
     247         fasls. -->
     248    <patternset id="abcl.source.lisp.fasls">
     249      <patternset refid="abcl.source.lisp"/>
     250      <exclude name="org/armedbear/lisp/tests/*.lisp"/>
     251      <exclude name="org/armedbear/lisp/autoloads.lisp"/>
     252      <exclude name="org/armedbear/lisp/boot.lisp"/>
     253      <exclude name="org/armedbear/lisp/emacs.lisp"/>
     254      <exclude name="org/armedbear/lisp/with-mutex.lisp"/>
     255      <exclude name="org/armedbear/lisp/swank-xcl.lisp"/>
     256      <exclude name="org/armedbear/lisp/swank-sbcl.lisp"/>
     257      <exclude name="org/armedbear/lisp/swank-package.lisp"/>
     258      <exclude name="org/armedbear/lisp/swank-loader.lisp"/>
     259      <exclude name="org/armedbear/lisp/swank-allegro.lisp"/>
     260      <exclude name="org/armedbear/lisp/slime-loader.lisp"/>
     261      <exclude name="org/armedbear/lisp/runtime-class.lisp"/>
     262      <exclude name="org/armedbear/lisp/run-benchmarks.lisp"/>
     263      <exclude name="org/armedbear/lisp/print-object.lisp"/>
     264      <exclude name="org/armedbear/lisp/package.lisp"/>
     265      <exclude name="org/armedbear/lisp/j.lisp"/>
     266    </patternset>
     267
     268    <target name="abcl.fasls.uptodate">
     269      <uptodate property="abcl.fasls.uptodate.p" value="true">
     270  <srcfiles dir="${build.classes.dir}">
     271    <patternset refid="abcl.source.lisp.fasls"/>
     272  </srcfiles>
     273  <mapper type="glob" from="*.lisp" to="*.abcl"/>
     274      </uptodate>
     275    </target>
     276   
     277    <target name="abcl.compile.lisp"
     278      depends="abcl.copy.lisp,abcl.compile.java,abcl.fasls.uptodate"
     279      unless="abcl.fasls.uptodate.p">
     280      <java classpath="${build.classes.dir}"
     281      fork="true"
     282      classname="org.armedbear.lisp.Main">
     283  <arg value="--noinit"/>
     284  <arg value="--eval"/>
     285  <arg value="(compile-system :zip nil :quit t)"/>
     286      </java>
     287    </target>
     288
     289    <target name="abcl.jar" depends="abcl.compile,abcl.stamp">
     290      <loadfile property="abcl.version"
     291      srcFile="${abcl.version.path}"/>
     292      <jar destfile="${abcl.jar.path}"
     293     compress="true"
     294     basedir="${build.classes.dir}">
     295  <patternset refid="abcl.objects"/>
     296  <manifest>
     297    <attribute name="Main-Class" value="org.armedbear.lisp.Main"/>
     298    <section name="org/armedbear/lisp">
     299      <attribute name="Implementation-Title"
     300           value="ABCL"/>
     301      <attribute name="Implementation-Version" 
     302           value="${abcl.version}"/>
     303      <attribute name="Implementation-Build"
     304           value="${build}"/>
     305    </section>
     306  </manifest>
     307      </jar>
     308    </target>
     309   
     310    <target name="abcl.debug.jpda" depends="abcl.jar">
     311      <description>Invoke ABCL with JPDA listener on port 6789</description>
     312      <java fork="true"
     313      classpathref="abcl.classpath.dist"
     314      classname="org.armedbear.lisp.Main">
     315  <jvmarg
     316      value="-agentlib:jdwp=transport=dt_socket,address=6789,server=y"/>
     317      </java>
     318    </target>
     319
     320    <target name="abcl.run" depends="abcl.jar">
     321      <java fork="true"
     322      classpathref="abcl.classpath.dist"
     323      classname="org.armedbear.lisp.Main">
     324      </java>
     325    </target>
     326
     327    <target name="abcl.wrapper"
     328      depends="abcl.jar,abcl.wrapper.unix,abcl.wrapper.windows">
     329      <description>
     330  Creates in-place exectuable shell wrapper in '${abcl.wrapper.file}'
     331      </description>
     332      <!-- Set from commandline or in 'build.properties' -->
     333      <property name="additional.jars" value=""/>
     334      <path id="abcl.runtime.classpath">
     335  <pathelement location="${abcl.jar.path}"/>
     336  <pathelement path="${additional.jars}"/>
     337      </path>
     338   
     339      <copy file="abcl.in" toFile="${abcl.wrapper.file}" overwrite="yes">
     340  <filterset>
     341    <filter token="JAVA"
     342      value="${java.pathname}"/>
     343    <filter token="ABCL_JAVA_OPTIONS"
     344      value= ""/>
     345    <filter token="ABCL_LIBPATH"
     346      value="${basedir}/dist/libabcl.so"/>
     347    <filter token="ABCL_CLASSPATH"
     348      value="${toString:abcl.runtime.classpath}"/>
     349  </filterset>
     350      </copy>
     351      <chmod file="${abcl.wrapper.file}" perm="a+x"/>
     352      <echo>N.B. This wrapper requires '${abcl.jar.path}' not be moved.</echo>
     353    </target>
     354
     355    <target name="abcl.wrapper.unix" if="unix">
     356      <property name="abcl.wrapper.file" value="abcl"/>
     357    </target>
     358
     359    <target name="abcl.wrapper.windows" if="windows">
     360      <property name="abcl.wrapper.file" value="abcl.bat"/>
     361    </target>
     362
     363    <target name="j.jar" depends="j.compile">
     364      <copy todir="${build.classes.dir}">
     365  <fileset dir="${basedir}/src">
     366    <patternset refid="j.objects"/>
     367    <patternset refid="j.resources.src"/>
     368  </fileset>
     369      </copy>
     370      <jar destfile="${j.jar.path}"
     371     compress="true"
     372     basedir="${build.classes.dir}">
     373  <patternset refid="j.objects"/>
     374  <patternset refid="j.resources.src"/>
     375  <manifest>
     376    <attribute name="Main-Class" value="Main"/>
     377    <section name="org/armedbear/lisp">
     378      <attribute name="Implementation-Title" value="ABCL"/>
     379      <attribute name="Implementation-Version"  value="${abcl.version}"/>
     380    </section>
     381  </manifest>
     382      </jar>
     383    </target>
     384
     385    <target name="j.dist" depends="j.jar">
     386      <mkdir dir="${dist.dir}"/>
     387      <copy todir="dist">
     388  <fileset dir="${basedir}">
     389    <patternset refid="j.resources.top"/>
     390  </fileset>
     391      </copy>
     392    </target>
     393
     394    <target name="abcl.clean">
     395      <delete dir="${build.dir}"/>
     396      <delete file="abcl"/>
     397    </target>
     398
     399    <target name="abcl.dist" depends="abcl.jar">
     400      <copy file="${abcl.jar.path}"
     401      toFile="${dist.dir}/abcl-${abcl.version}.jar"/>
     402    </target>
     403
     404    <target name="abcl.distclean" depends="abcl.clean">
     405      <delete dir="${dist.dir}"/>
     406      <delete file="abcl"/>
     407      <delete file="j"/>
     408    </target>
     409
     410    <target name="TAGS">
     411      <apply executable="etags" parallel="true" verbose="true">
     412  <fileset dir="${src.dir}">
     413    <patternset refid="abcl.source.java"/>
     414    <patternset refid="abcl.source.lisp"/>
     415  </fileset>
     416      </apply>
     417    </target>
     418
     419    <target name="j.jpty" depends="j.jpty.compile"/>
     420    <target name="j.jpty.compile">
     421      <exec executable="gcc" dir="${src.dir}/jpty">
     422  <arg line="-Wall -O2 jpty.c -o jpty"/>
     423      </exec>
     424    </target>
     425
     426    <target name="j.install" depends="j.install.unix, j.install.windows"/>
     427
     428    <target name="install.unix" depends="j.jar,j.jpty" if="unix">
     429      <property name="j.install.root" value="/usr/local"/>
     430      <property name="j.install.data.path" value="${j.install.root}/share"/>
     431      <property name="j.install.bin.path" value="${j.install.root}/bin"/>
     432
     433      <mkdir dir="${j.install.data.path}/j"/>
     434      <copy file="${dist}/j.jar" todir="${j.install.data.path}/j"/>
     435      <copy file="j.in" toFile="${j.install.bin.path}/j">
     436  <filterset>
     437    <filter token="ABCL_CLASSPATH"
     438      value="${j.install.data.path}/j/j.jar"/>
     439  </filterset>
     440      </copy>
     441      <chmod file="${j.install.bin.path}/j" perm="ugo+rx"/>
     442
     443      <property name="j.install.themes.path"
     444    value="${j.install.data.path}/j/themes"/>
     445      <mkdir dir="${j.install.themes.path}"/>
     446      <copy todir="{j.install.themes.path}">
     447  <fileset dir="${basedir}/themes"/>
     448      </copy>
     449
     450      <property name="j.install.doc.path"
     451    value="${j.install.data.path}/doc/j"/>
     452      <mkdir dir="${j.install.doc.path}" />
     453
     454      <copy file="${basedir}/jpty/jpty" todir="${bindir}"/>
     455      <chmod file="${bindir}/jpty" perm="ugo+rx"/>
     456      <copy todir="${datadir}/doc/j">
     457  <fileset dir="${topdir}/doc"/>
     458      </copy>
     459    </target>
     460
     461    <!-- Additional files to include in the source distributions relative to basedir -->
     462    <patternset id="abcl.source.misc">
     463      <include name="build.xml"/>
     464      <include name="build.properties.in"/>
     465      <include name="COPYING"/>
     466      <include name="abcl.in"/>
     467      <include name="test-abcl.asd"/>
     468      <include name="build-abcl.asd"/>
     469      <include name="build-abcl.lisp"/>
     470      <include name="customizations.lisp.in"/>
     471    </patternset>
     472
     473    <target name="abcl.source.prepare" depends="abcl.stamp.version">
     474      <property name="abcl.source.eol" value="asis"/>
     475      <echo>Using '${abcl.source.eol}' to drive line-ending transformations.</echo>
     476      <property name="abcl.build.src.dir"
     477    value="${build.dir}/abcl-src-${abcl.version}"/>
     478      <mkdir dir="${abcl.build.src.dir}/src"/>
     479      <fixcrlf srcdir="${src.dir}"
     480         eol="${abcl.source.eol}"
     481         destdir="${abcl.build.src.dir}/src"
     482         preservelastmodified="true">
     483  <patternset refid="abcl.source.java"/>
     484  <patternset refid="abcl.source.lisp"/>
     485      </fixcrlf>
     486      <fixcrlf srcdir="${basedir}"
     487         eol="${abcl.source.eol}"
     488         destdir="${abcl.build.src.dir}"
     489         preservelastmodified="true">
     490  <patternset refid="abcl.source.misc"/>
     491      </fixcrlf>
     492    </target>
     493
     494    <target name="abcl.source.tar" depends="abcl.source.prepare">
     495      <mkdir dir="${dist.dir}"/>
     496      <tar destfile="${dist.dir}/abcl-src-${abcl.version}.tar.gz"
     497     compression="gzip">
     498  <tarfileset dir="${build.dir}">
     499    <include name="abcl-src-${abcl.version}/**"/>
     500  </tarfileset>
     501      </tar>
     502    </target>
     503
     504    <target name="abcl.source.zip" depends="abcl.source.prepare">
     505      <mkdir dir="${dist.dir}"/>
     506      <zip destfile="${dist.dir}/abcl-src-${abcl.version}.zip"
     507     compress="true">
     508  <zipfileset dir="${abcl.build.src.dir}" prefix="abcl-src-${abcl.version}"/>
     509      </zip>
     510    </target>
     511
     512    <import file="netbeans-build.xml" optional="true"/>
     513    <import file="j-build.xml" optional="true"/>
     514    <import file="not.org-build.xml" optional="true"/>
    336515</project>
     516
Note: See TracChangeset for help on using the changeset viewer.