Skip to content
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

Prevent compilation during bloop config generation #1352

Merged
merged 3 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contrib/bloop/src/mill/contrib/bloop/BloopImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class BloopImpl(ev: () => Evaluator, wd: Path) extends ExternalModule { outer =>

def bloopConfig(module: JavaModule): Task[BloopConfig.File] = {
import _root_.bloop.config.Config
def out(m: JavaModule) = {
def out(m: JavaModule) = {
val allSegs = m.millModuleShared.value.getOrElse(Segments()) ++ m.millModuleSegments
bloopDir / "out" / allSegs.render
}
Expand Down Expand Up @@ -264,7 +264,7 @@ class BloopImpl(ev: () => Evaluator, wd: Path) extends ExternalModule { outer =>
),
mainClass = module.mainClass(),
runtimeConfig = None,
classpath = Some(module.compileClasspath().map(_.path.toNIO).toList),
classpath = None,
resources = Some(module.resources().map(_.path.toNIO).toList)
)
}
Expand Down
10 changes: 10 additions & 0 deletions contrib/bloop/test/src/mill/contrib/bloop/BloopTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ object BloopTests extends TestSuite {
// skipped on Windows
val scalanativeModuleConfig = if(scala.util.Properties.isWin) None else Some(readBloopConf("scalanativeModule.json"))

"no-compilation" - {
val workspaceOut = os.pwd / "target" / "workspace" / "mill" / "contrib" / "bloop" / "BloopTests" / "testEvaluator"

// Ensuring that bloop config generation didn't trigger compilation
assert(os.exists(workspaceOut / "scalaModule"))
assert(!os.exists(workspaceOut / "scalaModule" / "compile"))
assert(os.exists(workspaceOut / "scalaModule2"))
assert(!os.exists(workspaceOut / "scalaModule2" / "compile"))
}

"scalaModule" - {
val p = scalaModuleConfig.project
val name = p.name
Expand Down