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

[Kotlin 2.0.0-Beta2] - NoClassDefFoundError #103

Closed
sureshg opened this issue Dec 20, 2023 · 3 comments
Closed

[Kotlin 2.0.0-Beta2] - NoClassDefFoundError #103

sureshg opened this issue Dec 20, 2023 · 3 comments

Comments

@sureshg
Copy link

sureshg commented Dec 20, 2023

I understand that the plugin doesn't support Kotlin 2.x officially, but things have been working fine until 2.0.0-Beta1 and it throws the following error with the latest update. I am creating this issue to just bring attention to the project maintainer... Feel free to close this if it's not the right channel to bring this issue. Thanks for all the work.

> Task :common:compileTestKotlinJs FAILED
e: java.lang.NoClassDefFoundError: org/jetbrains/kotlin/ir/expressions/IrStatementOrigin$NOT_IN
        at com.bnorm.power.diagram.ExpressionTreeKt$buildTree$1.visitCall(ExpressionTree.kt:117)
        at com.bnorm.power.diagram.ExpressionTreeKt$buildTree$1.visitCall(ExpressionTree.kt:79)
        at org.jetbrains.kotlin.ir.expressions.IrCall.accept(IrCall.kt:26)
        at com.bnorm.power.diagram.ExpressionTreeKt.buildTree(ExpressionTree.kt:78)
        at com.bnorm.power.PowerAssertCallTransformer.visitCall(PowerAssertCallTransformer.kt:118)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:299)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:19)
        at org.jetbrains.kotlin.ir.expressions.IrCall.accept(IrCall.kt:26)
        at org.jetbrains.kotlin.ir.expressions.IrExpression.transform(IrExpression.kt:30)
        at org.jetbrains.kotlin.ir.expressions.IrExpression.transform(IrExpression.kt:22)
@bnorm
Copy link
Owner

bnorm commented Jan 4, 2024

Thanks for the report! Looks like the object IrStatementOrigin.NOT_IN changed to a property in 2.0.0 so I cannot use origin is IrStatementOrigin.NOT_IN anymore, but will need to do an equality check. Might be something I can fix now so it is supported automatically in 2.0.0, but I doubt I will get so lucky in general with 2.0.0, so I will probably just fix it then.

@bnorm
Copy link
Owner

bnorm commented Mar 22, 2024

As of Kotlin 2.0.0-Beta5, this compiler plugin now ships with Kotlin! I will be releasing one more version which will be some kind of transition version. I'm not sure yet how it will work, it could add the built-in Kotlin compiler plugin or fail the build with an error message to upgrade, but I want some kind of upgrade path for those that use automation like Renovate.

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
    kotlin("jvm") version "2.0.0-Beta5"
    kotlin("plugin.power-assert") version "2.0.0-Beta5"
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
powerAssert {
    functions = listOf("kotlin.assert", "kotlin.test.assertTrue")
    excludedSourceSets = listOf("main")
}

@sureshg
Copy link
Author

sureshg commented Mar 23, 2024

@bnorm thanks for bundling this awesome plugin with Kotlin...this is working fine in 2.0.0-Beta5.

@bnorm bnorm closed this as completed Mar 24, 2024
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

No branches or pull requests

2 participants