Is there `kotllin-dsl` version compatible with kot...
# gradle
t
Is there
kotllin-dsl
version compatible with kotlin plugin
1.4-M1
?
e
The
kotlin-dsl
plugin is intended to use the version of Kotlin embedded in Gradle. So, no version guaranteed to be compatible. Did you try applying the
kotlin-dsl
plugin on a build that uses the 1.4-M1 of the kotlin gradle plugin? With what Gradle version? Does it fail? How?
t
Gradle
6.3
with
kotlin-dsl
1.3.5
Kotlin
1.4-M1
First problem
e
Note that you shouldn’t specify a version for the
kotlin-dsl
plugin.
Yeah, that’s Kotlin saying mixing versions isn’t supported .. “strange errors” 🙂
What happens if you let that warning not fail the build?
t
Solution - duplicate default compiler settings
e
Ok, so if you do that, then it works for you?
t
No
Some collection operations in
buildSrc
don’t work correctly
e
In any case, there’s not much more you can do except trying and crossing fingers. It’s not supported.
Could you please share the error you get?
t
I generate code in
buildSrc
String.replace
don’t replace all entries Some
List
elements are lost
e
Hum, that sounds like some
stdlib
incompatibilities between 1.3 and 1.4 ... I suppose that’s a “strange error” like the warning says. 🤷‍♂️
t
Is there any solution for Kotlin Compiler plugin testing in such situations?
e
You would need a Gradle version that embeds Kotlin 1.4 for all this to work. But that will take time before there’s an official one. We might get to publish some nightlies from a Kotlin 1.4 branch but not immediatly.
Or you could try removing the use of the
kotlin-dsl
plugin, giving up on its features, and simply use the kotlin gradle plugin in your buildSrc.
t
kotlin-dsl
applied in
buildSrc
by default. Right?
e
The
kotlin-dsl
plugin isn’t applied by default, you have to do it:
Copy code
// buildSrc/build.gradle.kts
plugins { `kotlin-dsl` }
If you do, then my suggestion is to remove this plugin application from your buildSrc, giving up on its features.
t
No warnings without my plugin, which use
kotlin-dsl
!
But error remains
I can create migration branch if it has value for testing
@eskatos Where will be announced night builds with Kotlin
1.4
?
e
Please subscribe to https://github.com/gradle/gradle/issues/12660, it’ll get updated when we get to it
👍 1
r
Is there a supported alternative to the
kotlin-dsl
plugin? I don’t think I’ve ever seen a kotlin buildSrc configuration that doesn’t use it. The need in my case is to be able to define helper functions used in kotlin build scripts in the rest of the project.
l
I guess
kotlin("jvm")
is the one @russhwolf
👍 1
t
Update: •
buildSrc
- no success with
1.4-M1
Invalid
String.replace
Invalid collection operations • Gradle plugin & ordinal projects - no WA required