From d9e8ae18b2b3de0da3dd8fe5db669614d64af174 Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Wed, 10 Oct 2018 16:45:22 -0700 Subject: [PATCH] Fix default FileTreeViewConfig It was possible that on startup, when this function was first invoked, that the default boot commands are present. This was a problem because the global file repository is instantiated using the value of this task. When we start a continuous build, this task gets run again to evaluate again. When sbt is started without an implicit task list, then the task is implicitly shell as indicated by the command "iflast shell". We can use this to determine whether or not to use the global file system cache or not. --- main/src/main/scala/sbt/internal/FileManagement.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/src/main/scala/sbt/internal/FileManagement.scala b/main/src/main/scala/sbt/internal/FileManagement.scala index 15a17461a..9d4cf4fb1 100644 --- a/main/src/main/scala/sbt/internal/FileManagement.scala +++ b/main/src/main/scala/sbt/internal/FileManagement.scala @@ -23,9 +23,11 @@ private[sbt] object FileManagement { // If the session is interactive or if the commands include a continuous build, then use // the default configuration. Otherwise, use the sbt1_2_compat config, which does not cache // anything, which makes it less likely to cause issues with CI. - val interactive = remaining.contains("shell") && !remaining.contains("setUpScripted") + val interactive = remaining.contains("shell") || remaining.lastOption.contains("iflast shell") + val scripted = remaining.contains("setUpScripted") + val continuous = remaining.exists(_.startsWith(ContinuousExecutePrefix)) - if (interactive || continuous) { + if (!scripted && (interactive || continuous)) { FileTreeViewConfig .default(watchAntiEntropy.value, pollInterval.value, pollingDirectories.value) } else FileTreeViewConfig.sbt1_2_compat(pollInterval.value, watchAntiEntropy.value)