lupuuss / Mokkery

The mocking library for Kotlin Multiplatform, easy to use, boilerplate-free and compiler plugin driven.
https://mokkery.dev
Apache License 2.0
202 stars 8 forks source link

Support Kotlin 2.1.0 #48

Open Vivecstel opened 1 month ago

Vivecstel commented 1 month ago

When updating kotlin version to 2.1.0-Beta1 tests using mockery fail with:

e: org.jetbrains.kotlin.util.FileAnalysisException: While analysing /..: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol org.jetbrains.kotlin.fir.types.TypeUtilsKt.toRegularClassSymbol(org.jetbrains.kotlin.fir.types.ConeKotlinType, org.jetbrains.kotlin.fir.FirSession)'
    at org.jetbrains.kotlin.util.AnalysisExceptionsKt.wrapIntoFileAnalysisExceptionIfNeeded(AnalysisExceptions.kt:57)
    at org.jetbrains.kotlin.fir.FirCliExceptionHandler.handleExceptionOnFileAnalysis(Utils.kt:249)
    at org.jetbrains.kotlin.fir.pipeline.AnalyseKt.runCheckers(analyse.kt:68)
    at org.jetbrains.kotlin.fir.pipeline.FirUtilsKt.resolveAndCheckFir(firUtils.kt:77)
    at org.jetbrains.kotlin.fir.pipeline.FirUtilsKt.buildResolveAndCheckFirViaLightTree(firUtils.kt:88)
    at org.jetbrains.kotlin.cli.jvm.compiler.pipeline.JvmCompilerPipelineKt.compileModuleToAnalyzedFir(jvmCompilerPipeline.kt:319)
    at org.jetbrains.kotlin.cli.jvm.compiler.pipeline.JvmCompilerPipelineKt.compileModulesUsingFrontendIrAndLightTree(jvmCompilerPipeline.kt:109)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:148)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:43)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:102)
    at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.kt:316)
    at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:464)
    at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:73)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.doCompile(IncrementalCompilerRunner.kt:506)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:423)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileNonIncrementally(IncrementalCompilerRunner.kt:301)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:129)
    at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:674)
    at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:91)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1659)
    at jdk.internal.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
    at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol org.jetbrains.kotlin.fir.types.TypeUtilsKt.toRegularClassSymbol(org.jetbrains.kotlin.fir.types.ConeKotlinType, org.jetbrains.kotlin.fir.FirSession)'
    at dev.mokkery.plugin.diagnostics.MokkeryScopedCallsChecker.checkInterceptionType(MokkeryCallsChecker.kt:168)
    at dev.mokkery.plugin.diagnostics.MokkeryScopedCallsChecker.checkInterception(MokkeryCallsChecker.kt:110)
    at dev.mokkery.plugin.diagnostics.MokkeryCallsChecker.check(MokkeryCallsChecker.kt:74)
    at dev.mokkery.plugin.diagnostics.MokkeryCallsChecker.check(MokkeryCallsChecker.kt:49)
    at org.jetbrains.kotlin.fir.analysis.collectors.components.ExpressionCheckersDiagnosticComponent.check(ExpressionCheckersDiagnosticComponent.kt:270)
    at org.jetbrains.kotlin.fir.analysis.collectors.components.ExpressionCheckersDiagnosticComponent.visitFunctionCall(ExpressionCheckersDiagnosticComponent.kt:74)
    at org.jetbrains.kotlin.fir.analysis.collectors.components.ExpressionCheckersDiagnosticComponent.visitFunctionCall(ExpressionCheckersDiagnosticComponent.kt:19)
    at org.jetbrains.kotlin.fir.expressions.FirFunctionCall.accept(FirFunctionCall.kt:41)
    at org.jetbrains.kotlin.fir.analysis.collectors.CheckerRunningDiagnosticCollectorVisitor.checkElement(CheckerRunningDiagnosticCollectorVisitor.kt:24)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitElement(AbstractDiagnosticCollectorVisitor.kt:48)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitWithCallOrAssignment(AbstractDiagnosticCollectorVisitor.kt:346)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitFunctionCall(AbstractDiagnosticCollectorVisitor.kt:255)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitFunctionCall(AbstractDiagnosticCollectorVisitor.kt:30)
    at org.jetbrains.kotlin.fir.expressions.FirFunctionCall.accept(FirFunctionCall.kt:41)
    at org.jetbrains.kotlin.fir.declarations.impl.FirPropertyImpl.acceptChildren(FirPropertyImpl.kt:75)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitNestedElements(AbstractDiagnosticCollectorVisitor.kt:38)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitProperty(AbstractDiagnosticCollectorVisitor.kt:879)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitProperty(AbstractDiagnosticCollectorVisitor.kt:30)
    at org.jetbrains.kotlin.fir.declarations.FirProperty.accept(FirProperty.kt:58)
    at org.jetbrains.kotlin.fir.declarations.impl.FirRegularClassImpl.acceptChildren(FirRegularClassImpl.kt:63)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitNestedElements(AbstractDiagnosticCollectorVisitor.kt:38)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitWithDeclarationAndReceiver(AbstractDiagnosticCollectorVisitor.kt:311)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitClassAndChildren(AbstractDiagnosticCollectorVisitor.kt:87)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitRegularClass(AbstractDiagnosticCollectorVisitor.kt:92)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitRegularClass(AbstractDiagnosticCollectorVisitor.kt:30)
    at org.jetbrains.kotlin.fir.declarations.FirRegularClass.accept(FirRegularClass.kt:48)
    at org.jetbrains.kotlin.fir.declarations.impl.FirFileImpl.acceptChildren(FirFileImpl.kt:57)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitNestedElements(AbstractDiagnosticCollectorVisitor.kt:38)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitFile(AbstractDiagnosticCollectorVisitor.kt:1151)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitFile(AbstractDiagnosticCollectorVisitor.kt:30)
    at org.jetbrains.kotlin.fir.declarations.FirFile.accept(FirFile.kt:42)
    at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollector.collectDiagnostics(AbstractDiagnosticCollector.kt:36)
    at org.jetbrains.kotlin.fir.pipeline.AnalyseKt.runCheckers(analyse.kt:37)
    ... 33 more

With kotlin 2.0.20 the tests succeed.

lupuuss commented 1 month ago

Hi! I am aware of this problem. Currently, I'm unable to investigate and fix the issue, because the Poko compiler plugin that Mokkery uses is also broken by Kotlin 2.1.0-Beta1. I will release a snapshot version as soon as Poko is fixed.

Vivecstel commented 1 month ago

perfect thanks

zkovar commented 1 month ago

Hi @lupuuss , is this the same issue with kotlin 2.0.21?

when attempting to update our project from 2.0.20 to 2.0.21, I see tests failing to run due to

e: java.lang.NullPointerException
    at dev.mokkery.plugin.ir.IrClassKt.addOverridingProperty(IrClass.***:128)
    at dev.mokkery.plugin.ir.IrClassKt.addOverridingProperty(IrClass.***:111)
    at dev.mokkery.plugin.ir.IrClassKt.overrideAllOverridableProperties(IrClass.***:102)
    at dev.mokkery.plugin.transformers.BuildMockClassKt.buildMockClass(BuildMockClass.***:99)
    at dev.mokkery.plugin.transformers.MokkeryTransformer.replaceWithMock$lambda$1(MokkeryTransformer.***:95)
    at dev.mokkery.plugin.core.HashMapCache.getOrPut(Cache.***:22)
    at dev.mokkery.plugin.transformers.MokkeryTransformer.replaceWithMock(MokkeryTransformer.***:95)
    at dev.mokkery.plugin.transformers.MokkeryTransformer.visitCall(MokkeryTransformer.***:67)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.***:299)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.***:19)
    at org.jetbrains.kotlin.ir.expressions.IrCall.accept(IrCall.***:24)
    at org.jetbrains.kotlin.ir.expressions.IrExpression.transform(IrExpression.***:24)
    at org.jetbrains.kotlin.ir.expressions.IrExpressionBody.transformChildren(IrExpressionBody.***:31)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBody(IrElementTransformerVoid.***:174)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitExpressionBody(IrElementTransformerVoid.***:182)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitExpressionBody(IrElementTransformerVoid.***:185)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitExpressionBody(IrElementTransformerVoid.***:19)
    at org.jetbrains.kotlin.ir.expressions.IrExpressionBody.accept(IrExpressionBody.***:21)
    at org.jetbrains.kotlin.ir.expressions.IrExpressionBody.transform(IrExpressionBody.***:24)
    at org.jetbrains.kotlin.ir.declarations.IrField.transformChildren(IrField.***:47)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitDeclaration(IrElementTransformerVoid.***:40)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitField(IrElementTransformerVoid.***:96)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitField(IrElementTransformerVoid.***:99)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitField(IrElementTransformerVoid.***:19)
    at org.jetbrains.kotlin.ir.declarations.IrField.accept(IrField.***:40)
    at org.jetbrains.kotlin.ir.IrElementBase.transform(IrElementBase.***:33)
    at org.jetbrains.kotlin.ir.declarations.IrProperty.transformChildren(IrProperty.***:54)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitDeclaration(IrElementTransformerVoid.***:40)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitProperty(IrElementTransformerVoid.***:116)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitProperty(IrElementTransformerVoid.***:119)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitProperty(IrElementTransformerVoid.***:19)
    at org.jetbrains.kotlin.ir.declarations.IrProperty.accept(IrProperty.***:45)
    at org.jetbrains.kotlin.ir.IrElementBase.transform(IrElementBase.***:33)
    at org.jetbrains.kotlin.ir.util.TransformKt.transformInPlace(transform.***:35)
    at org.jetbrains.kotlin.ir.declarations.IrClass.transformChildren(IrClass.***:82)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitDeclaration(IrElementTransformerVoid.***:40)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitClass(IrElementTransformerVoid.***:54)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitClass(IrElementTransformerVoid.***:57)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitClass(IrElementTransformerVoid.***:19)
    at org.jetbrains.kotlin.ir.declarations.IrClass.accept(IrClass.***:72)
    at org.jetbrains.kotlin.ir.IrElementBase.transform(IrElementBase.***:33)
    at org.jetbrains.kotlin.ir.util.TransformKt.transformInPlace(transform.***:35)
    at org.jetbrains.kotlin.ir.declarations.IrFile.transformChildren(IrFile.***:38)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitPackageFragment(IrElementTransformerVoid.***:146)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFile(IrElementTransformerVoid.***:160)
    at dev.mokkery.plugin.core.CoreTransformer.visitFile(CoreTransformer.***:21)
    at dev.mokkery.plugin.transformers.MokkeryTransformer.visitFile(MokkeryTransformer.***:82)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFile(IrElementTransformerVoid.***:163)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitFile(IrElementTransformerVoid.***:19)
    at org.jetbrains.kotlin.ir.declarations.IrFile.accept(IrFile.***:28)
    at org.jetbrains.kotlin.ir.declarations.IrFile.transform(IrFile.***:31)
    at org.jetbrains.kotlin.ir.declarations.IrFile.transform(IrFile.***:20)
    at org.jetbrains.kotlin.ir.util.TransformKt.transformInPlace(transform.***:35)
    at org.jetbrains.kotlin.ir.declarations.IrModuleFragment.transformChildren(IrModuleFragment.***:43)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitModuleFragment(IrElementTransformerVoid.***:108)
    at dev.mokkery.plugin.transformers.MokkeryTransformer.visitModuleFragment(MokkeryTransformer.***:87)
    at dev.mokkery.plugin.MokkeryIrGenerationExtension.generate(MokkeryIrGenerationExtension.***:16)
    at org.jetbrains.kotlin.fir.pipeline.ConvertToIrKt.applyIrGenerationExtensions(convertToIr.***:442)
    at org.jetbrains.kotlin.fir.pipeline.Fir2IrPipeline.runActualizationPipeline(convertToIr.***:246)
    at org.jetbrains.kotlin.fir.pipeline.Fir2IrPipeline.convertToIrAndActualize(convertToIr.***:130)
    at org.jetbrains.kotlin.fir.pipeline.ConvertToIrKt.convertToIrAndActualize(convertToIr.***:99)
    at org.jetbrains.kotlin.fir.pipeline.ConvertToIrKt.convertToIrAndActualize$default(convertToIr.***:72)
    at org.jetbrains.kotlin.cli.jvm.compiler.pipeline.JvmCompilerPipelineKt.convertToIrAndActualizeForJvm(jvmCompilerPipeline.***:196)
    at org.jetbrains.kotlin.cli.jvm.compiler.pipeline.JvmCompilerPipelineKt.convertAnalyzedFirToIr(jvmCompilerPipeline.***:169)
    at org.jetbrains.kotlin.cli.jvm.compiler.pipeline.JvmCompilerPipelineKt.compileModulesUsingFrontendIrAndLightTree(jvmCompilerPipeline.***:140)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.***:148)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.***:43)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.***:103)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.***:49)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.***:101)
    at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.***:464)
    at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.***:73)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.doCompile(IncrementalCompilerRunner.***:506)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.***:423)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileNonIncrementally(IncrementalCompilerRunner.***:301)
    at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.***:129)
    at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.***:675)
    at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.***:92)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.***:1660)
    at jdk.internal.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:569)
    at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
    at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)

I see the current version of poko is 0.17.0, but maybe would need to be 0.17.2 to support 2.0.21?

https://github.com/drewhamilton/Poko/releases/tag/0.17.2

lupuuss commented 1 month ago

@zkovar I moved it to separate issue as it's not related to this issue.

lupuuss commented 1 month ago

Update on 2.1.0 support: Poko with 2.1.0-Beta2 support was released so I will be able to adjust Mokkery and release a snapshot with 2.1.0-Beta2 support soon.

Vivecstel commented 2 weeks ago

Any update for this ?

lupuuss commented 2 weeks ago

Sorry for lack of updates. I was busy releasing Mokkery 2.5.0. Since the last update I was able to investigate Kotlin 2.1.0 update:

I'm aiming to resolve the issues at the end of this week. If Kotlin 2.1.0 support is urgent for you, I should be able to release a snapshot that contains K/N bug, that I'll fix later.

Vivecstel commented 2 weeks ago

Perfect thanks. No it is not urgent as 2.1.0 is in rc and stable yet

lupuuss commented 1 week ago

Update: In Kotlin 2.1.0, the #44 fix is no longer needed and actually causes the previously mentioned K/N crash, further complicating backward compatibility. As a result, I’ve decided to drop backward compatibility. While this isn’t ideal for users, it brings advantages to the Mokkery codebase by allowing the removal of compatibility fallbacks, making it easier to support Kotlin 2.1.0.

Since adding support for Kotlin 2.1.0 was simpler without backward compatibility, I’ve already released a snapshot version, 2.6.0-SNAPSHOT, which is compiled with Kotlin 2.1.0-RC and should work with previous betas and future stable release.

To use this version, add the following repository to both plugin and regular dependencies:

maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") }

I'll provide a stable release whenever Kotlin 2.1.0 stable release is available.