-
Notifications
You must be signed in to change notification settings - Fork 46
[feature] Resolve Scala SDK independently for each target #552
Conversation
b5f47c0
to
42964ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot for the pr! one thing in the comments
6ce8e91
to
8a69c95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! do you have any specific scala project on which i should test it?
...r/src/main/kotlin/org/jetbrains/bsp/bazel/server/sync/languages/scala/ScalaLanguagePlugin.kt
Outdated
Show resolved
Hide resolved
This prepares us for changes in `rules_scala` that will allow customizing the Scala version for each target. In order to achieve that, we can no longer resolve the Scala SDK globally as the maximal version used. We need to use per-target info. Scala SDK will be still discovered based on the compiler class path. Now though we will look into an implicit dependency of each target, the `_scalac`. This change is backward-compatible, as the mentioned data is already available. It is also forward-compatible with the anticipated cross-build feature of `rules_scala`. (see: bazelbuild/rules_scala#1290) The aspect will produce additional data – namely few compiler classpath jars per Scala target. Perhaps we could review this change in the future to normalize the data back. Now it's not possible, as the data about alternative configurations (here: of scalac) is discarded in the server.
I prepared a small test/example here: aszady/bazel-bsp@independent...aszady:bazel-bsp:independent-test |
ohh perfect! seems to work for me as well, can i ask you to add this test to e2e tests as well? looks like a useful scenario to keep there, once it's done i think we will be ready to merge |
The problem is, the feature is not yet fully merged into |
oh yea sure |
is it ready to merge? |
Yes, I believe so. |
This prepares us for changes in
rules_scala
that will allow customizing the Scala version for each target.In order to achieve that, we can no longer resolve the Scala SDK globally as the maximal version used. We need to use per-target info.
Scala SDK will be still discovered based on the compiler class path.
Now though we will look into an implicit dependency of each target, the
_scalac
.This change is backward-compatible, as the mentioned data is already available.
It is also forward-compatible with the anticipated cross-build feature of
rules_scala
.(see: bazelbuild/rules_scala#1290)
The aspect will produce additional data – namely few compiler classpath jars per Scala target.
Perhaps we could review this change in the future to normalize the data back. Now it's not possible, as the data about alternative configurations (here: of scalac) is discarded in the server.