write git revision number to yacyBuild.properties

pull/533/head
Michael Peter Christen 2 years ago
parent 90db21b909
commit ede9efe50c

@ -90,8 +90,26 @@
<property name="target-resolve-already-run" value="true" /> <property name="target-resolve-already-run" value="true" />
</target> </target>
<!-- find git version and write it to git.revision -->
<available file=".git" type="dir" property="git.present"/>
<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="--abbrev=7"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
</target>
<!-- initializing all needed variables --> <!-- initializing all needed variables -->
<target name="init"> <target name="init" depends="git.revision">
<loadproperties srcFile="build.properties" /> <loadproperties srcFile="build.properties" />
<property name="stdReleaseFile" value="yacy_v${releaseVersion}_${releaseNr}.tar.gz"/> <property name="stdReleaseFile" value="yacy_v${releaseVersion}_${releaseNr}.tar.gz"/>
@ -102,10 +120,14 @@
<echo message="YaCy Version number: ${releaseVersion}" /> <echo message="YaCy Version number: ${releaseVersion}" />
<filter token="REPL_VERSION" value="${releaseVersion}" /> <filter token="REPL_VERSION" value="${releaseVersion}" />
<!-- YaCy Release <revision number --> <!-- YaCy Release revision number -->
<echo message="YaCy Release number: ${releaseNr}" /> <echo message="YaCy Release number: ${releaseNr}" />
<filter token="REPL_REVISION_NR" value="${releaseNr}"/> <filter token="REPL_REVISION_NR" value="${releaseNr}"/>
<!-- GIT Release revision number -->
<echo message="GIT Release Tag: ${repository.version}" />
<filter token="REPL_REPVER" value="${repository.version}"/>
<!-- apply replacments --> <!-- apply replacments -->
<copy file="${defaults}/yacyBuild.properties.template" tofile="${defaults}/yacyBuild.properties" overwrite="true" filtering="true" /> <copy file="${defaults}/yacyBuild.properties.template" tofile="${defaults}/yacyBuild.properties" overwrite="true" filtering="true" />

@ -1,3 +1,3 @@
SVNRevision = @REPL_REVISION_NR@ SVNRevision = @REPL_REVISION_NR@
Version = @REPL_VERSION@ Version = @REPL_VERSION@
RepositoryVersion = @REPL_REPVER@
Loading…
Cancel
Save