Ignore:
Timestamp:
2014-01-01T14:17:09+01:00 (11 years ago)
Author:
simon04
Message:

JOSM: allow plugins to be built from a Git mirror - see #josm9450

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/build-common.xml

    r29694 r30161  
    155155    **********************************************************
    156156    -->
    157     <target name="revision">
    158         <exec append="false" outputproperty="svn.revision.output" executable="svn" failifexecutionfails="false">
     157    <!--
     158      ** Initializes the REVISION.XML file from SVN information
     159    -->
     160    <target name="init-svn-revision-xml">
     161        <exec append="false" output="REVISION.XML" executable="svn" failifexecutionfails="false" resultproperty="svn.info.result">
    159162            <env key="LANG" value="C"/>
    160163            <arg value="info"/>
     
    162165            <arg value="."/>
    163166        </exec>
    164         <xmlproperty prefix="version" keepRoot="false" collapseAttributes="true">
    165             <propertyresource name="svn.revision.output"/>
    166         </xmlproperty>
     167        <condition property="svn.info.success">
     168            <equals arg1="${svn.info.result}" arg2="0" />
     169        </condition>
     170    </target>
     171    <!--
     172      ** Initializes the REVISION.XML file from git information
     173    -->
     174    <target name="init-git-revision-xml" unless="svn.info.success">
     175        <exec append="false" output="REVISION.XML" executable="git" failifexecutionfails="false">
     176            <arg value="log"/>
     177            <arg value="-1"/>
     178            <arg value="--grep=git-svn-id"/>
     179            <!--
     180            %B:  raw body (unwrapped subject and body)
     181            %n:  new line
     182            %ai: author date, ISO 8601 format
     183            -->
     184            <arg value="--pretty=format:%B%n%ai"/>
     185            <arg value="HEAD"/>
     186        </exec>
     187        <replaceregexp file="REVISION.XML" flags="s"
     188                       match=".*git-svn-id: [^@]*@([0-9]+).*(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
     189                       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;"/>
     190    </target>
     191    <target name="revision" depends="init-svn-revision-xml, init-git-revision-xml">
     192      <xmlproperty file="REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
     193      <delete file="REVISION.XML"/>
    167194    </target>
    168195    <!--
Note: See TracChangeset for help on using the changeset viewer.