@@ -54,21 +54,24 @@ updateGradleWrapper() {
5454
5555# # TODO: needs to be documented in vaadin migration guide to 25
5656cleanAfterBumpingVersions () {
57- computeGradle
5857 if [ -f build.gradle ]; then
58+ computeGradle
5959 # # vaadinClean is not enough it needs to clean everything also
6060 runCmd " Removing build artifacts" " rm -rf build package-lock.json tsconfig* types* vite* target* src/main/frontend/generated/ src/main/bundles"
6161 runCmd " Cleaning project after version bump" " $GRADLE clean vaadinClean"
6262 return
6363 fi
64- [ -z " $NOCURRENT " ] && [ ! -d target ] && return
64+ [ -n " $NOCURRENT " ] && exit
6565 # # vaadin:clean-frontend is not enough it needs to clean target too
6666 # # note that archetype-spring (and maybe others) needs the production profile to have vaadin plugin available
6767 for i in ` getPomFiles` ; do
6868 local P
69- grep -q " vaadin-maven-plugin" $i && P=vaadin
70- grep -q " flow-maven-plugin" $i && P=flow
71- [ -z " $P " ] || runCmd " Cleaning project after version bump" " mvn clean $P :clean-frontend -Pproduction -f $i "
69+ local T=` dirname $i ` /target
70+ if [ -d " $T " ]; then
71+ grep -q " vaadin-maven-plugin" $i && P=vaadin
72+ grep -q " flow-maven-plugin" $i && P=flow
73+ [ -z " $P " ] || runCmd -f " Cleaning project after version bump" " $MVN clean $P :clean-frontend -Pproduction -f $i "
74+ fi
7275 done
7376}
7477
@@ -86,13 +89,13 @@ updateAppLayoutAfterNavigation() {
8689 # Add implements AfterNavigationObserver to class declaration
8790 _cmd1=" perl -pi -e 's/(public\s+class\s+[A-Za-z0-9_]+\s+extends\s+AppLayout)(\s*)(\{)/\$ 1 implements com.vaadin.flow.router.AfterNavigationObserver\$ 2\$ 3/' \" $file \" "
8891 cmd " $_cmd1 "
89- [ -n " $TEST " ] || eval " $_cmd1 "
92+ eval " $_cmd1 "
9093 fi
9194
9295 # Transform the method - handle both with and without @Override in one pattern
9396 _cmd2=" perl -0777 -pi -e 's/(\s+)(?:@Override\s+)?protected\s+void\s+afterNavigation\(\)\s*\{\s*super\.afterNavigation\(\);\s*/\$ 1@Override\n\$ 1public void afterNavigation(com.vaadin.flow.router.AfterNavigationEvent event) {\n\$ 1/gs' \" $file \" "
9497 cmd " $_cmd2 "
95- [ -n " $TEST " ] || eval " $_cmd2 "
98+ eval " $_cmd2 "
9699 fi
97100 done
98101}
@@ -111,7 +114,6 @@ updateSpringBootApplication() {
111114 [ -z " $TEST " ] && warn " removing database initialization method from $app_file " || cmd " ## removing database initialization method from $app_file "
112115
113116 # Use perl line-by-line processing for more reliable method and import removal
114- if [ -z " $TEST " ]; then
115117 perl -i -ne '
116118 BEGIN { $in_method = $braces = $removed = $found_bean = 0; }
117119
@@ -141,7 +143,6 @@ updateSpringBootApplication() {
141143 END { warn "Removed $removed lines from SqlDataSourceScriptDatabaseInitializer method and imports\n" if $removed; }
142144 ' " $app_file "
143145 fi
144- fi
145146}
146147
147148patchJaxrs () {
0 commit comments