Merge pull request #108 from kemitix/update-set-version

Update set-version to better detect current version
This commit is contained in:
Paul Campbell 2018-02-28 18:40:48 +00:00 committed by GitHub
commit 372ee88400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,15 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cd `dirname $0`
PROJECT=`basename $PWD`
if test $# != 1 if test $# != 1
then then
echo "next version missing" echo "next version missing"
exit exit
fi fi
CURRENT=`grep '<version>' pom.xml |head -n 1| sed 's/.*>\(.*\)<.*/\1/'` CURRENT=`grep -C 2 "<artifactId>${PROJECT}</artifactId>" pom.xml | grep '<version>' | sed 's/.*>\(.*\)<.*/\1/'`
NEXT=$1 NEXT=$1
echo Updating version from $CURRENT to $NEXT echo Updating version from $CURRENT to $NEXT
./mvnw versions:set -DnewVersion=$NEXT ./mvnw versions:set -DnewVersion=$NEXT
perl -p -i -e "s,$CURRENT</,$NEXT</," README.md ./mvnw -pl parent versions:set -DnewVersion=$NEXT
perl -p -i -e "s,$CURRENT</,$NEXT</," all/tile.xml README.md