-
Notifications
You must be signed in to change notification settings - Fork 2
Support Kotlin 2+ #10
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. nit: remove this comment |
||
testImplementation 'dev.zacsweers.kctfork:core:0.6.0' // Fork of kotlin-compile-testing that supports Kotlin 2 | ||
testImplementation 'junit:junit:4.13.2' | ||
testImplementation 'org.jetbrains.kotlin:kotlin-compiler-embeddable' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,25 +5,13 @@ import com.tschuchort.compiletesting.SourceFile | |
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi | ||
import org.junit.Assert.assertTrue | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.junit.runners.Parameterized | ||
import org.junit.runners.Parameterized.Parameters | ||
import java.lang.reflect.Method | ||
|
||
@OptIn(ExperimentalCompilerApi::class) | ||
@RunWith(Parameterized::class) | ||
class ObjectSerializationFixTest(enableIr: Boolean, enableFir: Boolean) { | ||
companion object { | ||
@Parameters(name = "IR: {0}, FIR: {1}") | ||
@JvmStatic | ||
fun data() = arrayOf(arrayOf(false, false), arrayOf(true, false), arrayOf(true, true)) | ||
} | ||
|
||
class ObjectSerializationFixTest { | ||
private val compiler = KotlinCompilation().apply { | ||
compilerPluginRegistrars = listOf(ObjectSerializationCompilerPluginRegistrar()) | ||
useIR = enableIr | ||
supportsK2 = true | ||
useK2 = enableFir | ||
Comment on lines
-24
to
-26
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You still want to test with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should support |
||
} | ||
|
||
private val SERIALIZABLE_OBJECT = """ | ||
|
Uh oh!
There was an error while loading. Please reload this page.