krakowski / gradle-jextract

Gradle plugin for integrating Project Panama's jextract tool
https://plugins.gradle.org/plugin/io.github.krakowski.jextract
GNU General Public License v3.0
51 stars 10 forks source link

Kotlin rewrite #3

Closed elect86 closed 3 years ago

elect86 commented 3 years ago

This is a pure and plain rewrite in Kotlin, all other changes I wish for will come later

krakowski commented 3 years ago

Thanks for this Pull Request! :slightly_smiling_face:

Is this also compatible with Groovy-based build scripts? I just tried it out using the jextract demo project and got the following error.

A problem occurred evaluating root project 'jextract-demo'.
> No signature of method: build_adxdy3au6go2yd30ue9o4aomn.jextract() is applicable for argument types: (build_adxdy3au6go2yd30ue9o4aomn$_run_closure3) values: [build_adxdy3au6go2yd30ue9o4aomn$_run_closure3@74c26b67]
elect86 commented 3 years ago

Since this is a 1 to 1 rewrite I find it weird you are getting errors..

Did you try to delete .gradle and rebuild? Also invalidating cache?

elect86 commented 3 years ago

I pushed two additional fixes, one opens the JextractTask (it was final, it's by default) and the other fixes the header method signature (I renamed just header, while you expected withHeader)

Btw, this is also one of the case where a statically typed language helps better with the error definition

krakowski commented 3 years ago

I pushed two additional fixes, one opens the JextractTask (it was final, it's by default) and the other fixes the header method signature (I renamed just header, while you expected withHeader)

I opened the class within my local clone of your PR but didn't notice you changed the method's name from fromHeader to just header, so this will be most likely the error I encountered. I will try it out later this day or tomorrow.