Changeset 6540 in josm for trunk/build.xml


Ignore:
Timestamp:
2013-12-26T23:16:15+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #9450 - Allow to build JOSM from a git mirror clone with ant -Dgit_revision=true

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r6446 r6540  
    3737    </target>
    3838    <!--
    39       ** Creates the REVISION file to be included in the distribution
    40     -->
    41     <target name="create-revision">
    42         <property name="revision.dir" value="${build.dir}"/>
     39      ** Initializes the REVISION.XML file from SVN information
     40    -->
     41    <target name="init-svn-revision-xml" unless="git_revision">
    4342        <exec append="false" output="REVISION.XML" executable="svn" failifexecutionfails="false">
    4443            <env key="LANG" value="C"/>
     
    4746            <arg value="."/>
    4847        </exec>
     48    </target>
     49    <!--
     50      ** Initializes the REVISION.XML file from git information
     51    -->
     52    <target name="init-git-revision-xml" if="git_revision">
     53        <exec append="false" output="REVISION.TMP" executable="git" failifexecutionfails="false">
     54            <arg value="log"/>
     55            <arg value="-1"/>
     56            <arg value="--grep=git-svn-id"/>
     57            <arg value="--pretty=format:%ai%n%B"/>
     58            <arg value="HEAD"/>
     59        </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"/>
     64    </target>
     65    <!--
     66      ** Creates the REVISION file to be included in the distribution
     67    -->
     68    <target name="create-revision" depends="init-svn-revision-xml, init-git-revision-xml">
     69        <property name="revision.dir" value="${build.dir}"/>
    4970        <xmlproperty file="REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
    5071        <delete file="REVISION.XML"/>
     
    5374        </tstamp>
    5475        <property name="version.entry.commit.revision" value="UNKNOWN"/>
     76        <property name="version.entry.commit.date" value="UNKNOWN"/>
    5577        <mkdir dir="${revision.dir}"/>
    5678        <!-- add Build-Name: ... when making special builds, e.g. DEBIAN -->
     
    6284</echo>
    6385    </target>
     86    <!--
     87      ** Check internal XML files against their XSD
     88    -->
    6489    <target name="check-schemas">
    6590        <schemavalidate file="data/defaultpresets.xml" >
     
    7095        </schemavalidate>
    7196    </target>
     97    <!--
     98      ** Main target that builds JOSM and checks XML against schemas
     99    -->
    72100    <target name="dist" depends="compile,create-revision,check-schemas">
    73         <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
    74             <env key="LANG" value="C"/>
    75             <arg value="info"/>
    76             <arg value="--xml"/>
    77             <arg value="."/>
    78         </exec>
    79         <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
    80         <delete file="REVISION"/>
    81         <property name="version.entry.commit.revision" value="UNKNOWN"/>
    82         <property name="version.entry.commit.date" value="UNKNOWN"/>
    83101        <echo>Revision ${version.entry.commit.revision}</echo>
    84102        <copy file="CONTRIBUTION" todir="build"/>
Note: See TracChangeset for help on using the changeset viewer.