rules_kotlin
rules_kotlin copied to clipboard
Transitive dependencies of a `kt_jvm_library` are included on the classpath
When we have 3 packages, :apple, :banana and :cherry, where :banana is in the deps of :apple and :cherry is in the deps of :banana, it's possible to use Kotlin functions defined in the :cherry package inside :apple:
# apple has access to the symbols defined in Cherry.kt, but should not have access
kt_jvm_library(
name = "apple",
srcs = "Apple.kt",
deps = ["//:banana"]
)
kt_jvm_library(
name = "banana",
srcs = "Banana.kt",
deps = ["//:cherry"]
)
kt_jvm_library(
name = "cherry",
srcs = "Cherry.kt",
)
This is not in line with how Bazel functions (e.g: this is not the case when using java_library instead of kt_jvm_library)
We currently only support strict-deps in an experimental mode, and the author of that code is (sadly) passed-on, so we need to do quite a bit of work to make everything with strict deps work out, so we can limit compilation deps to only direct deps.