mirror of https://github.com/apache/lucene.git
LUCENE-6938: Improve output of Git Hash if no GIT available or no GIT checkout (this restores previous behaviour)
This commit is contained in:
parent
7f41c65ae9
commit
b18d2b3330
|
@ -608,13 +608,22 @@
|
|||
<attribute name="manifest.file" default="${manifest.file}"/>
|
||||
<element name="additional-manifest-attributes" optional="true"/>
|
||||
<sequential>
|
||||
<exec dir="." executable="${git.exe}" outputproperty="checkoutid" failifexecutionfails="false">
|
||||
<local name="-checkoutid"/>
|
||||
<local name="-giterr"/>
|
||||
<local name="checkoutid"/>
|
||||
|
||||
<!-- If possible, include the GIT hash into manifest: -->
|
||||
<exec dir="." executable="${git.exe}" outputproperty="-checkoutid" errorproperty="-giterr" failifexecutionfails="false">
|
||||
<arg value="log"/>
|
||||
<arg value="--format='%H'"/>
|
||||
<arg value="--format=%H"/>
|
||||
<arg value="-n"/>
|
||||
<arg value="1"/>
|
||||
</exec>
|
||||
<condition property="checkoutid" value="${-checkoutid}" else="unknown">
|
||||
<matches pattern="^[0-9a-z]+$" string="${-checkoutid}" casesensitive="false" multiline="true"/>
|
||||
</condition>
|
||||
|
||||
<!-- create manifest: -->
|
||||
<manifest file="@{manifest.file}">
|
||||
<!--
|
||||
http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest
|
||||
|
|
Loading…
Reference in New Issue