diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-19 20:08:29 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-19 20:08:29 -0800 |
commit | aebd7a144fab5bdb95f6ee4f4bc170be65cd0549 (patch) | |
tree | ce816842d9ed0408a3540726acd7c8ae8eddc758 /core/src | |
parent | 7f2dafaaa89d204c7bbe986f38fa5817ee7a091b (diff) | |
download | mill-aebd7a144fab5bdb95f6ee4f4bc170be65cd0549.tar.gz mill-aebd7a144fab5bdb95f6ee4f4bc170be65cd0549.tar.bz2 mill-aebd7a144fab5bdb95f6ee4f4bc170be65cd0549.zip |
Use the classloader that defines the `build.sc` root Module to get a classpath signature, to ensure that changes to the root module definition flush caches
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/scala/mill/eval/Evaluator.scala | 1 | ||||
-rw-r--r-- | core/src/main/scala/mill/main/RunScript.scala | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/src/main/scala/mill/eval/Evaluator.scala b/core/src/main/scala/mill/eval/Evaluator.scala index 8f9ff8a2..44f24275 100644 --- a/core/src/main/scala/mill/eval/Evaluator.scala +++ b/core/src/main/scala/mill/eval/Evaluator.scala @@ -34,7 +34,6 @@ class Evaluator[T](val workspacePath: Path, val classLoaderSig: Seq[(Path, Long)] = Evaluator.classLoaderSig){ - val workerCache = mutable.Map.empty[Ctx.Loader[_], Any] workerCache(RootModuleLoader) = rootModule def evaluate(goals: Agg[Task[_]]): Evaluator.Results = { diff --git a/core/src/main/scala/mill/main/RunScript.scala b/core/src/main/scala/mill/main/RunScript.scala index 010f134b..aa254048 100644 --- a/core/src/main/scala/mill/main/RunScript.scala +++ b/core/src/main/scala/mill/main/RunScript.scala @@ -4,6 +4,7 @@ import java.nio.file.NoSuchFileException import ammonite.interp.Interpreter import ammonite.ops.{Path, read} +import ammonite.runtime.SpecialClassLoader import ammonite.util.Util.CodeSource import ammonite.util.{Name, Res, Util} import mill.{PathRef, define} @@ -40,7 +41,13 @@ object RunScript{ interp.watch(path) val eval = for((mapping, discover) <- evaluateMapping(wd, path, interp)) - yield (new Evaluator(wd / 'out, wd, mapping, log), discover) + yield ( + new Evaluator( + wd / 'out, wd, mapping, log, + mapping.getClass.getClassLoader.asInstanceOf[SpecialClassLoader].classpathSignature + ), + discover + ) (eval, interp.watchedFiles) } } |