Skip to content

Commit

Permalink
Always resolve compiler bridge in prepareOffline (#2791)
Browse files Browse the repository at this point in the history
This PR changed the behavior of `ScalaModule.prepareOffline`. Before, it
only fetched the compiler bridge when the `--all` flag was given. But
the compiler bridge is always needed to compile, hence I removed the
need for the `--all` flag.

Pull request: #2791
  • Loading branch information
lefou authored Sep 28, 2023
1 parent 80ff26e commit a614c89
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions scalalib/src/mill/scalalib/ScalaModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -481,21 +481,14 @@ trait ScalaModule extends JavaModule with TestModule.ScalaModuleBase { outer =>
*/
@nowarn("msg=pure expression does nothing")
override def prepareOffline(all: Flag): Command[Unit] = {
val ammonite = resolvedAmmoniteReplIvyDeps
val tasks =
if (all.value) Seq(
resolvedAmmoniteReplIvyDeps,
T.task {
zincWorker().scalaCompilerBridgeJar(
scalaVersion(),
scalaOrganization(),
repositoriesTask()
)
}
)
if (all.value) Seq(ammonite)
else Seq()

T.command {
super.prepareOffline(all)()
// resolve the compile bridge jar
resolveDeps(T.task {
val bind = bindDependency()
scalacPluginIvyDeps().map(bind)
Expand All @@ -504,6 +497,11 @@ trait ScalaModule extends JavaModule with TestModule.ScalaModuleBase { outer =>
val bind = bindDependency()
scalaDocPluginIvyDeps().map(bind)
})()
zincWorker().scalaCompilerBridgeJar(
scalaVersion(),
scalaOrganization(),
repositoriesTask()
)
T.sequence(tasks)()
()
}
Expand Down

0 comments on commit a614c89

Please sign in to comment.