tschuchortdev / kotlin-compile-testing

A library for testing Kotlin and Java annotation processors, compiler plugins and code generation
Mozilla Public License 2.0
642 stars 61 forks source link

Support Kotlin 1.9.20 #390

Closed drewhamilton closed 1 month ago

drewhamilton commented 10 months ago

1.9.20-Beta appears to remove the setUseIR function, so tests crash at runtime.

'void org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments.setUseIR(boolean)'
java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments.setUseIR(boolean)'
    at com.tschuchort.compiletesting.KotlinCompilation$commonK2JVMArgs$1.invoke(KotlinCompilation.kt:304)
    at com.tschuchort.compiletesting.KotlinCompilation$commonK2JVMArgs$1.invoke(KotlinCompilation.kt:279)
    at com.tschuchort.compiletesting.AbstractKotlinCompilation.commonArguments(AbstractKotlinCompilation.kt:172)
    at com.tschuchort.compiletesting.KotlinCompilation.commonK2JVMArgs(KotlinCompilation.kt:279)
    at com.tschuchort.compiletesting.KotlinCompilation.compileJvmKotlin(KotlinCompilation.kt:452)
    at com.tschuchort.compiletesting.KotlinCompilation.compile(KotlinCompilation.kt:628)
    at dev.drewhamilton.poko.PokoCompilerPluginTest.compilation of valid class succeeds(PokoCompilerPluginTest.kt:221)
martinbonnin commented 9 months ago

Can you try with this branch? https://github.com/tschuchortdev/kotlin-compile-testing/pull/388

apatrida commented 9 months ago

This is likely to tail from branch #388 still:

args.useIR = useIR
Screenshot 2023-09-26 at 5 57 10 AM

I think this is now inferred as the opposite of useOldBackend in the compiler code.

drewhamilton commented 9 months ago

@martinbonnin Yep, my tests pass if I do an includeBuild with #388's branch.

3flex commented 9 months ago

Testing of #394 which is a slightly more complete PR would be appreciated too if anyone has the chance.

drewhamilton commented 9 months ago

Yep, confirmed #394's branch works for me too.

krzema12 commented 8 months ago

Is there any traction in this ticket? My tests are failing on 1.9.20. @tschuchortdev

martinbonnin commented 8 months ago

@krzema12 until support gets added upstream you can use @ZacSweers fork that should have much better support for newer versions of Kotlin: https://github.com/ZacSweers/kotlin-compile-testing

ftomassetti commented 6 months ago

Also running in this issue. It would be nice to get a new release with support for 1.9.20

wangk5 commented 6 months ago

Also running into this issue! Is there an estimate for when we'll get the new release to support 1.9.20?

NinjaCookie84 commented 5 months ago

Also running into this issue. Would love to see progress here. Any way to help speed this up? (Not sure if I can though)

frecco75 commented 1 month ago

@krzema12 until support gets added upstream you can use @ZacSweers fork that should have much better support for newer versions of Kotlin: https://github.com/ZacSweers/kotlin-compile-testing

Is it possible to make a Pull Request on this repo or the code base has changed a lot?

tschuchortdev commented 1 month ago

I have just made a new release updated for Kotlin v1.9.24 and with a bunch of bug fixes cherrypicked from forks: https://github.com/tschuchortdev/kotlin-compile-testing/releases/tag/1.6.0

As for Kotlin v2.0.0, I've taken a look at it and it seems to be a lot of work with changes in both KAPT and KSP as I can see from the work that Zac Sweers has already done on this. I'll see if I can merge changes from his fork back later so they don't diverge too much. Honestly, you're probably better off using Zac Sweers' fork if you need quick updates. I'm doing Scala work nowadays and don't really use this myself anymore, so my motivation to spend scarce free time on maintenance is dwindling.