Skip to content

Commit 12854a5

Browse files
committed
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.
1 parent 5ba51f4 commit 12854a5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

build.xml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -873,10 +873,13 @@
873873
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
874874
-->
875875
<target name="determineReleaseVersion" depends="prepare" description="determine the release version and tag name">
876-
<!-- release -->
877-
<property name="dryrun" value="true" />
878-
<mx:version stage="release" dryrun="${dryrun}" />
879-
<property name="project.tag" value="v${project.version}" />
876+
<exec executable="bash" logError="true" outputproperty="determined_release.version">
877+
<arg value="-c" />
878+
<arg value="grep '^version:' build.moxie | sed -e 's/version: *//' -e 's/-SNAPSHOT//'"></arg>
879+
</exec>
880+
<property name="determined_release.tag" value="v${determined_release.version}" />
881+
<echo>Release version: ${determined_release.version}</echo>
882+
<echo>Release tag: ${determined_release.tag}</echo>
880883

881884
<!-- output version information for other scripts/programs to pick up -->
882885
<mx:if>
@@ -886,8 +889,8 @@
886889
</and>
887890
<then>
888891
<echo file="${basedir}/${versionInfo}">
889-
GBLT_RELEASE_VERSION=${project.version}
890-
GBLT_RELEASE_TAG=${project.tag}
892+
GBLT_RELEASE_VERSION=${determined_release.version}
893+
GBLT_RELEASE_TAG=${determined_release.tag}
891894
</echo>
892895
</then>
893896
</mx:if>

0 commit comments

Comments
 (0)