https://kotlinlang.org logo
n

Nathan Bedell

12/03/2021, 12:21 AM
Hello. Does anyone have any examples they could point me to for a gradle project (either groovy or .kts) making use of the arrow proofs plugin? I understand it is not yet released just yet -- but I wanted to try it out for myself before then in some of my projects. I know there are tests showing how the plugin is used in the arrow-meta repository, but I am trying to figure out how to use the plugin in an actual standalone gradle project.
👀 2
s

simon.vergauwen

12/03/2021, 10:45 AM
Here you can see how I consume the Arrow Optics Plugin: https://github.com/arrow-kt/Arrow-MPP-Template/compare/arrow-optics-plugin?expand=1
I haven’t tried the proofs one yet, but it should be possible to try in this way
n

Nathan Bedell

12/03/2021, 7:19 PM
@simon.vergauwen thanks, I think I pretty much did the same thing with the proofs plugin, but I'll try it again first with the template and see if I can get it to work there. At first glance, I think there may have been a Kotlin version incompatibility when I tried before (I was not on 1.6).
s

simon.vergauwen

12/03/2021, 8:39 PM
Oh yes, that was probably the issue. You need to use the same compiler version as Arrow Meta, since the compiler API will only be stable in 1.7.x. It’s a similar limitation as Jetpack Compose.
n

Nathan Bedell

12/03/2021, 11:01 PM
1.5.31-SNAPSHOT should be compatible with Kotlin 1.5.31, right? For the project I'm most interested in, unfortunately, I'm stuck on that Kotlin version (actually, due to compose!)
Looks like the compiler plugin is working now, thanks!
It does seem like (at least in the 1.5.31 snapshot)
@Given
annotations have issues with unresolved references (i.e. not using fully qualified names or the right imports) in the compiler generated code. If this is not a known issue, or has not already been resolved, let me know, and I'd be happy to open up a ticket.
Also, I guess I should ask in general: At this stage in development of the proofs plugin, would it be helpful for me to open tickets for any issues I run into using the latest snapshots?
s

simon.vergauwen

12/04/2021, 8:05 PM
cc\\ @raulraja
r

raulraja

12/04/2021, 9:43 PM
Hi @Nathan Bedell, It’s going to change based on what Multiple Context receivers end up looking in Kotlin but feel free to create any issues and if you want to help with them I’ll be happy to show you where they may be fixed. @Javier and I are planning on putting some time on it at some point before we release.
3 Views