https://kotlinlang.org logo
Title
d

Dirk

07/11/2022, 9:04 AM
I am having problems setting up lens generation in a multiplatform project. In step 3 of the setup I have the problem that the following error message is thrown by Gradle: "Type mismatch: inferred type is String but Action<KspExtension> was expected" Are multiplatform not supported or does the integration have to be done differently here?
I have now found a way to activate the plugin. What would be the recommended way to configure the plugin?
configurations["kspJs"].dependencies.add(project.dependencies.create("io.arrow-kt:arrow-optics-ksp-plugin:_"))
configurations["kspJvm"].dependencies.add(project.dependencies.create("io.arrow-kt:arrow-optics-ksp-plugin:_"))
s

simon.vergauwen

07/11/2022, 7:05 PM
Hey @Dirk, The recommended way is to use
add("kspJs", dependencies)
https://kotlinlang.org/docs/ksp-multiplatform.html
d

Dirk

07/12/2022, 4:32 PM
Thank you for pointing this out. I had actually tried to do this in the wrong block: kotlin -> sourceSets -> commonMain -> dependencies And not root -> dependencies
👍 1