Hi guys sb know how to run/debug a k/Native projec...
# kotlin-native
a
Hi guys sb know how to run/debug a k/Native project, my intellij idea doesn't show run button in from of main function.
I am on win10 x64_64
n
Are you using Gradle?
a
Yes
Atarted a new project Kotlin->Native/Gradle
n
In that case you will need to create a new Run Configuration that uses Gradle as the type.
a
Ohh
But it doesn't show up main() as usable entrypoint
Gradle as a type🙄
n
An example of a Run Configuration for a Kotlin Native project in IntelliJ.
With the Tasks field Gradle task completion is available (use Ctrl+Spacebar), however you will need to make sure that the Gradle build script has been setup properly.
a
Btw do i need mingw too? Because it seems that for windows it targets mingw64
n
You will need to include the binaries block in your Gradle build file, eg:
Copy code
// ...
kotlin {
    linuxX64 {
        compilations.getByName("main") {
            cinterops.create("curl")
        }
        binaries {
            executable("battery_metrics_updater") {
                entryPoint = "com.chapman.batteryMetricsUpdater.main"
                runTask?.args(*programArgs)
            }
        }
    }
// ...
}
// ...
a
Thanks!
s
they need to make that experience much easier, you can't come as a new language and offer such a confusing way to get started
a
@sksk i mean like k/n is still is an experimental language, so its a temporary problem. K/JVM is actually pretty easy since stable right now!
Don't worry, Kotlin is a revolutionary language and it'll take some time since it is being developed to be supported for multiple devices