Changeset 13197 for trunk/abcl/build.xml


Ignore:
Timestamp:
01/30/11 22:26:43 (11 years ago)
Author:
Mark Evenson
Message:

Incorporate output of 'svnversion' into LISP-IMPLEMENTATION-VERSION.

In the Ant-based build, if the executable 'svnversion' can be found on
the PATH and the topmost '.svn' subdirectory exists, the output of
'svnversion' is appended to the value returned by
LISP-IMPLEMENTATION-VERSION.

The use of 'version.src' in 'abcl.properties' has been removed.

TODO: the same functionality should be added to the Lisp-based build.

TODO: test that this works on Windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/build.xml

    r13029 r13197  
    8686      <include name="org/armedbear/lisp/**/*.cls"/>
    8787      <include name="org/armedbear/lisp/**/*.abcl"/>
     88      <include name="org/armedbear/lisp/version"/>
    8889      <include name="org/armedbear/lisp/scripting/*.class" if="abcl.jsr-223.p"/>
    8990      <include name="org/armedbear/lisp/scripting/util/*.class" if="abcl.jsr-223.p"/>
     
    147148  </or> 
    148149      </condition>
    149 
    150       <!-- Set from commandline via -D or in 'build.properties' -->
    151       <property name="build.version" value="abcl.svn"/>
    152       <echo>Implementation-Source: ${version.src}</echo>
    153150
    154151    </target>
     
    259256    <property name="abcl.build.path"
    260257        value="${build.classes.dir}/org/armedbear/lisp/build"/>
    261     <target name="abcl.stamp" depends="abcl.compile,abcl.stamp.version,abcl.stamp.hostname">
     258    <target name="abcl.stamp"
     259            depends="abcl.compile,abcl.stamp.version,abcl.stamp.hostname">
    262260      <mkdir dir="${abcl.build.path}/.."/>
    263261      <echo message="${build}" file="${abcl.build.path}"/>   
     262    </target>
     263
     264
     265    <!-- Environment variables may be accessed as ${env.NAME} -->
     266    <property environment="env"/>
     267
     268    <!-- Can we derive an SVN version from the current build tree? -->
     269    <condition property="abcl.version.svn.p">
     270      <and>
     271        <available
     272            file="${basedir}/.svn"
     273            type="dir"/>
     274        <available
     275            file="svnversion"
     276            filepath="${env.PATH}"/>
     277      </and>
     278    </condition>
     279
     280    <target name="abcl.version.src" depends="abcl.version.src.3"/>
     281
     282    <target name="abcl.version.src.1">
     283      <exec
     284          executable="svnversion"
     285          outputproperty="abcl.version.svn"
     286          failifexecutionfails="false" />
     287    </target>
     288
     289    <target name="abcl.version.src.2"
     290            depends="abcl.version.src.1"
     291            if="abcl.version.svn.p">
     292      <echo>abcl.version.svn: ${abcl.version.svn}</echo>
     293      <property name="abcl.version.src"
     294                value="svn-${abcl.version.svn}"/>
     295    </target>
     296
     297    <target name="abcl.version.src.3"
     298            depends="abcl.version.src.2"
     299            unless="abcl.version.svn.p">
     300      <property name="abcl.version.src"
     301                value=""/>
    264302    </target>
    265303
     
    268306    <property name="abcl.version.path"
    269307        value="${build.classes.dir}/org/armedbear/lisp/version"/>
    270     <target name="abcl.stamp.version" depends="abcl.compile.java"  >
     308
     309    <target name="abcl.stamp.version"
     310            depends="abcl.version.src,abcl.stamp.version.1,abcl.stamp.version.2">
     311      <mkdir dir="${abcl.version.path}/.."/>
     312      <echo>ABCL implementation version: ${abcl.implementation.version}</echo>
     313      <echo file="${abcl.version.path}">${abcl.implementation.version}</echo>
     314    </target>
     315   
     316    <target name="abcl.stamp.version.0"
     317            depends="abcl.compile.java">
    271318      <java fork="true"
    272319      classpath="${build.classes.dir}"
     
    274321      classname="org.armedbear.lisp.Version"
    275322            logerror="yes"/> <!-- Don't catch stderr output -->
    276 
    277       <echo>ABCL version: ${abcl.version}</echo>
    278       <mkdir dir="${abcl.version.path}/.."/>
    279       <echo message="${abcl.version}" file="${abcl.version.path}"/>
     323    </target>
     324
     325    <target name="abcl.stamp.version.1"
     326            depends="abcl.stamp.version.0"
     327            unless="abcl.version.svn.p">
     328      <property name="abcl.implementation.version"
     329                value="${abcl.version}"/>
     330    </target>
     331
     332    <target name="abcl.stamp.version.2"
     333            depends="abcl.stamp.version.0"
     334            if="abcl.version.svn.p">
     335      <property name="abcl.implementation.version"
     336                value="${abcl.version}-${abcl.version.src}"/>
    280337    </target>
    281338
     
    325382           value="ABCL"/>
    326383      <attribute name="Implementation-Version" 
    327            value="${abcl.version}"/>
     384           value="${abcl.implementation.version}"/>
    328385      <attribute name="Implementation-Build"
    329386           value="${build}"/>
    330       <attribute name="Implementation-Source"
    331            value="${version.src}"/>
    332387    </section>
    333388  </manifest>
Note: See TracChangeset for help on using the changeset viewer.