From 6725b39a84c36cae707a354cf92a9ce4ffc7a109 Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Fri, 24 Aug 2018 13:10:18 -0700 Subject: [PATCH] Bump io to 1.3.0-M3 I had to turn off -Xfatal-warnings in commandProj because after updating io, commandProj depends on the deprecated EventMonitor class. In #4335, I stop using EventMonitor, but deprecate the Watched class which is both defined and used (as an unused attribute key) in commandProj. I think we can probably get rid of Watched in 1.4.x and certainly in a hypothetical 2.x, so hopefully we can restore -Xfatal-warnings sooner than later. I also had to replace uses of IO.classLocationFile with IO.classLocationPath to avoid compilation failures due to -Xfatal-warnings. --- build.sbt | 2 ++ main-actions/src/main/scala/sbt/ForkTests.scala | 4 ++-- main-actions/src/main/scala/sbt/compiler/Eval.scala | 2 +- main/src/main/scala/sbt/internal/parser/SbtParser.scala | 2 +- project/Dependencies.scala | 2 +- run/src/test/scala/sbt/ForkTest.scala | 4 ++-- testing/src/main/scala/sbt/TestFramework.scala | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index 0ad50dc68..0dd097327 100644 --- a/build.sbt +++ b/build.sbt @@ -459,6 +459,8 @@ lazy val commandProj = (project in file("main-command")) name := "Command", libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi), Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates", + // Removing -Xfatal-warnings is necessary because BasicKeys contains a Key for a deprecated class. + Compile / scalacOptions -= "-Xfatal-warnings", managedSourceDirectories in Compile += baseDirectory.value / "src" / "main" / "contraband-scala", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", diff --git a/main-actions/src/main/scala/sbt/ForkTests.scala b/main-actions/src/main/scala/sbt/ForkTests.scala index 87c7581b8..c2bf44ddd 100755 --- a/main-actions/src/main/scala/sbt/ForkTests.scala +++ b/main-actions/src/main/scala/sbt/ForkTests.scala @@ -125,8 +125,8 @@ private[sbt] object ForkTests { acceptorThread.start() val fullCp = classpath ++: Seq( - IO.classLocationFile[ForkMain], - IO.classLocationFile[Framework] + IO.classLocationPath[ForkMain].toFile, + IO.classLocationPath[Framework].toFile ) val options = Seq( "-classpath", diff --git a/main-actions/src/main/scala/sbt/compiler/Eval.scala b/main-actions/src/main/scala/sbt/compiler/Eval.scala index 41af56520..914867a67 100644 --- a/main-actions/src/main/scala/sbt/compiler/Eval.scala +++ b/main-actions/src/main/scala/sbt/compiler/Eval.scala @@ -69,7 +69,7 @@ final class Eval( backing: Option[File] ) { def this(mkReporter: Settings => Reporter, backing: Option[File]) = - this(Nil, IO.classLocationFile[Product] :: Nil, mkReporter, backing) + this(Nil, IO.classLocationPath[Product].toFile :: Nil, mkReporter, backing) def this() = this(s => new ConsoleReporter(s), None) backing.foreach(IO.createDirectory) diff --git a/main/src/main/scala/sbt/internal/parser/SbtParser.scala b/main/src/main/scala/sbt/internal/parser/SbtParser.scala index 98952dd89..22020d30d 100644 --- a/main/src/main/scala/sbt/internal/parser/SbtParser.scala +++ b/main/src/main/scala/sbt/internal/parser/SbtParser.scala @@ -42,7 +42,7 @@ private[sbt] object SbtParser { """.stripMargin private final val defaultClasspath = - sbt.io.Path.makeString(sbt.io.IO.classLocationFile[Product] :: Nil) + sbt.io.Path.makeString(sbt.io.IO.classLocationPath[Product].toFile :: Nil) /** * Provides the previous error reporting functionality in diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 940c35405..1f73ef56f 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -9,7 +9,7 @@ object Dependencies { val baseScalaVersion = scala212 // sbt modules - private val ioVersion = "1.2.1" + private val ioVersion = "1.3.0-M3" private val utilVersion = "1.3.0-M2" private val lmVersion = "1.2.1" private val zincVersion = "1.2.2" diff --git a/run/src/test/scala/sbt/ForkTest.scala b/run/src/test/scala/sbt/ForkTest.scala index 96c4aed34..eed1b4b98 100644 --- a/run/src/test/scala/sbt/ForkTest.scala +++ b/run/src/test/scala/sbt/ForkTest.scala @@ -31,8 +31,8 @@ object ForkTest extends Properties("Fork") { lazy val genRelClasspath = nonEmptyListOf(path) lazy val requiredEntries = - IO.classLocationFile[scala.Option[_]] :: - IO.classLocationFile[sbt.exit.type] :: + IO.classLocationPath[scala.Option[_]].toFile :: + IO.classLocationPath[sbt.exit.type].toFile :: Nil lazy val mainAndArgs = "sbt.exit" :: diff --git a/testing/src/main/scala/sbt/TestFramework.scala b/testing/src/main/scala/sbt/TestFramework.scala index 82d6e75a5..ad8b8d91f 100644 --- a/testing/src/main/scala/sbt/TestFramework.scala +++ b/testing/src/main/scala/sbt/TestFramework.scala @@ -250,7 +250,7 @@ object TestFramework { scalaInstance: ScalaInstance, tempDir: File ): ClassLoader = { - val interfaceJar = IO.classLocationFile(classOf[testing.Framework]) + val interfaceJar = IO.classLocationPath(classOf[testing.Framework]).toFile val interfaceFilter = (name: String) => name.startsWith("org.scalatools.testing.") || name.startsWith("sbt.testing.") val notInterfaceFilter = (name: String) => !interfaceFilter(name)