-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathset_versions.sh
executable file
·31 lines (28 loc) · 1.02 KB
/
set_versions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# Define versions
if [ -z "${1}" ] ; then
NEW_VERSION=1.48.0
else
NEW_VERSION=$1
fi
VF="VERSION"
# set versions in parent pom and in all childs
echo "New version is: $NEW_VERSION"
echo $NEW_VERSION > $VF
echo "Changing Maven's POM files"
./mvnw versions:set -DnewVersion=${NEW_VERSION}
cd apl-bom || exit
./mvnw versions:set -DnewVersion=${NEW_VERSION}
cd ..
# TODO: Prettify this block.
# set verions in Constants.java (application hardcoded version)
CONST_PATH=apl-utils/src/main/java/com/apollocurrency/aplwallet/apl/util/Constants.java
echo "Changing Constants in $CONST_PATH"
VER_STR="VERSION"
sed -i -e "s/\ VERSION.*/ VERSION = new Version\(\"$NEW_VERSION\"\);/g" ${CONST_PATH}
PKG_PATH=apl-exec/packaging/pkg-apollo-blockchain.json
echo "Changing pkg-apollo-blockchain.json"
sed -i -e "s/\ \"version\".*/ \"version\": \"$NEW_VERSION\",/g" ${PKG_PATH}
README_PATH=README.md
echo "Changing README.md..."
sed -i -E "s/___apollo-blockchain-[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}/___apollo-blockchain-$NEW_VERSION/g" ${README_PATH}