-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: add support for the Mill build tool #477
Conversation
scip-java/src/main/scala/com/sourcegraph/scip_java/buildtools/MillBuildTool.scala
Show resolved
Hide resolved
This PR adds in support for the Mill build tool by utilizing https://github.com/ckipp01/mill-scip. It's a pretty thin wrapper. You can find more details about mill-scip in the repo but the general workflow is: - It's an external Mill plugin that gathers everything needed to do a compile via Mill, but then adds some extra plugins/scalacOptions to ensure semanticDB gets produced - Once produced it uses `scip-java` as a library to actually produce the scip file. The plugin isn't actually a dependency here which ensures we don't have any cyclical dependency on anything, but rather just utilizes the `--import` functionality of Mill and external plugins. I'll leave a couple more comments on various parts of the PR. _NOTE_ This only currently supports Scala and Scala 3 projects. There are some issues with Java projects which will need some upstream work. You can track that in com-lihaoyi/mill#1983. Refs sourcegraph#306
Gentle ping on this @olafurpg in case you're not watching the PRs. I'm assuming you're the one that will review this. |
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.
This looks great! Thanks for the ping. I've been on vacation and I didn't see this PR until now 😅
This reverts commit fe2c71c. This change was not needed since the working directory of the process is already `index.app.env.workingDirectory`
The CI is failing because You can BTW run arbitrary code to copy the bootstrap script through the |
Head branch was pushed to by a user without write access
Ahh yea of course, I didn't think of that. I went ahead and added the mill script in test resources and will now copy it over. However the tests will still fail. From my comment up above:
So in the test output you can see it actually finds the SemanticDB and creates the index, but the tests end up looking in the wrong place for it.
Also, welcome back 😄. I hope you had a good holiday! From the CI logs
Nevermind, ignore that and just look at the updated comment down below. |
Head branch was pushed to by a user without write access
Actually, I was just able to add in a |
This is a bit opinionated, so no worries if you'd rather not, but when working on sourcegraph#477 I had a pretty hard time with Bloop, but when using sbt things seems to go much smoother. This pr does a couple things: - Updates the contributing docs from "don't use <insert-editor>" -> Feel free to use Metals with lesser support than IntelliJ will give you. It also then recommends using sbt as your build server. - Remove the explicit dependency on `sbt-bloop`. This both gets rid of some complexity in the build by removing the Bloop-explicit stuff which I assume most non-Scala devs aren't familiar with. - Removes the `BuildInfo.bloopVersion` which didn't seem to be used anywhere.
This is a bit opinionated, so no worries if you'd rather not, but when working on sourcegraph#477 I had a pretty hard time with Bloop, but when using sbt things seems to go much smoother. This pr does a couple things: - Updates the contributing docs from "don't use <insert-editor>" -> Feel free to use Metals with lesser support than IntelliJ will give you. It also then recommends using sbt as your build server. - Remove the explicit dependency on `sbt-bloop`. This both gets rid of some complexity in the build by removing the Bloop-explicit stuff which I assume most non-Scala devs aren't familiar with. - Removes the `BuildInfo.bloopVersion` which didn't seem to be used anywhere.
This is a bit opinionated, so no worries if you'd rather not, but when working on sourcegraph#477 I had a pretty hard time with Bloop, but when using sbt things seems to go much smoother. This pr does a couple things: - Updates the contributing docs from "don't use <insert-editor>" -> Feel free to use Metals with lesser support than IntelliJ will give you. It also then recommends using sbt as your build server. - Remove the explicit dependency on `sbt-bloop`. This both gets rid of some complexity in the build by removing the Bloop-explicit stuff which I assume most non-Scala devs aren't familiar with. - Removes the `BuildInfo.bloopVersion` which didn't seem to be used anywhere.
Released scip-java v0.8.4 yesterday and was able to |
This PR adds in support for the Mill build tool by utilizing
https://github.com/ckipp01/mill-scip. It's a pretty thin wrapper. You
can find more details about mill-scip in the repo but the general
workflow is:
compile via Mill, but then adds some extra plugins/scalacOptions to
ensure semanticDB gets produced
scip-java
as a library to actually produce thescip file.
The plugin isn't actually a dependency here which ensures we don't have
any cyclical dependency on anything, but rather just utilizes the
--import
functionality of Mill and external plugins. I'll leave acouple more comments on various parts of the PR.
NOTE This only currently supports Scala and Scala 3 projects. There
are some issues with Java projects which will need some upstream work.
You can track that in com-lihaoyi/mill#1983.
EDIT: So about Java Modules, I actually fixed this in com-lihaoyi/mill#1988, so 0.10.6 should support this. However right now I say anything that starts with a
0.1
is supported, but I may need to change that to be > 0.10.6 or above.Refs #306
Test plan
There is a test for the Mill integration