-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Kotlin 2+ #10
Conversation
gradle-plugin/build.gradle
Outdated
embedded project(':kotlin-plugin') | ||
runtimeOnly(project(':kotlin-plugin')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get things to build using this embedded
configuration. I hope runtimeOnly
is a suitable replacement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
embedded
configuration is required for publishing, since I cheat by using the same artifact for Gradle + Kotlin plugin.
What kind of compilation issues did you see?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed to reintroduce embedded.gradle without any build issues! Not sure what I got in the first place.
kotlin-plugin/src/main/kotlin/me/shika/generation/ObjectSerializationIRGeneration.kt
Show resolved
Hide resolved
useIR = enableIr | ||
supportsK2 = true | ||
useK2 = enableFir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kotlin 2 has deprecated IR, so the forked K2 version of kotlin-compile-testing has taken that option away. I decided to make this test not parameterized since, going forward, useIR
will always be false and useK2
will always be true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still want to test with enableFir
flag since technically some people could compile with language version 1.9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, dev.zacsweers.kctfork:core:0.6.0
, which is a fork of com.github.tschuchortdev:kotlin-compile-testing:1.5.0
does not support the useIR and useK2 properties...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should support languageVersion
, which is technically the same (you want 1.9 for k1 or 2.0+ for k2)
@ShikaSD, review please? 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to reintroduce embedded.gradle without getting any build errors!
useIR = enableIr | ||
supportsK2 = true | ||
useK2 = enableFir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, dev.zacsweers.kctfork:core:0.6.0
, which is a fork of com.github.tschuchortdev:kotlin-compile-testing:1.5.0
does not support the useIR and useK2 properties...
useIR = enableIr | ||
supportsK2 = true | ||
useK2 = enableFir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should support languageVersion
, which is technically the same (you want 1.9 for k1 or 2.0+ for k2)
@@ -10,7 +10,8 @@ dependencies { | |||
implementation "org.jetbrains.kotlin:kotlin-gradle-plugin-api" | |||
compileOnly "org.jetbrains.kotlin:kotlin-compiler-embeddable" | |||
|
|||
testImplementation 'com.github.tschuchortdev:kotlin-compile-testing:1.5.0' | |||
testImplementation 'junit:junit:4.12' | |||
// testImplementation 'com.github.tschuchortdev:kotlin-compile-testing:1.5.0' does not support Kotlin 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove this comment
I am going to merge this as is and fix forward to speed up the process :) |
No description provided.