Skip to content

Commit 2bb2db1

Browse files
committed
make optional flag as optional depending on starter
1 parent 6dbf7fb commit 2bb2db1

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

scripts/pit/lib/lib-patch-v25.sh

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,14 @@ applyv25patches() {
55
[ -d src/main ] && D=src/main || D=*/src/main
66
F=$D/frontend
77

8-
case $vers_ in
9-
*alpha7|*alpha8|*alpha9) SV=4.0.0-M1 ;;
10-
*alpha10|*alpha11) SV=4.0.0-M2 ;;
11-
*alpha12|*beta1|*beta2|*beta3) SV=4.0.0-M3 ;;
12-
*beta4) SV=4.0.0-RC1 ;;
13-
*beta*)
14-
SV=4.0.0-RC2
15-
## TODO: document in migration guide to 25
16-
addHillaStarterIfNeeded $app_
17-
## TODO: document in migration guide to 25 (bakery, mpr-demo, k8s-demo, start)
18-
replaceVaadinSpringWithStarter
19-
## TODO: document in migration guide to 25
20-
addDevModeIfNeeded
21-
;;
22-
esac
238
changeMavenBlock parent org.springframework.boot spring-boot-starter-parent $SV
249
setVersionInGradle "org.springframework.boot" $SV
2510

2611
addAnonymousAllowedToAppLayout
2712
updateAppLayoutAfterNavigation
2813
updateSpringBootApplication
2914
updateGradleWrapper
15+
_opt="<optional>true</optional>"
3016
case $app_ in
3117
business-app-starter-flow)
3218
## TODO: Update all starters where applicable
@@ -37,6 +23,7 @@ applyv25patches() {
3723
skeleton-starter-flow-cdi)
3824
## TODO: needs to be documented in release notes, but also in migration guide to 25
3925
patchJaxrs $app_
26+
_opt=""
4027
;;
4128
testbench-demo)
4229
## TODO: changes are already in v25, make it main branch when 25.0 GA
@@ -76,6 +63,22 @@ applyv25patches() {
7663
;;
7764
esac
7865

66+
case $vers_ in
67+
*alpha7|*alpha8|*alpha9) SV=4.0.0-M1 ;;
68+
*alpha10|*alpha11) SV=4.0.0-M2 ;;
69+
*alpha12|*beta1|*beta2|*beta3) SV=4.0.0-M3 ;;
70+
*beta4) SV=4.0.0-RC1 ;;
71+
*beta*)
72+
SV=4.0.0-RC2
73+
## TODO: document in migration guide to 25
74+
addHillaStarterIfNeeded $app_
75+
## TODO: document in migration guide to 25 (bakery, mpr-demo, k8s-demo, start)
76+
replaceVaadinSpringWithStarter
77+
## TODO: document in migration guide to 25
78+
addDevModeIfNeeded "$_opt"
79+
;;
80+
esac
81+
7982
## TODO: document in migration guide to 25
8083
patchImports 'import com.fasterxml.jackson.core.type.TypeReference;'\
8184
'import tools.jackson.core.type.TypeReference;'
@@ -513,14 +516,15 @@ replaceVaadinSpringWithStarter() {
513516
## Adds vaadin-dev dependency for projects without Spring
514517
## Checks if Spring is not present in build files and adds vaadin-dev dependency
515518
## TODO: verify that is explained in migration guide
519+
# $1 optional
516520
addDevModeIfNeeded() {
517521
# Add vaadin-dev dependency if Spring is not found
518522
# Handle Maven projects
519523
if [ -f "pom.xml" ]; then
520524
# Check for actual dependency, not exclusions
521525
if ! grep -A 2 -B 2 "vaadin-dev" pom.xml 2>/dev/null | grep -q "<dependency>" 2>/dev/null; then
522526
[ -z "$TEST" ] && log "Adding vaadin-dev dependency to Maven project"
523-
addMavenDep "com.vaadin" "vaadin-dev" "compile" "<optional>true</optional>"
527+
addMavenDep "com.vaadin" "vaadin-dev" "compile" "$1"
524528
else
525529
[ -z "$TEST" ] && log "vaadin-dev dependency already present in Maven project"
526530
fi

0 commit comments

Comments
 (0)