Build problems: I tried to do nothing other than a...
# fun-adaptive
l
Build problems: I tried to do nothing other than adding the alias lines to the
plugins
section, to make it look like this:
Copy code
plugins {
    id 'org.jetbrains.kotlin.js'
    alias(libs.plugins.kotlinMultiplatform)
    alias(libs.plugins.adaptive)
}
This gave me the following error:
Copy code
FAILURE: Build failed with an exception.

* Where:
Build file '/home/elias/prog/array/client-adaptive/client-adaptive-js/build.gradle' line: 3

* What went wrong:
Could not compile build file '/home/elias/prog/array/client-adaptive/client-adaptive-js/build.gradle'.
> startup failed:
  build file '/home/elias/prog/array/client-adaptive/client-adaptive-js/build.gradle': 3: only alias(libs.plugins.someAlias) plugin identifiers where `libs` is a valid version catalog
  
  For more information on the plugins {} block, please refer to <https://docs.gradle.org/8.11.1/userguide/plugins.html#sec:plugins_block> in the Gradle documentation.
  
   @ line 3, column 5.
         alias(libs.plugins.kotlinMultiplatform)
         ^
  
  build file '/home/elias/prog/array/client-adaptive/client-adaptive-js/build.gradle': 4: only alias(libs.plugins.someAlias) plugin identifiers where `libs` is a valid version catalog
  
  For more information on the plugins {} block, please refer to <https://docs.gradle.org/8.11.1/userguide/plugins.html#sec:plugins_block> in the Gradle documentation.
  
   @ line 4, column 5.
         alias(libs.plugins.adaptive)
         ^
  
  2 errors
t
The example project uses version catalogs. If you don't have those, you can just use the id
plugin-name
format.
Copy code
plugins {
  id("org.jetbrains.kotlin.multiplatform") version "2.1.20"
  id("fun.adaptive") version "0.25.718"
}
Oh, that's for .kts but very similar for Groovy. However, I'm not sure if you can simply drop the multiplatform plugin on a kotlin/js project.
l
Oops. You're right. That was a mistake.
What are the names of the dependencies to use, since I can't use the alias stuff?
t
Copy code
implementation 'fun.adaptive:core-core:0.25.718'
// Core modules implementation 'fun.adaptivecore core0.25.718' implementation 'fun.adaptivecore ui0.25.718' // Grove modules implementation 'fun.adaptivegrove lib0.25.718' implementation 'fun.adaptivegrove runtime0.25.718' // Library modules implementation 'fun.adaptivelib app0.25.718' implementation 'fun.adaptivelib auth0.25.718' implementation 'fun.adaptivelib chart0.25.718' implementation 'fun.adaptivelib graphics0.25.718' implementation 'fun.adaptivelib ktor0.25.718' implementation 'fun.adaptivelib document0.25.718' implementation 'fun.adaptivelib ui0.25.718' implementation 'fun.adaptivelib ui mpw0.25.718' implementation 'fun.adaptivelib util0.25.718' implementation 'fun.adaptivelib value0.25.718'
I think...
I'm off for today, this rotated SVG arc to browser eclipse thing is really getting on my nerves.
l
Thanks. That worked better.
Now I came across what seems to be a bug in the plugin. Here's the exception:
Copy code
java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.ir.types.IrType org.jetbrains.kotlin.ir.types.IrTypesKt.getDefaultType(org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol)'
	at fun.adaptive.kotlin.service.ir.ServicesPluginContext.<init>(ServicesPluginContext.kt:27)
	at fun.adaptive.kotlin.service.ir.ServicesGenerationExtension.generate(ServicesGenerationExtension.kt:18)
	at org.jetbrains.kotlin.fir.pipeline.ConvertToIrKt.applyIrGenerationExtensions(convertToIr.kt:496)
	at org.jetbrains.kotlin.fir.pipeline.Fir2IrPipeline.runActualizationPipeline(convertToIr.kt:252)
	at org.jetbrains.kotlin.fir.pipeline.Fir2IrPipeline.convertToIrAndActualize(convertToIr.kt:131)
	at org.jetbrains.kotlin.fir.pipeline.ConvertToIrKt.convertToIrAndActualize(convertToIr.kt:98)
	at org.jetbrains.kotlin.cli.pipeline.web.WebFir2IrPipelinePhase.transformFirToIr(WebFir2IrPipelinePhase.kt:83)
	at org.jetbrains.kotlin.cli.pipeline.web.WebFir2IrPipelinePhase.executePhase(WebFir2IrPipelinePhase.kt:41)
I'm using IDEA #IU-252.23892.248 (that's the latest EAP version) if that helps.
t
I guess that EAP uses Kotlin 2.2.0 internally, uses Kotlin 2.2.0 and that's why you see this error. The breaking changes between 2.1.20 and 2.2.0 are rather big, not in complexity, but in amount. I already checked what I have to do to upgrade the plugin tho the latest version but haven't done it yet. I'll try to do that later today.
l
Thanks. My project also always uses the latest Kotlin EAP, although that should be less of a problem, I think?
t
It depends on the compiler changes. There are breaking changes time-to-time, most small, but sometimes (like with 2.2.0) rather big. When they change something that is used it actually can cause the plugin to stop working. There is no way around that, as the compiler plugin API is officially unstable. Plugin developers live with that, but I cannot guarantee to keep up with EAP to be honest.
Well, technically I could keep up with EAP, but for that I would have to set up a proper SNAPSHOT release repo.
It is not a bad thing to make changes early, there are not so many of them.
Well, first attempt of plugin upgrade spectacularly failed. I guess there has been other changes as well. Asked about them in #C7L3JB43G I'll go on with this when I get some answer or when I can figure out what changed.