diff options
author | Florian Zschocke <f.zschocke+git@gmail.com> | 2022-01-13 18:19:14 +0100 |
---|---|---|
committer | Florian Zschocke <f.zschocke+git@gmail.com> | 2022-02-01 22:58:30 +0100 |
commit | 12854a585bd373690c2a470c62c74dcf3263baa7 (patch) | |
tree | 417da4479e431f20357d0fd336e74a113085a201 | |
parent | 5ba51f4f48a5307ac4bc5435ecabfb4919b47c45 (diff) | |
download | gitblit-12854a585bd373690c2a470c62c74dcf3263baa7.tar.gz gitblit-12854a585bd373690c2a470c62c74dcf3263baa7.zip |
build: Determine release version with simple grep
To determine what the release version is to be, use a simple grep over
the moxie.build file and cut off the `-SNAPSHOT` part. The moxie
tag command doesn't do anything else, either. But the problem is that
when using the moxie tag command on the release branch, where the
version has already been set to a release version, it would create
a second release version, like so: 1.9.2-1.
-rw-r--r-- | build.xml | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -873,10 +873,13 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<target name="determineReleaseVersion" depends="prepare" description="determine the release version and tag name">
- <!-- release -->
- <property name="dryrun" value="true" />
- <mx:version stage="release" dryrun="${dryrun}" />
- <property name="project.tag" value="v${project.version}" />
+ <exec executable="bash" logError="true" outputproperty="determined_release.version">
+ <arg value="-c" />
+ <arg value="grep '^version:' build.moxie | sed -e 's/version: *//' -e 's/-SNAPSHOT//'"></arg>
+ </exec>
+ <property name="determined_release.tag" value="v${determined_release.version}" />
+ <echo>Release version: ${determined_release.version}</echo>
+ <echo>Release tag: ${determined_release.tag}</echo>
<!-- output version information for other scripts/programs to pick up -->
<mx:if>
@@ -886,8 +889,8 @@ </and>
<then>
<echo file="${basedir}/${versionInfo}">
-GBLT_RELEASE_VERSION=${project.version}
-GBLT_RELEASE_TAG=${project.tag}
+GBLT_RELEASE_VERSION=${determined_release.version}
+GBLT_RELEASE_TAG=${determined_release.tag}
</echo>
</then>
</mx:if>
|