This may be more of a gradle question, but maybe s...
# kotlin-native
j
This may be more of a gradle question, but maybe someone here knows this: I'm working on a little Kotlin Native project which creates a (windows) executable. I'm wondering, if I wanted to create some resource files ( e.g. a text file) to be placed in the program dir, next to the exe file, is there an easy way to do this? Or how is something like this generally done? Adding a new gradle task that depends on the build task and then run that ? ( This doc: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html talks about "resources" a bunch, would my text file be a resource in that sense or is that something different?)
...worked on this some more for a while: The "processResources" task copies files from "resources" dirs ( e.g. '\src\commonMain\resources') into '\build\processedResources\myappname\main'. I ended up adding a new gradle task to copy these files and the exe from the the releaseBuild dir into a new dir called "build\distribution". So far, I have hardcoded the source dir for that copy task, so that's not great, but works for me for the moment.
Anyways, if anyone has a recommendation for a different approach, let me know.
s
That's what I ended up doing for my similar use case
j
I see. One day I'll try to figure out how to get the names of the dirs from Gradle objects instead of hardcoding them