Ignore:
Timestamp:
2014-02-27T15:26:00+01:00 (11 years ago)
Author:
bastik
Message:

plugin build: add another fallback when plugin is not under version control (set revision as UNKNOWN)

File:
1 edited

Legend:

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

    r30306 r30309  
    203203    -->
    204204    <target name="init-git-revision-xml" if="git.svn.fail">
    205         <exec append="false" output="REVISION.XML" executable="git" failifexecutionfails="false">
     205        <exec append="false" output="REVISION.XML" executable="git" failifexecutionfails="false" resultproperty="git.info.result">
    206206            <arg value="log"/>
    207207            <arg value="-1"/>
     
    212212                       match="\s*(\d*)\s+(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
    213213                       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;"/>
    214     </target>
    215     <target name="revision" depends="init-svn-revision-xml, init-git-svn-revision-xml, init-git-revision-xml">
     214       <condition property="git.fail">
     215           <not>
     216               <and>
     217                   <equals arg1="${git.info.result}" arg2="0" />
     218                   <length file="REVISION.XML" when="greater" length="1" />
     219               </and>
     220           </not>
     221       </condition>
     222    </target>
     223    <target name="init-revision-fallback" if="git.fail">
     224        <tstamp>
     225            <format property="current.time" pattern="yyyy-MM-dd'T'HH:mm:ss.SSS" />
     226        </tstamp>
     227        <echo file="REVISION.XML"><![CDATA[<info><entry><commit revision="UNKNOWN"><date>${current.time}</date></commit></entry></info>]]></echo>
     228    </target>
     229    <target name="revision" depends="init-svn-revision-xml, init-git-svn-revision-xml, init-git-revision-xml, init-revision-fallback">
    216230      <xmlproperty file="REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
    217231      <delete file="REVISION.XML"/>
Note: See TracChangeset for help on using the changeset viewer.