I’m attempting to convert the Arrow Meta hello-wor...
# arrow-meta
c
I’m attempting to convert the Arrow Meta hello-world example to work in a Multiplatform project, but the
compileKotlin
closure is not present in KMP projects. Does anyone know how to configure it? I suspect I’m missing something trivial, but cannot seem to find any documentation for compiler arguments for KMP projects.
It was just me being stupid. This worked:
Copy code
kotlin {
    targets.all {
        compilations.all {
            kotlinOptions {
                freeCompilerArgs = ["-Xplugin=${project.rootDir}/create-plugin/build/libs/create-plugin-all.jar"]
            }
        }
    }
    sourceSets {
        all {
            dependencies {
                api project(path: ':create-plugin', configuration: 'shadow')
            }
        }
        //...
    }
    //...
}
r
Thanks for the info @chrmelchior!! No stupid, just it was necessary to "play" more and now we know something more, thanks!!!
😅 2
Please, don't hesitate to contribute with more examples in that repository, thanks!!
c
I can make a PR with this once I get it running. It seems the compiler plugin is now running but replacing the method fails with
Unresolved reference: synthetic
for some unknown reason and I’m currently trying to figure out how to debug what is happening
r
Great! In case you don't find the reason, you can create a draft pull request and we'll check it 👍
Thanks @chrmelchior!!
c
Will do. Is there any way to get insights into exactly what is transformed by the compiler? I would assume I could find the transformed file under
build/classes/kotlin/jvm
somewhere, but so far I’m coming up short?
r
The transformations take place during compilation. However, you can see a meta debug file which appears together
HelloWorld.kt
. On the other hand,
synthetic
comes from
io.arrow-kt:arrow-annotations
dependency. I hope it's useful for you 👍
c
Thanks 🙇 I was missing the arrow-annotations dependency in the KMP project. It compiles now 🎉
🙌 3
👏 3
r
Thanks to you!!