Changeset 6545 in josm for trunk/build.xml


Ignore:
Timestamp:
2013-12-27T14:02:14+01:00 (5 years ago)
Author:
simon04
Message:

see #9450 - JOSM build from a git mirror: remove need for perl script, automatically obtain revision from Git if SVN fails (removes need for git_revision=true)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r6540 r6545  
    3939      ** Initializes the REVISION.XML file from SVN information
    4040    -->
    41     <target name="init-svn-revision-xml" unless="git_revision">
    42         <exec append="false" output="REVISION.XML" executable="svn" failifexecutionfails="false">
     41    <target name="init-svn-revision-xml">
     42        <exec append="false" output="REVISION.XML" executable="svn" failifexecutionfails="false" errorproperty="svn.info.failed">
    4343            <env key="LANG" value="C"/>
    4444            <arg value="info"/>
     
    5050      ** Initializes the REVISION.XML file from git information
    5151    -->
    52     <target name="init-git-revision-xml" if="git_revision">
    53         <exec append="false" output="REVISION.TMP" executable="git" failifexecutionfails="false">
     52    <target name="init-git-revision-xml" if="svn.info.failed">
     53        <exec append="false" output="REVISION.XML" executable="git" failifexecutionfails="false">
    5454            <arg value="log"/>
    5555            <arg value="-1"/>
    5656            <arg value="--grep=git-svn-id"/>
    57             <arg value="--pretty=format:%ai%n%B"/>
     57            <!--
     58            %B:  raw body (unwrapped subject and body)
     59            %n:  new line
     60            %ai: author date, ISO 8601 format
     61            -->
     62            <arg value="--pretty=format:%B%n%ai"/>
    5863            <arg value="HEAD"/>
    5964        </exec>
    60         <exec append="false" input="REVISION.TMP" output="REVISION.XML" executable="perl" failifexecutionfails="false">
    61             <arg value="tools/gitcommit2xml.pl"/>
    62         </exec>
    63         <delete file="REVISION.TMP"/>
     65        <replaceregexp file="REVISION.XML" flags="s"
     66                       match=".*git-svn-id: [^@]*@([0-9]+).*(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
     67                       replace="&lt;info&gt;&lt;entry&gt;&lt;commit revision=&quot;\1&quot;&gt;&lt;date&gt;\2&lt;/date&gt;&lt;/commit&gt;&lt;/entry&gt;&lt;/info&gt;"/>
    6468    </target>
    6569    <!--
Note: See TracChangeset for help on using the changeset viewer.