rules_kotlin icon indicating copy to clipboard operation
rules_kotlin copied to clipboard

Kotlin Bazel Cross-Platform Roadmap

Open kxfang opened this issue 3 years ago • 9 comments

I saw on the roadmap that stable cross-platform (XPlat) was anticipated in late 2019. Is this project still in the works? If not, was there any progress made? As someone currently using bazel primarily and wants to integrate cross-platform Kotlin into my project, I'm eagerly waiting for this to be available.

kxfang avatar Aug 06 '21 21:08 kxfang

It's safe to say it's way way WAY behind, but it's something that we are looking at. It hasn't been abandoned as an idea, but hasn't been a priority as other things have gotten in the way. The uptick in MP released stuff necessitates it eventually. I suspect it's a 2022 thing.

cgruber avatar Oct 01 '21 19:10 cgruber

The main issue is that it has both kotlin-specific build concerns, and multiplatform-dependency concerns, and while I started adding some handling of gradle-metadata (which MP relies on) in my http://github.com/square/bazel_maven_repository project, it's by no means fully supported, and I don't know if jvm_rules_external handles it at all. So we either need to support a flexible approach to dependencies that accounts for that subtlety, or which factors out that subtlety (separate dependency lists for different platforms) in a way that doesn't suck for everyone. I'm likely to just start a google design doc for this in the new year.

cgruber avatar Oct 01 '21 19:10 cgruber

@cgruber as a first step one could start with the "full-stack" support (that is, kotlin for jvm, native, js and common) as described here: https://discuss.kotlinlang.org/t/how-do-i-compile-multi-platform-projects-from-the-command-line/8440/5. That would open a way to using libraries like the latest MockK which uses kotlinMP but which is not necessary portable to the "platform" like iOS or whatever.

WDYT?

Nikolas-LFDesigns avatar May 25 '22 15:05 Nikolas-LFDesigns

Ok, that was me who didn't research carefully. In case of mockK I only needed to provide dependencies with kt_jvm_import instead of java_import for kotlin compiler to recognize expect/actual inline methods.

Nikolas-LFDesigns avatar May 26 '22 18:05 Nikolas-LFDesigns

@cgruber where does this stand? We would really like to see this in motion and I'm very willing to help if there are things I can do.

pswaminathan avatar Dec 13 '22 20:12 pswaminathan

I'd also be very interested to understand where Kotlin Multiplatorm stands with bazel

ScottPierce avatar Jan 27 '23 20:01 ScottPierce

Semi-related: https://github.com/bazelbuild/rules_jvm_external/issues/864 Brief summary: Kotlin Multiplatform releases break updates for those using rules_jvm_external. Cross-referencing because I think coordination on reading the metadata might end up being important between the two repos.

cpsauer avatar Feb 28 '23 00:02 cpsauer

Looks like it may be a 2024 thing? What's the status of this project?

iphydf avatar Feb 21 '24 12:02 iphydf

We currently do not have any plans to build out support for KMP in rules_kotlin but are open to community contributions. rules_jvm_external also lacks support for KMP dependencies but that may finally be unblocked once this lands https://github.com/bazelbuild/rules_jvm_external/pull/989.

Bencodes avatar Feb 22 '24 21:02 Bencodes