Skip to content

Commit 27c96d9

Browse files
committed
Fix null safety of Gradle Kotlin scripts with Gradle 9
See gh-46923
1 parent d9b05c7 commit 27c96d9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

build-plugin/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-bind-caches.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ tasks.named<BootBuildImage>("bootBuildImage") {
2727

2828
tasks.register("bootBuildImageCaches") {
2929
doFirst {
30-
println("buildWorkspace=" + tasks.getByName<BootBuildImage>("bootBuildImage").buildWorkspace.asCache().bind.source)
31-
println("buildCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").buildCache.asCache().bind.source)
32-
println("launchCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").launchCache.asCache().bind.source)
30+
println("buildWorkspace=" + tasks.getByName<BootBuildImage>("bootBuildImage").buildWorkspace.asCache()?.bind?.source)
31+
println("buildCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").buildCache.asCache()?.bind?.source)
32+
println("launchCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").launchCache.asCache()?.bind?.source)
3333
}
3434
}

build-plugin/spring-boot-gradle-plugin/src/docs/antora/modules/gradle-plugin/examples/packaging/boot-build-image-caches.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ tasks.named<BootBuildImage>("bootBuildImage") {
2222

2323
tasks.register("bootBuildImageCaches") {
2424
doFirst {
25-
println("buildCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").buildCache.asCache().volume.name)
26-
println("launchCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").launchCache.asCache().volume.name)
25+
println("buildCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").buildCache.asCache()?.volume?.name)
26+
println("launchCache=" + tasks.getByName<BootBuildImage>("bootBuildImage").launchCache.asCache()?.volume?.name)
2727
}
2828
}

0 commit comments

Comments
 (0)