-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to build and publish Kotlin Multiplatform Libraries #3853
Comments
Hi, That's an interesting suggestion, thank you! |
At the moment we are targeting JVM, iOS and Linux so Macos would work for us as it can build all our targets. But other people might be interested in Windows and it requires Windows host. |
I'll second this. We're investing heavily in Kotlin multi-platform libraries that are published for use on Android and the JVM, but we'll be publishing them for iOS soon, too. |
Hi, We've added preliminary support for Kotlin MPP libraries. In particular we now handle Gradle metadata (.module) in our Linux builds. |
Hi @jitpack-io, Do you have a sample build.gradle for this Kotlin MPP support? I couldn't find any in your existing repositories. Thanks! |
@yslvlln Here are some KMP projects: Hope this helps |
Will look into this. Thanks a lot @arkivanov! |
@yslvlln Recently KMP evolved a bit so might be worth another look. Setting this up got a lot easier. Basically the multiplatform plugin has out of the box support for publish. There have been a few changes to the meta data part and how gradle handles this. E.g. It is able to figure out for a js project to depend on the -js variant. I have a simple project that I'm trying to publish via jitpack currently. Currently it half works in the sense that I can publish but not depend on the dependencies. The project is: https://github.com/jillesvangurp/geogeometry & https://jitpack.io/#jillesvangurp/geogeometry Release 3.1.4 for this was a kotlin multi platform build. See logs + build file in this gist: https://gist.github.com/jillesvangurp/8b1d8bcfa930a0f1a419a11f33462c74 This initially looks like it works. But when I try to depend on the -jvm jar in a different project, I get a 401 from jitpack:
I've also tried depending both:
or
For a different project I use a google storage bucket as a poor man's gradle repository and there it works as it should. So, I know my build file is OK. To me it looks like either files are missing/not uploaded or access to those files is somehow not allowed. Since it seems to be close to working; it might be worth getting this over the finishing line. KMP is about to be more important now that Kotlin 1.4 is out so fixing this would be really nice. I have several libraries that are probably going to be multi-platform soon. |
Note, for the project above I have now switched to rsyncing a local file repository to my website. This seems to work fine. So the issue is definitely with how jitpack handles the generated artifacts as the exact same artifacts when uploaded unmodified to a website seem to work fine. |
Hello, is there any news on this? It would be super nice to be able to use Jitpack with KMM projects reliably, especially now that they've officially reached alpha (and hopefully won't make significant changes over time). |
Hey @jitpack-io, any updates 1.5 years after the creation of this issue? 🙂 |
Would really love to see this @jitpack-io |
Since Jcenter and Bintray are shutting down, it would be really cool to have Jitpack working with Kotlin Multiplatform! |
@arkivanov Let's take
We can see that group = "com.github.ArcticLampyrid.KtJsonRpcPeer"
if (version.toString() == "unspecified") {
version = "0.7.0" // set if version is not provided (impossible for JitPack)
} Finally kotlin should generate the correct metadata. |
the issue seems to be that for some reason the but the my solution was to just make the configure<PublishingExtension> {
publications {
// ...
}
repositories {
maven("file://${System.getenv("HOME")}/.m2/repository")
}
} but that doesn't help because jitpack runs install:
- ./gradlew publish jitpack should now publish all of the necessary files. if anyone is curious here's the projct where i got it (mostly) working |
|
@DetachHead |
care to share your config? been tearing my hair out at this for the last few days. here's mine, it's full of dirty hacks because none of it worked out of the box for me.no idea what i'm doing wrong |
lcurl missing error when building KMP with linuxX64 target |
Any progress on this? I'd absolutely love to be able to publish KMM libraries on Github without the headache of a typical maven publish. Also for anyone who stumbles across this... I found this great way to self host maven repos. I was super discouraged by the difficulty of hosting on maven central and others... so I came across this, and it's by far the easiest solution I've seen for hosting KMM libraries. Also, you can run it very easily from Docker on something like Digital Ocean. Took me about 5 minutes to configure. |
As of Kotlin 1.6.0, Windows targets can be compiled on any host: https://kotlinlang.org/docs/whatsnew16.html#compilation-of-windows-targets-on-any-host In particular, that means that if JitPack could be configured to run builds on a macOS host, then that single host should be able to compile all necessary native targets for multiplatform projects with Kotlin 1.6.0 and beyond. |
@jitpack-io Any updates? 😇 🤞 |
I'm a little bit surprised this hasn't gotten more attention. |
This issue is stale because it has been open for 30 days with no activity. |
not stale ;)
|
not stale |
Does jitpack now support publishing KMP libraries, or is the issue still open? |
Not yet, but I hope to live to see that day |
not stale |
Is there a way to link GitHub actions to jitpack.io? Actions seem to be able to build all KMP targets since they can use a macOS environment, therefore, you don't need to explicitly support them on your servers. |
Still waiting for a way to use Jitpack to build for iOS native targets (like iosArm64, iosSimulatorArm64, iosX64), which requires a macOS build environment. |
Not stale! |
can we expedite this changes? really need it for kmp atm. |
My hunch is that the bottleneck here is hardware changes, not software. |
The bottleneck is that nobody is looking at this Github issue repository, and the fact the jitpack repositories exist at all is a miracle. |
i see, in that case nothing we can do but invest on alternatives, i like jitpack tho, sadly have to let it go for now. |
speaking of hosts,
it seems like |
thank you @amarcolini , plugins {
kotlin("multiplatform") version "2.0.0"
}
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
val node = rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>()
node.version = "16.0.0"
node.download = true
}
|
This issue is stale because it has been open for 30 days with no activity. |
Not stale. |
This issue is stale because it has been open for 30 days with no activity. |
Never been stale. |
not stale |
I have a feeling at this point, nobody even knows where and who makes Jitpack run. I have doubts they even have an actual maintainer. |
Sad to see this still being unresolved in 2024 |
Is your feature request related to a problem? Please describe.
We are playing with Kotlin Multiplatform projects at the moment and publishing our artifacts via JitPack. But JitPack builds only on Linux so we can't build some Native targets (e.g. iOS), as it requires macos host. Taking into account that Github Package Registry is coming, I think it would be nice to add macos host to JitPack.
Describe the solution you'd like
Add ability to publish Kotlin Multiplatform libraries with Native targets
Describe alternatives you've considered
Manual publishing to JCenter, signed up for Github Package Registry beta
Additional context
Travis can be configured to build on multiple hosts, perhaps same technique could be used
The text was updated successfully, but these errors were encountered: