-
Notifications
You must be signed in to change notification settings - Fork 251
Description
I have the following use case: I want to build a set of targets with Kotlin 1.4 and I want to build other targets with Kotlin 1.7 in the same workspace. That is because I have a monorepo bazel project where I want to create and publish kotlin libraries that are able to be incorporated into external builds that use different versions of the kotlin compiler. From what I can tell, it doesn't seem to be possible to declare multiple kotlin toolchains with different versions and use them for a couple of reasons:
kotlin_homeis hardcoded to point to@com_github_jetbrains_kotlin/in_kt_toolchainregardless of what versions of the kotlin compiler are installed. Generally speakingcom_github_jetbrains_kotlinis hardcoded in a lot of places.- The
buildjvm_binary defined insrc/main/kotlin/BUILD.release.bazelis compiled with jvm_args that hardcode the paths of expected jar files to the same location regardless of compiler version. Generally speaking,
Is it possible accomplish my goal? If so, could you give me some guidance on how to go about it? I'm attempting to do with this version 1.7.1 of rules_kotlin but I've taken a look at the most recent version and it doesn't seem like the two issues I've mentioned above have been resolved. I'd appreciate any guidance you're willing to give.
I think my best option might be to checkout the other version ofrules_kotlin that I want to use, modify all the relevant hardcoded paths, build everything, and then I'll be able to import that other package as a second repository rule.