-
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
Add basic mill integration #532
Conversation
project/Dependencies.scala
Outdated
@@ -66,4 +67,5 @@ object Dependencies { | |||
|
|||
val scalaNativeTools = "org.scala-native" %% "tools" % scalaNativeVersion | |||
val scalaJsTools = "org.scala-js" %% "scalajs-tools" % scalaJsVersion | |||
val mill = "com.lihaoyi" %% "mill-scalalib" % millVersion |
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.
probably should tag this as "provided"
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.
Yes, I think so. It depends on how mill implements plugin classloading, but if the mill classloader is the parent of your plugin classloader, it should be Provided
👍
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.
Addressed in 4943ed5 (tested locally)
java = javaConfig(), | ||
test = testConfig(), | ||
platform = Config.Platform.JVM, | ||
nativeConfig = None, |
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.
filling this will depend on com-lihaoyi/mill#206
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 integration looks great and simple. Still some information to extract, but it has the bare minimum to already provide value to people, so I'll be merging today!
I first need to rebase the PR with the latest changes I did in another PR that will be merging soon. Those changes break some parts of the API you use here (we're preparing the final version of the bloop configuration file so we're polishing it). Do you have any more changes you want to include before I rebase?
By the way, I'm curious, how long does it take to generate the bloop configuration file?
Thanks @Baccata 🙏
project/Dependencies.scala
Outdated
@@ -66,4 +67,5 @@ object Dependencies { | |||
|
|||
val scalaNativeTools = "org.scala-native" %% "tools" % scalaNativeVersion | |||
val scalaJsTools = "org.scala-js" %% "scalajs-tools" % scalaJsVersion | |||
val mill = "com.lihaoyi" %% "mill-scalalib" % millVersion |
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.
Yes, I think so. It depends on how mill implements plugin classloading, but if the mill classloader is the parent of your plugin classloader, it should be Provided
👍
Just pushed the "provided"
I nuked my mill cache, and running the |
Does Would you mind creating a ticket to keep track of that? |
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, I'm looking forward to trying that in Mill!
Does Mill support sources / resources generators? If it does, are they run when doing bloopInstall
?
Also, could you please also add millBloop
to the install
alias and to allBloopReleases
at the end of build.sbt
?
(I'll be pushing to this branch in half an hour or so to rebase everything.) |
Nope, I made sure that's not the case. When I said "compilation of the build", I meant compilation of the build file itself and all the ammonite script it depends on, not the modules. @Duhemm, Mill does provide a |
.resolveDeps(T.task { module.compileIvyDeps() ++ module.transitiveIvyDeps() }) | ||
.map(_.map(_.path).toSeq) | ||
|
||
def transitiveClasspath(m: JavaModule): Task[Seq[Path]] = T.task { |
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.
@jvican this is what I had to re-implement (rather than calling the mill one directly) to make sure the install
task does not call upon the compile
task
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.
Great! I cannot get back to the rebase tonight but wil do tomorrow morning.
Adds a `bloop.integrations.mill.BloopModule` mill external module that can be used to generate bloop config from mill. See https://www.lihaoyi.com/mill/page/modules.html#external-modules The suppot is limited to JVM project at the moment, and does not fill the "resolution" configuration element. Usage : 1. add ```import $ivy.``ch.epfl.scala::mill-bloop:$bloopVersion` ``` in the build.sc of a project (it's probably possible to add it to a `~/.mill/ammonite/predef.sc` or a similar file instead) 2. run `mill bloop.integrations.mill.BloopModule/install` from the directory of the mill project.
Done! Thanks again for the contribution @Baccata 👍 |
Adds a
bloop.integrations.mill.Bloop
mill external module that can be used to generate bloop config from mill. The support is limited to JVM modules at the moment, and does not fill the "resolution" configuration element.See https://www.lihaoyi.com/mill/page/modules.html#external-modules
Usage :
add
import $ivy.`ch.epfl.scala::mill-bloop:$bloopVersion`
to the build.sc of a project (it's probably possible to add it to a~/.mill/ammonite/predef.sc
or a similar file instead)run
mill bloop.integrations.mill.Bloop/install
from the directory of the mill project.NB :
Due to some obscure bug that prevents me from safely running non-brewed bloop, I'm only able to run
1.0.0-M10
, which fails to run the tests on my machine due to a bug in nuprocess.