forked from scala-ide/scala-ide
-
Notifications
You must be signed in to change notification settings - Fork 1
/
set-versions.sh
executable file
·60 lines (43 loc) · 1.38 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
function usage() {
cat <<EOF
usage:
set-versions.sh <version>
Delegate to the maven-tycho-plugin to set version of all subprojects. It maintains the POM and
MANIFEST version numbers in sync. This script runs maven on each parent project.
Note:
Use only numeric versions (do not specify -SNAPSHOT at the end, it is added by this script).
Example:
set-versions.sh 3.0.3
This sets the pom version to 3.0.3-SNAPSHOT and the Bundle-Version to 3.0.3.qualifier
EOF
exit 1
}
# $1 - version number to validate
function validate() {
if [[ ! $1 =~ [0-9]+\.[0-9]+\.[0-9]+$ ]];
then
echo "Invalid version: $1. Versions should have 3 numeric components (i.e. 1.0.1) with no qualifier or suffix."
exit 1
fi
}
if [ $# -ne 1 ]; then
usage
fi
function setVersion() {
mvn -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$1-SNAPSHOT
}
validate $1
echo "Setting version to $1"
setVersion $1
(cd org.scala-ide.build-toolchain && setVersion $1)
(cd org.scala-ide.sdt.build && setVersion $1)
(cd org.scala-ide.p2-toolchain && setVersion $1)
cat <<EOF
!!!!
!!!! Don't forget to manually update versions in:
!!!! <parent> tag in org.scala-ide.sdt.build, build-toolchain and p2-toolchain
!!!! org.scala-ide.sdt.feature/resources/*.xml
!!!! org.scala-ide.sdt.source.feature/resources/*.xml
!!!!
EOF