diff --git a/internal/compiler-bridge/src/main/scala-2.12/xsbt/Compat.scala b/internal/compiler-bridge/src/main/scala-2.12/xsbt/Compat.scala index 48a691e6f8..a9c129a13b 100644 --- a/internal/compiler-bridge/src/main/scala-2.12/xsbt/Compat.scala +++ b/internal/compiler-bridge/src/main/scala-2.12/xsbt/Compat.scala @@ -22,7 +22,11 @@ abstract class Compat { /** If given tree contains object tree attachment calls func on tree from attachment. */ protected def processOriginalTreeAttachment(in: Tree)(func: Tree => Unit): Unit = { - Compat.OriginalTreeTraverser.Instance.traverseOriginal(in)(func) + // We can't until we figure out how to conditionally do this for Scala 2.12.3+ + // import analyzer._ + // in.attachments.get[OriginalTreeAttachment].foreach { a => + // func(a.original) + // } } } object Compat { @@ -31,32 +35,6 @@ object Compat { // IMain in 2.13 accepts ReplReporter def replReporter(settings: Settings, writer: PrintWriter) = writer - - sealed abstract class OriginalTreeTraverser private { - def traverseOriginal[T <: Global#Tree](t: T)(f: T => Unit): Unit - } - - object OriginalTreeTraverser { - private[this] val cls = try { - Class.forName("scala.tools.nsc.typechecker.StdAttachments$OriginalTreeAttachment") - } catch { case _: Throwable => null } - - private object Reflective extends OriginalTreeTraverser { - private[this] val ct = scala.reflect.ClassTag[AnyRef](cls) - private[this] val meth = cls.getMethod("original") - def traverseOriginal[T <: Global#Tree](t: T)(f: T => Unit): Unit = - t.attachments.get(ct) match { - case Some(attachment) => f(meth.invoke(attachment).asInstanceOf[T]) - case None => - } - } - - private object NoOp extends OriginalTreeTraverser { - def traverseOriginal[T <: Global#Tree](t: T)(f: T => Unit): Unit = () - } - - val Instance = if (cls == null) NoOp else Reflective - } } /** Defines compatibility utils for [[ZincCompiler]]. */ diff --git a/project/Dependencies.scala b/project/Dependencies.scala index eb32fe66c2..ceead04ca8 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -14,7 +14,7 @@ object Dependencies { val scala212_213 = Seq(defaultScalaVersion, scala213) private val ioVersion = nightlyVersion.getOrElse("1.5.1") - private val utilVersion = nightlyVersion.getOrElse("1.5.6") + private val utilVersion = nightlyVersion.getOrElse("1.5.7") private val sbtIO = "org.scala-sbt" %% "io" % ioVersion @@ -84,7 +84,7 @@ object Dependencies { } val zeroAllocationHashing = "net.openhft" % "zero-allocation-hashing" % "0.10.1" - def log4jVersion = "2.11.2" + def log4jVersion = "2.16.0" val log4jApi = "org.apache.logging.log4j" % "log4j-api" % log4jVersion val log4jCore = "org.apache.logging.log4j" % "log4j-core" % log4jVersion val log4jSlf4jImpl = "org.apache.logging.log4j" % "log4j-slf4j-impl" % log4jVersion diff --git a/zinc/src/sbt-test/source-dependencies/constants/test b/zinc/src/sbt-test/source-dependencies/constants/disabled similarity index 100% rename from zinc/src/sbt-test/source-dependencies/constants/test rename to zinc/src/sbt-test/source-dependencies/constants/disabled diff --git a/zinc/src/test/scala/sbt/inc/BaseCompilerSpec.scala b/zinc/src/test/scala/sbt/inc/BaseCompilerSpec.scala index 8fafc985bc..7a332ab9ac 100644 --- a/zinc/src/test/scala/sbt/inc/BaseCompilerSpec.scala +++ b/zinc/src/test/scala/sbt/inc/BaseCompilerSpec.scala @@ -49,6 +49,8 @@ class BaseCompilerSpec extends BridgeProviderSpecification { implicit class ProjectSetupOps(setup: ProjectSetup) { def createCompiler(): CompilerSetup = setup.createCompiler(scalaVersion, incOptions) + def createCompiler(scalaVersion: String): CompilerSetup = + setup.createCompiler(scalaVersion, incOptions) private def createCompiler(sv: String, incOptions: IncOptions): CompilerSetup = { val si = scalaInstance(sv, setup.baseDir, Logger.Null) diff --git a/zinc/src/test/scala/sbt/inc/IncrementalCompilerSpec.scala b/zinc/src/test/scala/sbt/inc/IncrementalCompilerSpec.scala index 90501bf5b9..eb4afca004 100644 --- a/zinc/src/test/scala/sbt/inc/IncrementalCompilerSpec.scala +++ b/zinc/src/test/scala/sbt/inc/IncrementalCompilerSpec.scala @@ -192,7 +192,7 @@ class IncrementalCompilerSpec extends BaseCompilerSpec { it should "track dependencies on constants" in withTmpDir { tmp => val project = VirtualSubproject(tmp.toPath / "p1") - val comp = project.setup.createCompiler() + val comp = project.setup.createCompiler("2.13.6") try { val s1 = "object A { final val i = 1 }" val s1b = "object A { final val i = 2 }"