Support Windows
we need libcurl linked statically, this is currently not possible might change with https://github.com/msys2/MINGW-packages/pull/8469 depends on ktor
see: https://kotlinlang.slack.com/archives/C3SGXARS6/p1620282215299400?thread_ts=1620247483.298800&cid=C3SGXARS6
I removed the dependency to ktor-client and curl
e: D:\a\kotlin-cli-starter\kotlin-cli-starter\src\nativeMain\kotlin\io\NativeActuals.kt: (32, 14): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun <T, R> DeepRecursiveFunction<TypeVariable(T), TypeVariable(R)>.invoke(value: TypeVariable(T)): TypeVariable(R) defined in kotlin
e: D:\a\kotlin-cli-starter\kotlin-cli-starter\src\nativeMain\kotlin\io\NativeActuals.kt: (42, 18): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun <T, R> DeepRecursiveFunction<TypeVariable(T), TypeVariable(R)>.invoke(value: TypeVariable(T)): TypeVariable(R) defined in kotlin
this corresponds to those two lines
val fp = popen("$commandToExecute $redirect", "r") ?: error("Failed to run command: $command")
val status = pclose(fp)
@NikkyAI do you think you can debug that?
so currently it fails because it is runing on a linux-like target on windows (mingw or msys2 or such).. but okio only handled windows like paths when compiled for mingw
https://github.com/square/okio/issues/951
I have merged the work from Nikky. Support for windows is not perfect but better than it was. If someone wants to contribute, feel very welcome!
https://github.com/jmfayard/kotlin-cli-starter/pull/20