-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist sbt metadata in project model #538
Conversation
05f37e2
to
b33640d
Compare
b33640d
to
aa3374b
Compare
Add the sbt metadata field in the project configuration file so that we can present it to IDEs via BSP. A nice property of the approach taken in this PR is that we automatically create a project file for the build under the meta build `.bloop` directory. This is helpful for two reasons: 1. Bloop can compile your build just as it can compile your project. 2. Bloop knows immediately any change that happens to your build. The implementation here proposed is quite tricky because of some sbt implementation details. We cannot get the `autoImports` from the build of the build, so we need to roll out our own piece of code to do so with the `pluginData` of the meta build. This repeats some work because it needs to classload the build data for our project's build, but it's negligible in terms of time spent (<500 ms in the cases I've tested). Aside from implementing this feature, this commit also removes any cross published module and instead creates a static module for it. This helps development because we can compile the projects for 0.13 and 1.0 immediately without needing to use `+` and `^`, which are completely broken in our build.
aa3374b
to
ecd5a8b
Compare
The last commit adds a fancier |
Adds support to elide `discoveredSbtPlugins` for all sbt versions if either `bloopInstall` or `bloopGenerate` are under execution. This makes the process faster (exporting the bloop build takes now 11 seconds!).
58e69e6
to
cad72a1
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.
LGTM
@@ -1,5 +1,6 @@ | |||
import java.nio.file.{Files, Path} | |||
|
|||
val BloopClassifiers = Set("sources", "javadoc") |
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.
Is this used somewhere?
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.
Nope, just removed it.
Add the sbt metadata field in the project configuration file so that we
can present it to IDEs via BSP. A nice property of the approach taken in
this PR is that we automatically create a project file for the build
under the meta build
.bloop
directory. This is helpful for tworeasons:
The implementation here proposed is quite tricky because of some sbt
implementation details. We cannot get the
autoImports
from the buildof the build, so we need to roll out our own piece of code to do so with
the
pluginData
of the meta build. This repeats some work because itneeds to classload the build data for our project's build, but it's
negligible in terms of time spent (<500 ms in the cases I've tested).
And it does reuse the parent classloader from the meta build.
Aside from implementing this feature, this commit also removes any cross
published module and instead creates a static module for it. This helps
development because we can compile the projects for 0.13 and 1.0
immediately without needing to use
+
and^
, which are completelybroken in our build.