summaryrefslogtreecommitdiffstats
path: root/changeVersion.sh
blob: 144ca5391f841570cd5fbca3cdc392d10da98309 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/bash

if [ $# -ne 1 ]
then
	echo "Usage: $0 new-version"
	exit 1
fi


mvn versions:set versions:update-child-modules versions:commit -B -DnewVersion=$1

base_version=$(echo $1 | cut -d- -f1)
major=$(echo $base_version | cut -d. -f1)
minor=$(echo $base_version | cut -d. -f2)
patch=$(echo $base_version | cut -d. -f3)

if [ -f version.properties ]
then
    sed -i ''  -e 's/\(release_name=\).*/\1'$major'/;s/\(sprint_number=\).*/\1'$minor'/;s/\(feature_revision=\).*/\1'$patch'/'  version.properties
fi