Closed andreas-mausch closed 5 years ago
Sure, but I think this should wait for Kotlin 1.3.10 or maybe even 1.3.20.
Now it is a bit rough on edges.
Well, in Kotlin 1.3.10 some bugs we're fixed, https://youtrack.jetbrains.com/issue/KT-27803
So now publishing to bintray should work, with some tricks - Gradle must be 4.7 (it is), 'gradle-bintray-plugin' should be '1.8.2-SNAPSHOT' from maven { url 'https://dl.bintray.com/jetbrains/kotlin-native-dependencies' }
But I have very little free time this week for experiments, so if interested - go on :)
Published, should work like this:
repositories {
...
maven { url "https://dl.bintray.com/msink/kotlin-native" }
}
kotlin {
...
sourceSets {
windowsMain {
kotlin.srcDir('src/nativeMain/kotlin')
dependencies {
implementation 'com.github.msink:libui-windows:alpha4.1-2'
}
}
linuxMain {
kotlin.srcDir('src/nativeMain/kotlin')
dependencies {
implementation 'com.github.msink:libui-linux:alpha4.1-2'
}
}
macosxMain {
kotlin.srcDir('src/nativeMain/kotlin')
dependencies {
implementation 'com.github.msink:libui-macosx:alpha4.1-2'
}
}
}
}
Still didn't figure out how to publish it as true multiplatform library, for using as
implementation 'com.github.msink:libui:alpha4.1-2'
Asked JetBrains developers: JetBrains/kotlin-native#2372
Well, issue with multiplatform library resolved, so this almost works.
See template project https://github.com/msink/hello-libui
On Linux and on MacOSX it should work already, on Windows - only if you have built something by Kotlin/Native on this computer, on Appveyor it fails. Issue: JetBrains/kotlin-native#2421
And before it will be published to jcenter or mavenCentral - what version numbering scheme should be used?
I'm not sure.
Good news with the publishing!
Just to share some thoughts for the numbering scheme: Imo you should not align it to the libui version, because you might want to do changes, while the libui version remains the same, and vice versa.
It should probably be alpha, as long as libui is.
So maybe something like 0.1.0 (at least this is what the semver FAQ suggests to start with).
My laptop works again (I broke it during the vacation), so I'm eager to check your changes.
For the windows issue: Maybe the dependsOn is the problem:
tasks.compileKotlinNative.dependsOn compileWindowsResources
We can find out which task downloads msys2-mingw-w64-x86_64-gcc-7.3.0-clang-llvm-lld-6.0.1
and call compileWindowsResources after. So replace compileKotlinNative by something else.
I tried - seems that there isn't such gradle task. But maybe JetBrains developers know better.
Done.
And to jcenter()
too.
So new projects can just use kotlin-libui as a normal dependency
See #7