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

Eugeniu Olog

03/18/2020, 10:51 AM
Hi guys, I'm trying to create a compiler plugin for an Android project, but I have some issues. I took a look at examples, but it is using
shadowJar
and I can't make it work with Android. Do you have any suggestion or example? Thank you
❤️ 3
r

raulraja

03/18/2020, 10:57 AM
Hi Eugeniu, you only need to use shadow if you want your compiler plugin code to be reused in an IDE plugin. If you have a small reproducible example of what fails we can maybe take a look.
e

Eugeniu Olog

03/18/2020, 11:03 AM
Hi Raul, I just pasted the
HelloWorld
example plugin and
MetaPlugin
to a java module, adding
Copy code
compileOnly "org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlin_version"
    compileOnly "io.arrow-kt:compiler-plugin:$arrow_meta"
as dependencies. Then I'm just depending on that module in the app module. But the app crashes because
Copy code
fun helloWorld(): Unit = TODO()
is not being replaced. Am i missing any steps in the setup?
r

raulraja

03/18/2020, 11:06 AM
Are you applying the arrow meta plugin in gradle?
e

Eugeniu Olog

03/18/2020, 11:10 AM
At the moment it's applied at application level, but I tried to apply it also to every module, but nothing changed
not sure If can help, but I'm using the snapshot version
r

raulraja

03/18/2020, 11:17 AM
If you can package a minimal example and push it to a repo we can clone to troubleshoot someone will take a look to see if it’s an issue with your setup or a limitation in meta.
e

Eugeniu Olog

03/18/2020, 11:18 AM
Yes, I was making a repo right now, thank you
👍 2
r

Rachel

03/18/2020, 1:34 PM
Hi! We used the
shadowJar
task in that example to create a new compiler plugin with Arrow Compiler Plugin + Hello World Plugin
And then it's used in another module (
use-plugin
)
4 Views