-
Notifications
You must be signed in to change notification settings - Fork 206
Add support for source generators in Bloop #1774
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
Conversation
946790c
to
90d0c71
Compare
Hey this is exciting! Can you see a path forward to having a source generator being a class file in another bloop project in the same build? that's something I really want |
Interesting, I hadn't thought of this. I think that this should work for |
23ad797
to
232c1f6
Compare
@Duhemm This looks great! Is it ready to review? |
232c1f6
to
75e38c6
Compare
Thanks @tgodzik ! I think it is ready for review. There was an issue where the source generators would not be re-run when their inputs changed in watch mode, that I unfortunately couldn't figure out before going on vacation. It's fixed now! |
Ok cool, I am just going on some very short vacations so I will take a look on Monday. We also merged the update to Monix 3 just right now, so that caused some conflicts unfortunately 😓 But now we should be able to update to Scala 2.13 on the plus side. |
75e38c6
to
2791fbc
Compare
This commit changes the Bloop project definition to add a new field, `sourceGenerators`, which can be used to define source generators. Source generators are parts of the build that are run when Bloop gathers the sources of a project (either when queried via BSP or when compiling). Source generators are configured with globs matching input files, an output directory, and a program to run. When the inputs or known outputs of a source generator change, the source generator is automatically re-run. When there are no changes, the result of a source generator is cached. The command to execute to run a source generator will be built from the configured `argv`, followed by the output directory and the input files.
Previously, Bloop would use types from `scala.sys.process` to run the source generators. This commit migrates over to using Bloop's `Forker`.
Previously, Bloop would not work correctly when watching for changed, and the inputs of source generators were changed.
2791fbc
to
7f6e50f
Compare
Thanks for the heads up. I rebased and fixed the conflicts. |
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.
Looks good! I left a couple of comments, but this seems like a really good approach.
I think the test failure is unrelated to this change:
|
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.
The error is unrelated, LGTM 🎉
Nice, thank you! There's no rush in merging, but in case you were waiting for me to do it, I don't have write permissions to this repository anymore 😄 |
Ach, ok. I can add you back to the repo if you want? |
Yes, please, if you don't mind. I can't promise anything, but I'd be happy to help maintain the project. |
Added! |
This commit changes the Bloop project definition to add a new field,
sourceGenerators
, which can be used to define source generators.Source generators are parts of the build that are run when Bloop gathers
the sources of a project (either when queried via BSP or when
compiling).
Source generators are configured with globs matching input files, an
output directory, and a program to run. When the inputs or known outputs
of a source generator change, the source generator is automatically
re-run. When there are no changes, the result of a source generator is
cached.
The command to execute to run a source generator will be built from the
configured
argv
, followed by the output directory and the input files.