tschuchortdev / kotlin-compile-testing

A library for testing Kotlin and Java annotation processors, compiler plugins and code generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Kotlin 1.9.20

drewhamilton opened this issue · comments

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)

Can you try with this branch? #388

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.

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

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

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

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

@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

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

commented

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

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

@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?

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.