bazelbuild / rules_kotlin

Bazel rules for Kotlin
Apache License 2.0
334 stars 211 forks source link

Kotlin Bazel Cross-Platform Roadmap #567

Open kxfang opened 3 years ago

kxfang commented 3 years ago

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.

cgruber commented 3 years ago

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 commented 3 years ago

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.

Nikolas-LFDesigns commented 2 years ago

@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 commented 2 years ago

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.

pswaminathan commented 1 year ago

@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.

ScottPierce commented 1 year ago

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

cpsauer commented 1 year ago

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.

iphydf commented 9 months ago

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

Bencodes commented 9 months ago

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.

iphydf commented 2 days ago

It seems that PR has landed. Will kmp be a 2025 thing?