Changeset 16341 in josm


Ignore:
Timestamp:
2020-04-18T18:41:15+02:00 (4 years ago)
Author:
simon04
Message:

see #19117 - ant create-revision: detect SVN/Git based on dir

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r16243 r16341  
    4848            </or>
    4949        </condition>
     50        <available property="svn.present" file="${base.dir}/.svn"/>
     51        <available property="git.present" file="${base.dir}/.git"/>
    5052        <property name="build.dir" location="${base.dir}/build"/>
    5153        <property name="dist.dir" location="${base.dir}/dist"/>
     
    126128      ** Initializes the REVISION.XML file from SVN information
    127129    -->
    128     <target name="init-svn-revision-xml" depends="init-properties">
    129         <exec append="false" output="${base.dir}/REVISION.XML" executable="svn" dir="${base.dir}" failifexecutionfails="false" resultproperty="svn.info.result">
     130    <target name="init-svn-revision-xml" if="svn.present" depends="init-properties">
     131        <exec append="false" output="${base.dir}/REVISION.XML" executable="svn" dir="${base.dir}" resultproperty="svn.info.result">
    130132            <env key="LANG" value="C"/>
    131133            <arg value="info"/>
     
    133135            <arg value="."/>
    134136        </exec>
    135         <condition property="svn.info.success">
    136             <equals arg1="${svn.info.result}" arg2="0" />
    137         </condition>
    138137    </target>
    139138    <!--
    140139      ** Initializes the REVISION.XML file from git information
    141140    -->
    142     <target name="init-git-revision-xml" unless="svn.info.success" depends="init-properties">
    143         <exec append="false" output="${base.dir}/REVISION.XML" executable="git" dir="${base.dir}" failifexecutionfails="false">
     141    <target name="init-git-revision-xml" if="git.present" depends="init-properties">
     142        <exec append="false" output="${base.dir}/REVISION.XML" executable="git" dir="${base.dir}">
    144143            <arg value="log"/>
    145144            <arg value="-1"/>
Note: See TracChangeset for help on using the changeset viewer.