https://kotlinlang.org logo
#arrow-meta
Title
# arrow-meta
c

chrmelchior

01/20/2020, 4:29 PM
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

Rachel

01/20/2020, 5:36 PM
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

chrmelchior

01/20/2020, 5:39 PM
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

Rachel

01/20/2020, 5:41 PM
Great! In case you don't find the reason, you can create a draft pull request and we'll check it 👍
Thanks @chrmelchior!!
c

chrmelchior

01/20/2020, 5:44 PM
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

Rachel

01/20/2020, 5:52 PM
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

chrmelchior

01/20/2020, 5:56 PM
Thanks 🙇 I was missing the arrow-annotations dependency in the KMP project. It compiles now 🎉
🙌 3
👏 3
r

Rachel

01/20/2020, 6:02 PM
Thanks to you!!
5 Views