diff options
3 files changed, 11 insertions, 13 deletions
diff --git a/core/src/main/scala/mill/eval/Evaluator.scala b/core/src/main/scala/mill/eval/Evaluator.scala index 007e1755..db74445c 100644 --- a/core/src/main/scala/mill/eval/Evaluator.scala +++ b/core/src/main/scala/mill/eval/Evaluator.scala @@ -115,6 +115,11 @@ class Evaluator(workspacePath: Path, write.over(metadataPath, upickle.default.write(inputsHash -> terminalResult, indent = 4)) case _ => + // Wipe out any cached metadata.mill.json file that exists, so + // a following run won't look at the cached metadata file and + // assume it's associated with the possibly-borked state of the + // destPath after an evaluation failure. + rm(metadataPath) } diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala index 504fe93e..766bdd36 100644 --- a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala +++ b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala @@ -292,7 +292,8 @@ trait ScalaModule extends Module with TaskModule{ outer => compileDepClasspath().map(_.path), scalacOptions(), javacOptions(), - T.ctx().dest) + T.ctx().dest + ) } def assembly = T{ val dest = T.ctx().dest diff --git a/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala b/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala index 61da0a47..4f41de9a 100644 --- a/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala +++ b/scalaplugin/src/test/scala/mill/scalaplugin/AcyclicTests.scala @@ -85,30 +85,22 @@ object AcyclicTests extends TestSuite{ // Compilation can fail on broken code, and work when fixed write.append(packageScala, "\n}}") val Left(Result.Exception(ex)) = eval(AcyclicBuild.acyclic("2.12.4").compile) - assert(ex.isInstanceOf[sbt.internal.inc.CompileFailed]) write.write(packageScala, read(packageScala).dropRight(3)) - val Right(_) = eval(AcyclicBuild.acyclic("2.12.4").compile) - // Still doesn't work =( - // val Right(_) = eval(AcyclicBuild.acyclic("2.12.4").test.forkTest()) - } - - 'tests - { - // Tests can run + // Tests compile & run val Right(_) = eval(AcyclicBuild.acyclic("2.12.4").test.forkTest()) - // Be broken + // Tests can be broken write.append(packageScala, "\n}}") - eval(AcyclicBuild.acyclic("2.12.4").test.compile) val Left(_) = eval(AcyclicBuild.acyclic("2.12.4").test.forkTest()) - // And run again when fixed + // Tests can be fixed write.write(packageScala, read(packageScala).dropRight(3)) - val Right(_) = eval(AcyclicBuild.acyclic("2.12.4").test.forkTest()) } + } } |