So, I’ve never used gradle before and after following the tutorial at Migrating Builds From Apache Maven I frankly still don’t know what I’m supposed to do.
Could anyone give me a very simple rundown of how I convert a maven project to gradle and then use kotlin native to create a native executable?
If you have a maven project written in Kotlin for JVM and want to produce native binaries, it would probably be easier to use tools like Excelsior JET.
If you still want to go Kotlin/Native way, beware that you’ll need to split your code base into the common part and platform specific parts. You place into the common part the code that depends on the Kotlin standard library and the existing multiplatform libraries. For the other parts of code that have dependencies on JDK and other JVM libraries, you either need to find their analogs among the existing multiplatform libraries, or reimplement these parts in Kotlin/Native either from scratch or with the help of native (e.g. C) libraries.
You can start by creating a new multiplatform gradle project with IntelliJ New Project wizard and then populating this newly created project with your code.
I recommend you to experiment with that multiplatform approach a little on some toy project, so you’d get a grasp of what that approach is and could make a more informed decision on which way to choose.
These materials regarding multiplatform projects might be helpful:
Right now I’m not too interested in multiplatform support as what I’m generally making only has to run on windows machines, as such I was looking into ways of simply creating exe’s, I"ll have a look at Excelsior JET though thanks.
You can also look into GraalVM, which also provides native compilation and I think is much more convenient than Excelsior JET. But it does not have stable version for windows yet .