Make CaffeineCache a lazy val

This is to avoid it initialising Log4J2 (via SLF4J), which we initialise
ourselves programmatically in LogExchange. Also there's no need to
removeAll in initialState.

Fixes #3787
This commit is contained in:
Dale Wijnand 2017-12-15 08:55:53 +00:00
parent 4248f5a0af
commit 8bd522511d
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
1 changed files with 1 additions and 4 deletions

View File

@ -103,7 +103,7 @@ object StandardMain {
private[sbt] lazy val exchange = new CommandExchange()
import scalacache._
import scalacache.caffeine._
private[sbt] val cache: Cache[Any] = CaffeineCache[Any]
private[sbt] lazy val cache: Cache[Any] = CaffeineCache[Any]
def runManaged(s: State): xsbti.MainResult = {
val previous = TrapExit.installManager()
@ -135,9 +135,6 @@ object StandardMain {
Exec(x, None)
}
val initAttrs = BuiltinCommands.initialAttributes
import scalacache.modes.scalaFuture._
import scala.concurrent.ExecutionContext.Implicits.global
cache.removeAll()
val s = State(
configuration,
initialDefinitions,