From 3d6aab783bec40aea122d4712f32d354b958899f Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 20 May 2017 22:21:55 +0200 Subject: [PATCH] Adjust do-release.sh script --- do-release.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/do-release.sh b/do-release.sh index 4bafa0c632..33e1b9c530 100755 --- a/do-release.sh +++ b/do-release.sh @@ -21,11 +21,13 @@ echo "Releasing PMD" echo "-------------------------------------------" # see also https://gist.github.com/pdunnavant/4743895 -CURRENT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec) +CURRENT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec|tail -1) RELEASE_VERSION=${CURRENT_VERSION%-SNAPSHOT} -CURRENT_BUILD_NUMBER=$(echo ${RELEASE_VERSION} | sed -e 's/[0-9]*\.//g') -NEXT_BUILD_NUMBER=$(expr ${CURRENT_BUILD_NUMBER} + 1) -DEVELOPMENT_VERSION=$(echo ${RELEASE_VERSION} | sed -e "s/[0-9][0-9]*\([^0-9]*\)$/${NEXT_BUILD_NUMBER}/") +MAJOR=$(echo $RELEASE_VERSION | cut -d . -f 1) +MINOR=$(echo $RELEASE_VERSION | cut -d . -f 2) +PATCH=$(echo $RELEASE_VERSION | cut -d . -f 3) +NEXT_MINOR=$(expr ${MINOR} + 1) +DEVELOPMENT_VERSION="$MAJOR.$NEXT_MINOR.0" DEVELOPMENT_VERSION="${DEVELOPMENT_VERSION}-SNAPSHOT" # http://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch