Miguel Santos
07/15/2023, 9:06 PMlibrary_name
and library_name-native
.
Is this how it is supposed to work or should I be publishing only library_name
?
I've seen this: https://kotlinlang.org/docs/multiplatform-publish-lib.html#avoid-duplicate-publications
But I don't fully understand if that fits my use-case or if it's just for kmm.
Thanks in advance!Adam S
07/15/2023, 9:08 PMAdam S
07/15/2023, 9:10 PMMiguel Santos
07/15/2023, 9:10 PMAdam S
07/15/2023, 9:10 PMAdam S
07/15/2023, 9:17 PMkotlin {
when (currentHost) {
KonanTarget.LINUX_X64 -> linuxX64("native", configure)
KonanTarget.MACOS_X64 -> macosX64("native", configure)
KonanTarget.MINGW_X64 -> mingwX64("native", configure)
else -> error("unsupported host '${currentHost.name}'")
}
}
Miguel Santos
07/15/2023, 9:18 PMval nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
Adam S
07/15/2023, 9:18 PM-native
. And so if you were using that conditional trick, then the published library would be randomly changing depending on which machine was used to publish the library. The trick is usually used for testing an executable library locally.Miguel Santos
07/15/2023, 9:19 PMAdam S
07/15/2023, 9:21 PMMiguel Santos
07/15/2023, 9:22 PMNewer versions of Kotlin will automatically disable publishing of targets that are unsupported by the current machineOut of curiosity, does this mean in order to publish an ios library, you'd have to publish it on a mac machine?
Adam S
07/15/2023, 9:23 PMMiguel Santos
07/15/2023, 9:24 PMAdam S
07/15/2023, 9:24 PMAdam S
07/15/2023, 9:25 PMMiguel Santos
07/15/2023, 9:26 PMephemient
07/15/2023, 9:35 PMStefan Oltmann
07/16/2023, 7:58 PMSebastian Sellmair [JB]
07/18/2023, 3:46 PM```kotlin {
when (currentHost) {
KonanTarget.LINUX_X64 -> linuxX64("native", configure)
KonanTarget.MACOS_X64 -> macosX64("native", configure)
KonanTarget.MINGW_X64 -> mingwX64("native", configure)
else -> error("unsupported host '${currentHost.name}'")
}
}```I really, really advise not to use such configurations anymore. They were outdated in 2021 already.