Open johnynek opened 4 years ago
I gave this a go months ago and my takeaway was that it should be done using bazel query output instead of an aspect. I forget my exact reasoning.
There was a bloop extension made by @psilospore already. I'll be reviewing it and maybe make a PR soon(-ish).
Just to clarify I have a WIP to create a phase to compile as an optional alternative to the built in compile phase motivated by this blog post: https://jorge.vican.me/posts/integrate-bloop-with-bazel-and-pants.html
At the moment I am attempting to achieve this by:
1) Creating a bloop config file for each target 2) Sending a BSP request to compile the target 3) (in progress right now) generate the outputs that the compile phase normally returns:
return struct(
class_jar = ...,
coverage = ...,
full_jars = ...,
ijar = ...,
ijars = ...,
rjars = ...,
java_jar = ...,
source_jars = ...,
merged_provider = ...,
)
It seems like part of that could be reused. I'm pretty new to some of this stuff but could the part to generate the bloop config just be a final phase?
compile
to only return the external_providers
and have others use the JavaInfo
and coverage providers for their needs.generate the bloop config just be a final phase
what do you mean by "final phase"? Related draft PR here: https://github.com/bazelbuild/rules_scala/pull/997
What is the status of this?
Edit:
For anyone in need of a bloop config, until this is ready, I wrote a very hacky shell and python script to generate bloop configs (compatible with rules_jvm_external
) https://gist.github.com/ValdemarGr/fbf2f574d12da0c23513b581d095154f
Summarized accurately in this issue AFAIK.
We recently just landed something like this in bazel-bsp, it can export a set of bloop projects given a set of bazel targets.
Not exactly the same thing but similar?
see:
https://scalacenter.github.io/bloop/docs/configuration-format
If we had an aspect similar to the one for intelliJ, we could use metals with rules_scala, which would be nice for many users.
This doesn't seem very hard to do based on a quick look at the configuration file.