https://kotlinlang.org logo
Title
t

turansky

03/27/2020, 11:35 AM
Is there
kotllin-dsl
version compatible with kotlin plugin
1.4-M1
?
e

eskatos

03/27/2020, 12:40 PM
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

turansky

03/27/2020, 1:20 PM
Gradle
6.3
with
kotlin-dsl
1.3.5
Kotlin
1.4-M1
First problem
e

eskatos

03/27/2020, 1:27 PM
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

turansky

03/27/2020, 1:28 PM
Solution - duplicate default compiler settings
e

eskatos

03/27/2020, 1:29 PM
Ok, so if you do that, then it works for you?
t

turansky

03/27/2020, 1:29 PM
No
Some collection operations in
buildSrc
don’t work correctly
e

eskatos

03/27/2020, 1:31 PM
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

turansky

03/27/2020, 1:34 PM
I generate code in
buildSrc
String.replace
don’t replace all entries Some
List
elements are lost
e

eskatos

03/27/2020, 1:36 PM
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

turansky

03/27/2020, 1:37 PM
Is there any solution for Kotlin Compiler plugin testing in such situations?
e

eskatos

03/27/2020, 1:38 PM
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

turansky

03/27/2020, 1:41 PM
kotlin-dsl
applied in
buildSrc
by default. Right?
e

eskatos

03/27/2020, 1:44 PM
The
kotlin-dsl
plugin isn’t applied by default, you have to do it:
// 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

turansky

03/27/2020, 1:53 PM
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

eskatos

03/27/2020, 6:49 PM
Please subscribe to https://github.com/gradle/gradle/issues/12660, it’ll get updated when we get to it
👍 1
r

russhwolf

03/28/2020, 1:40 AM
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

louiscad

03/28/2020, 11:09 AM
I guess
kotlin("jvm")
is the one @russhwolf
👍 1
t

turansky

04/02/2020, 3:24 PM
Update: •
buildSrc
- no success with
1.4-M1
Invalid
String.replace
Invalid collection operations • Gradle plugin & ordinal projects - no WA required