msink / kotlin-libui

Kotlin/Native interop to libui: a portable GUI library
MIT License
648 stars 49 forks source link

Publish maven artifact #13

Closed andreas-mausch closed 5 years ago

andreas-mausch commented 5 years ago

So new projects can just use kotlin-libui as a normal dependency

See #7

msink commented 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.

msink commented 5 years ago

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 :)

msink commented 5 years ago

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'
msink commented 5 years ago

Asked JetBrains developers: JetBrains/kotlin-native#2372

msink commented 5 years ago

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

msink commented 5 years ago

And before it will be published to jcenter or mavenCentral - what version numbering scheme should be used?

I'm not sure.

andreas-mausch commented 5 years ago

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.

andreas-mausch commented 5 years ago

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.

msink commented 5 years ago

I tried - seems that there isn't such gradle task. But maybe JetBrains developers know better.

msink commented 5 years ago

Done.

msink commented 5 years ago

And to jcenter() too.