Skip to content

Commit 93cab37

Browse files
committed
build: synchronize version bump across all Maven modules
1 parent c7001e2 commit 93cab37

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

scripts/bump.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,40 @@ TYPE=${1:-patch} # patch|minor|major
55

66
# ---- functions ----
77
mvn_get_version() {
8-
./mvnw -q help:evaluate -Dexpression=project.version -DforceStdout 2>/dev/null | tr -d '\r'
8+
./mvnw -q help:evaluate \
9+
-Dexpression=project.version \
10+
-DforceStdout
911
}
1012

1113
mvn_set_version() {
1214
MAVEN_OPTS="--enable-native-access=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED" \
13-
./mvnw -q -ntp -B versions:set \
15+
./mvnw -q -B -ntp versions:set \
1416
-DnewVersion="$1" \
15-
-DgenerateBackupPoms=false \
1617
-DprocessAllModules=true \
17-
1>/dev/null 2>/dev/null
18+
-DgenerateBackupPoms=false
1819
}
1920

2021
# ---- logic ----
2122
CURRENT="$(mvn_get_version)"
2223
BASE="${CURRENT/-SNAPSHOT/}"
24+
2325
IFS='.' read -r MAJOR MINOR PATCH <<< "$BASE"
2426

2527
case "$TYPE" in
26-
major) MAJOR=$((MAJOR+1)); MINOR=0; PATCH=0 ;;
27-
minor) MINOR=$((MINOR+1)); PATCH=0 ;;
28-
patch) PATCH=$((PATCH+1)) ;;
29-
*) echo "❌ Unknown bump type: $TYPE (use patch|minor|major)"; exit 1 ;;
28+
major) ((MAJOR++)); MINOR=0; PATCH=0 ;;
29+
minor) ((MINOR++)); PATCH=0 ;;
30+
patch) ((PATCH++)) ;;
31+
*)
32+
echo "❌ Unknown bump type: $TYPE (use patch|minor|major)"
33+
exit 1
34+
;;
3035
esac
3136

3237
NEXT="$MAJOR.$MINOR.$PATCH-SNAPSHOT"
38+
3339
mvn_set_version "$NEXT"
3440

35-
git add pom.xml */pom.xml >/dev/null 2>&1 || true
36-
git commit -m "Bump version: $CURRENT$NEXT" >/dev/null 2>&1 || true
41+
git add pom.xml **/pom.xml || true
42+
git commit -m "Bump version: $CURRENT$NEXT" || true
3743

3844
echo "✅ Bumped version: $CURRENT$NEXT"

0 commit comments

Comments
 (0)