Skip to content
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

Merged
merged 3 commits into from
Jan 7, 2025
Merged

Support Kotlin 2+ #10

merged 3 commits into from
Jan 7, 2025

Conversation

tianyu
Copy link
Contributor

@tianyu tianyu commented Dec 17, 2024

No description provided.

Comment on lines 29 to 27
embedded project(':kotlin-plugin')
runtimeOnly(project(':kotlin-plugin'))
Copy link
Contributor Author

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.

Copy link
Owner

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?

Copy link
Contributor Author

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.

Comment on lines -24 to -26
useIR = enableIr
supportsK2 = true
useK2 = enableFir
Copy link
Contributor Author

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.

Copy link
Owner

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

Copy link
Contributor Author

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...

Copy link
Owner

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)

@tianyu
Copy link
Contributor Author

tianyu commented Dec 19, 2024

@ShikaSD, review please? 🙏

Copy link
Contributor Author

@tianyu tianyu left a 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!

Comment on lines -24 to -26
useIR = enableIr
supportsK2 = true
useK2 = enableFir
Copy link
Contributor Author

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...

Comment on lines -24 to -26
useIR = enableIr
supportsK2 = true
useK2 = enableFir
Copy link
Owner

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove this comment

@ShikaSD
Copy link
Owner

ShikaSD commented Jan 7, 2025

I am going to merge this as is and fix forward to speed up the process :)

@ShikaSD ShikaSD merged commit 943b392 into ShikaSD:master Jan 7, 2025
1 check passed
@tianyu tianyu deleted the kotlin-2 branch January 8, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants