-
Notifications
You must be signed in to change notification settings - Fork 3
/
setversion.sh
executable file
·43 lines (35 loc) · 1.09 KB
/
setversion.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
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# go to maven directory
cd java
# current version
CURRENT_VERSION=$(mvn -q \
-Dexec.executable=echo \
-Dexec.args='${project.version}' \
--non-recursive \
exec:exec)
# current version without snapshot
CURRENT_VERSION_NONSNAPSHOT=${CURRENT_VERSION/-SNAPSHOT/}
echo "Current version $CURRENT_VERSION_NONSNAPSHOT"
# update maven version
mvn versions:set -q -DgenerateBackupPoms=false
# updated version
UPDATED_VERSION=$(mvn -q \
-Dexec.executable=echo \
-Dexec.args='${project.version}' \
--non-recursive \
exec:exec)
# version without snaphot
UPDATED_VERSION_NONSNAPSHOT=${UPDATED_VERSION/-SNAPSHOT/}
echo "Updated version $UPDATED_VERSION_NONSNAPSHOT"
# update windows build script
sed -i "s/$CURRENT_VERSION_NONSNAPSHOT/$UPDATED_VERSION_NONSNAPSHOT/" amapvox.main/build_app_windows.bat
cd ..
# update DESCRIPTION file
sed -i "s/$CURRENT_VERSION_NONSNAPSHOT/$UPDATED_VERSION_NONSNAPSHOT/" DESCRIPTION
# update NEWS.md
RELEASE="# AMAPVox $UPDATED_VERSION_NONSNAPSHOT
*yyyy-MM-dd*
Released/Not release on CRAN
"
echo "$(echo -n "$RELEASE"; cat NEWS.md)" > NEWS.md
# EOF