Skip to content

Commit 0592286

Browse files
committed
more fixes for multimodule demos
1 parent 8b9e13a commit 0592286

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ applyv25patches() {
3333
;;
3434
esac
3535
## TODO: document in migration guide to 25
36-
patchImports 'import com.fasterxml.jackson.core.type.TypeReference;' 'import tools.jackson.core.type.TypeReference;'
36+
patchImports 'import com.fasterxml.jackson.core.type.TypeReference;' 'import tools.jackson.core.type.TypeReference;'
3737

3838
diff_=`git diff $D $F | egrep '^[+-]'`
3939
[ -z "$TEST" -a -n "$diff_" ] && echo "" && warn "Patched sources\n" && dim "====== BEGIN ======\n\n$diff_\n====== END ======"
@@ -64,15 +64,19 @@ cleanAfterBumpingVersions() {
6464
[ -z "$NOCURRENT" ] && [ ! -d target ] && return
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
67-
grep -q "flow-maven-plugin" pom.xml && mplugin=flow || mplugin=vaadin
68-
runCmd "Cleaning project after version bump" "mvn clean $mplugin:clean-frontend -Pproduction"
67+
for i in `getPomFiles`; do
68+
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"
72+
done
6973
}
7074

7175
## Find all java class files that extend AppLayout and have afterNavigation() method, then update them to implement AfterNavigationObserver
7276
## This break change is in https://github.com/vaadin/flow-components/issues/5449
7377
## TODO: needs to be documented in vaadin migration guide to 25 and updated in starter repos
7478
updateAppLayoutAfterNavigation() {
75-
find src -name "*.java" -exec grep -l "extends AppLayout" {} | xargs grep -L "extends AppLayoutElement" | while read file; do
79+
find . -name "*.java" -exec grep -l "extends AppLayout" {} + | xargs grep -L "extends AppLayoutElement" | while read file; do
7680
# Check if the file contains afterNavigation method
7781
if grep -q "afterNavigation()" "$file"; then
7882
[ -z "$TEST" ] && warn "updating afterNavigation method in $file" || cmd "## updating afterNavigation method in $file"
@@ -98,7 +102,7 @@ updateAppLayoutAfterNavigation() {
98102
## TODO: needs to be documented in vaadin migration guide to 25
99103
updateSpringBootApplication() {
100104
# Find the Application class with @SpringBootApplication annotation
101-
local app_file=$(find src -name "*.java" -exec grep -l "@SpringBootApplication" {} +)
105+
local app_file=$(find . -name "*.java" -exec grep -l "@SpringBootApplication" {} +)
102106

103107
[ -z "$app_file" ] && return 0
104108

@@ -155,7 +159,7 @@ EOF
155159
}
156160

157161
updateTheme() {
158-
F=`grep -rl 'AppShellConfigurator' src/main/java --include='*.java'`
162+
F=`grep -rl 'AppShellConfigurator' . --include='*.java'`
159163
[ -z "$F" ] && return
160164
if grep -q '@Theme' $F; then
161165
[ -z "$TEST" ] && warn "removing @Theme annotation from $F" || cmd "## removing @Theme annotation from $F"
@@ -169,7 +173,7 @@ updateTheme() {
169173
removeJsImport() {
170174
value=$1
171175
# remove @JsModule("$1") if present
172-
F=`grep -rl "$value" src/main/java --include='*.java'`
176+
F=`grep -rl "$value" . --include='*.java'`
173177
[ -z "$F" ] && return
174178
if grep -q "$value" $F; then
175179
[ -z "$TEST" ] && warn "removing @JsModule($value) annotation from $F" || cmd "## removing @JsModule($value) annotation from $F"
@@ -180,7 +184,7 @@ addNpmImport() {
180184
value=$1
181185
version=$2
182186
# add import '$1'; to main layout if not present
183-
F=`grep -rl "AppShellConfigurator" src/main/java --include='*.java'`
187+
F=`grep -rl "AppShellConfigurator" . --include='*.java'`
184188
[ -z "$F" ] && return
185189
if ! grep -q "$value" $F; then
186190
[ -z "$TEST" ] && warn "adding NPM import $value to $F" || cmd "## adding NPM import $value to $F"
@@ -189,7 +193,7 @@ addNpmImport() {
189193
}
190194

191195
patchImports() {
192-
F=`grep -rl "$1" src/main/java --include='*.java'`
196+
F=`grep -rl "$1" . --include='*.java'`
193197
for i in $F; do
194198
[ -z "$TEST" ] && warn "replacing $1 in $i" || cmd "## replacing $1 in $i"
195199
perl -pi -e 's|'"$1"'|'"$2"'|g' $i

0 commit comments

Comments
 (0)