Update Kotlin DSL examples that configure the environment of bootBuildImage to be additive#41173
Update Kotlin DSL examples that configure the environment of bootBuildImage to be additive#41173sdeleuze wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
The intent is to add a BP_JVM_VERSION to any existing entries. Won't this replace any existing entries in the environment map such that it now only contains BP_JVM_VERSION -> 17?
There was a problem hiding this comment.
environment is a MapProperty and it has a put(String, String) method. I think that's what we should call. I'm not sure if there's some Kotlin DSL support for it, or if it should just be environment.put("BP_JVM_VERSION", "17").
There was a problem hiding this comment.
Ah good point, I think I was confused by the fact the other samples in this page are also using environment.set(mapOf("key" to "value")). I guess we should fix those as well.
I think environment.put("BP_JVM_VERSION", "17") is indeed what should be used. I have tested it successfully here. I don't think there is a better DSL than that.
Let me try to update other code samples accordingly.
There was a problem hiding this comment.
PR updated accordingly.
1b43b3b to
a7829e3
Compare
boot-build-image-env.gradle.kts|
Thanks Sébastien! |
Reading Gradle documentation and seeing other similar code samples, I don't think the
environment.get()part is needed, and it looks not idiomatic.