Skip to content

Commit 8d8a376

Browse files
authored
Merge pull request sbt#6291 from eed3si9n/wip/bump_scala2_12_13
Scala 2.12.13
2 parents 0a6e5c3 + 68bd693 commit 8d8a376

File tree

31 files changed

+106
-100
lines changed

31 files changed

+106
-100
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
runs-on: ${{ matrix.os }}
3131
env:
3232
JAVA_OPTS: -Xms800M -Xmx2G -Xss6M -XX:ReservedCodeCacheSize=128M -server -Dsbt.io.virtual=false -Dfile.encoding=UTF-8
33-
SCALA_212: 2.12.12
34-
SCALA_213: 2.13.1
33+
SCALA_212: 2.12.13
34+
SCALA_213: 2.13.3
3535
UTIL_TESTS: utilCache/test;utilControl/test;utilInterface/test;utilLogging/test;utilPosition/test;utilRelation/test;utilScripted/test;utilTracking/test
3636
SBT_LOCAL: false
3737
steps:

build.sbt

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,12 @@ def commonBaseSettings: Seq[Setting[_]] = Def.settings(
106106
crossScalaVersions := List(scala212, scala213),
107107
publishArtifact in Test := false,
108108
fork in run := true,
109-
libraryDependencies ++= {
110-
if (autoScalaLibrary.value) List(silencerLib)
111-
else Nil
112-
},
113109
)
114110
def commonSettings: Seq[Setting[_]] =
115111
commonBaseSettings :+
116-
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full)
112+
addCompilerPlugin(kindProjector)
117113
def utilCommonSettings: Seq[Setting[_]] =
118-
commonBaseSettings :+ (crossScalaVersions := (scala212 :: scala213 :: Nil))
114+
baseSettings :+ (crossScalaVersions := (scala212 :: scala213 :: Nil))
119115

120116
def minimalSettings: Seq[Setting[_]] =
121117
commonSettings ++ customCommands ++
@@ -329,10 +325,6 @@ val logicProj = (project in file("internal") / "util-logic")
329325
testedBaseSettings,
330326
name := "Logic",
331327
mimaSettings,
332-
libraryDependencies ++= (scalaVersion.value match {
333-
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
334-
case _ => List()
335-
}),
336328
)
337329

338330
// defines Java structures used across Scala versions, such as the API structures and relationships extracted by
@@ -382,10 +374,6 @@ lazy val utilLogging = (project in file("internal") / "util-logging")
382374
scalaReflect.value
383375
),
384376
libraryDependencies ++= Seq(scalacheck % "test", scalatest % "test"),
385-
libraryDependencies ++= (scalaVersion.value match {
386-
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
387-
case _ => List()
388-
}),
389377
Compile / scalacOptions ++= (scalaVersion.value match {
390378
case v if v.startsWith("2.12.") => List("-Ywarn-unused:-locals,-explicits,-privates")
391379
case _ => List()
@@ -622,10 +610,6 @@ lazy val scriptedSbtReduxProj = (project in file("scripted-sbt-redux"))
622610
baseSettings,
623611
name := "Scripted sbt Redux",
624612
libraryDependencies ++= Seq(launcherInterface % "provided"),
625-
libraryDependencies ++= (scalaVersion.value match {
626-
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
627-
case _ => List()
628-
}),
629613
mimaSettings,
630614
scriptedSbtReduxMimaSettings,
631615
)
@@ -753,10 +737,6 @@ lazy val commandProj = (project in file("main-command"))
753737
testedBaseSettings,
754738
name := "Command",
755739
libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi),
756-
libraryDependencies ++= (scalaVersion.value match {
757-
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
758-
case _ => List()
759-
}),
760740
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
761741
managedSourceDirectories in Compile +=
762742
baseDirectory.value / "src" / "main" / "contraband-scala",
@@ -932,10 +912,6 @@ lazy val mainProj = (project in file("main"))
932912
case v if v.startsWith("2.12.") => List()
933913
case _ => List(scalaPar)
934914
}),
935-
libraryDependencies ++= (scalaVersion.value match {
936-
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
937-
case _ => List()
938-
}),
939915
managedSourceDirectories in Compile +=
940916
baseDirectory.value / "src" / "main" / "contraband-scala",
941917
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",

internal/util-collection/src/main/scala/sbt/internal/util/TypeFunctions.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ trait TypeFunctions {
1818
private type AnyLeft[T] = Left[T, Nothing]
1919
private type AnyRight[T] = Right[Nothing, T]
2020

21-
final val left: Id ~> Left[?, Nothing] =
21+
final val left: Id ~> Left[*, Nothing] =
2222
λ[Id ~> AnyLeft](Left(_)).setToString("TypeFunctions.left")
23-
final val right: Id ~> Right[Nothing, ?] =
23+
final val right: Id ~> Right[Nothing, *] =
2424
λ[Id ~> AnyRight](Right(_)).setToString("TypeFunctions.right")
25-
final val some: Id ~> Some[?] = λ[Id ~> Some](Some(_)).setToString("TypeFunctions.some")
25+
final val some: Id ~> Some[*] = λ[Id ~> Some](Some(_)).setToString("TypeFunctions.some")
2626
final def idFun[T]: T => T = ((t: T) => t).setToString("TypeFunctions.id")
2727
final def const[A, B](b: B): A => B = ((_: A) => b).setToString(s"TypeFunctions.const($b)")
2828
final def idK[M[_]]: M ~> M = λ[M ~> M](m => m).setToString("TypeFunctions.idK")

internal/util-logging/src/main/scala/sbt/internal/util/FilterLogger.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
package sbt.internal.util
99

1010
import sbt.util._
11-
import com.github.ghik.silencer.silent
11+
import scala.annotation.nowarn
1212

1313
/**
1414
* A filter logger is used to delegate messages but not the logging level to another logger. This means
1515
* that messages are logged at the higher of the two levels set by this logger and its delegate.
1616
*/
1717
class FilterLogger(delegate: AbstractLogger) extends BasicLogger {
18-
@silent override lazy val ansiCodesSupported = delegate.ansiCodesSupported
18+
@nowarn override lazy val ansiCodesSupported = delegate.ansiCodesSupported
1919
def trace(t: => Throwable): Unit = {
2020
if (traceEnabled)
2121
delegate.trace(t)

internal/util-logging/src/main/scala/sbt/internal/util/MultiLogger.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
package sbt.internal.util
99

1010
import sbt.util._
11-
import com.github.ghik.silencer.silent
11+
import scala.annotation.nowarn
1212

1313
// note that setting the logging level on this logger has no effect on its behavior, only
1414
// on the behavior of the delegates.
1515
class MultiLogger(delegates: List[AbstractLogger]) extends BasicLogger {
1616
@deprecated("No longer used.", "1.0.0")
1717
override lazy val ansiCodesSupported = delegates exists supported
18-
@silent private[this] def supported = (_: AbstractLogger).ansiCodesSupported
18+
@nowarn private[this] def supported = (_: AbstractLogger).ansiCodesSupported
1919

2020
override def setLevel(newLevel: Level.Value): Unit = {
2121
super.setLevel(newLevel)

internal/util-logging/src/test/scala/ManagedLoggerSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import org.scalatest._
1111
import sbt.util._
1212
import java.io.{ File, PrintWriter }
1313
import sbt.io.Using
14-
import com.github.ghik.silencer.silent
14+
import scala.annotation.nowarn
1515

1616
class ManagedLoggerSpec extends FlatSpec with Matchers {
1717
val context = LoggerContext(useLog4J = true)
18-
@silent
18+
@nowarn
1919
val asyncStdout = new ConsoleAppenderFromLog4J("asyncStdout", LogExchange.asyncStdout)
2020
def newLogger(name: String): ManagedLogger = context.logger(name, None, None)
2121
"ManagedLogger" should "log to console" in {

internal/util-logic/src/main/scala/sbt/internal/util/logic/Logic.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
package sbt.internal.util
99
package logic
1010

11-
import scala.annotation.tailrec
11+
import scala.annotation.{ nowarn, tailrec }
1212
import Formula.{ And, True }
1313

1414
/*
@@ -152,7 +152,7 @@ object Logic {
152152
if (contradictions.nonEmpty) Some(new InitialContradictions(contradictions)) else None
153153
}
154154

155-
@com.github.ghik.silencer.silent
155+
@nowarn
156156
private[this] def checkAcyclic(clauses: Clauses): Option[CyclicNegation] = {
157157
val deps = dependencyMap(clauses)
158158
// println(s"deps = $deps")

main-actions/src/test/scala/sbt/compiler/EvalTest.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ package compiler
1111
import scala.language.reflectiveCalls
1212
import org.scalacheck._
1313
import Prop._
14+
import scala.tools.nsc.Settings
1415
import scala.tools.nsc.reporters.StoreReporter
1516

1617
import sbt.io.IO
1718

1819
class EvalTest extends Properties("eval") {
19-
private[this] lazy val reporter = new StoreReporter
20-
import reporter.{ ERROR, Info }
20+
private[this] lazy val reporter = new StoreReporter(new Settings())
21+
import reporter.ERROR
2122
private[this] lazy val eval = new Eval(_ => reporter, None)
2223

2324
property("inferred integer") = forAll { (i: Int) =>
@@ -100,7 +101,7 @@ val p = {
100101
("Has errors" |: is.nonEmpty) &&
101102
all(is.toSeq.map(validPosition(line, src)): _*)
102103
}
103-
private[this] def validPosition(line: Int, src: String)(i: Info) = {
104+
private[this] def validPosition(line: Int, src: String)(i: StoreReporter.Info) = {
104105
val nme = i.pos.source.file.name
105106
(label("Severity", i.severity) |: (i.severity == ERROR)) &&
106107
(label("Line", i.pos.line) |: (i.pos.line == line)) &&

main-command/src/main/scala/sbt/BasicKeys.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ package sbt
99

1010
import java.io.File
1111

12-
import com.github.ghik.silencer.silent
1312
import sbt.internal.inc.classpath.{ ClassLoaderCache => IncClassLoaderCache }
1413
import sbt.internal.classpath.ClassLoaderCache
1514
import sbt.internal.server.ServerHandler
1615
import sbt.internal.util.AttributeKey
1716
import sbt.librarymanagement.ModuleID
1817
import sbt.util.Level
18+
import scala.annotation.nowarn
1919
import scala.concurrent.duration.FiniteDuration
2020

2121
object BasicKeys {
@@ -41,7 +41,7 @@ object BasicKeys {
4141
"The function that constructs the command prompt from the current build state for a given terminal.",
4242
10000
4343
)
44-
@silent val watch =
44+
@nowarn val watch =
4545
AttributeKey[Watched]("watched", "Continuous execution configuration.", 1000)
4646
val serverPort =
4747
AttributeKey[Int]("server-port", "The port number used by server command.", 10000)

main/src/main/scala/sbt/Defaults.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ import sjsonnew.support.scalajson.unsafe.Converter
9191
import xsbti.compile.TastyFiles
9292
import xsbti.{ FileConverter, Position }
9393

94+
import scala.annotation.nowarn
9495
import scala.collection.immutable.ListMap
9596
import scala.concurrent.duration._
9697
import scala.util.Try
@@ -4083,7 +4084,7 @@ object Classpaths {
40834084
ivyRepo.allowInsecureProtocol
40844085
} catch { case _: NoSuchMethodError => false }
40854086

4086-
@com.github.ghik.silencer.silent
4087+
@nowarn
40874088
private[this] def bootRepository(repo: xsbti.Repository): Resolver = {
40884089
import xsbti.Predefined
40894090
repo match {
@@ -4346,7 +4347,7 @@ trait BuildExtra extends BuildCommon with DefExtra {
43464347
// I tried "Def.spaceDelimited().parsed" (after importing Def.parserToInput)
43474348
// but it broke actions/run-task
43484349
// Maybe it needs to be defined inside a Def.inputTask?
4349-
@com.github.ghik.silencer.silent
4350+
@nowarn
43504351
def inputTask[T](f: TaskKey[Seq[String]] => Initialize[Task[T]]): Initialize[InputTask[T]] =
43514352
InputTask.apply(Def.value((s: State) => Def.spaceDelimited()))(f)
43524353

main/src/main/scala/sbt/EvaluateTask.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import sbt.librarymanagement.{ Resolver, UpdateReport }
2222
import sbt.std.Transform.DummyTaskMap
2323
import sbt.util.{ Logger, Show }
2424

25+
import scala.annotation.nowarn
2526
import scala.Console.RED
2627
import scala.concurrent.duration.Duration
2728

@@ -154,7 +155,7 @@ object EvaluateTask {
154155
import Keys.state
155156
import std.Transform
156157

157-
@com.github.ghik.silencer.silent
158+
@nowarn
158159
lazy private val sharedProgress = new TaskTimings(reportOnShutdown = true)
159160
def taskTimingProgress: Option[ExecuteProgress[Task]] =
160161
if (SysProp.taskTimingsOnShutdown) Some(sharedProgress)

main/src/main/scala/sbt/Main.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import sbt.io.syntax._
3333
import sbt.util.{ Level, Logger, Show }
3434
import xsbti.compile.CompilerCache
3535

36-
import scala.annotation.tailrec
36+
import scala.annotation.{ nowarn, tailrec }
3737
import scala.concurrent.ExecutionContext
3838
import scala.concurrent.duration.Duration
3939
import scala.util.control.NonFatal
@@ -271,7 +271,7 @@ object BuiltinCommands {
271271
def ScriptCommands: Seq[Command] =
272272
Seq(ignore, exit, Script.command, setLogLevel, early, act, nop)
273273

274-
@com.github.ghik.silencer.silent
274+
@nowarn
275275
def DefaultCommands: Seq[Command] =
276276
Seq(
277277
multi,

main/src/main/scala/sbt/PluginCross.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private[sbt] object PluginCross {
9696
VersionNumber(sv) match {
9797
case VersionNumber(Seq(0, 12, _*), _, _) => "2.9.2"
9898
case VersionNumber(Seq(0, 13, _*), _, _) => "2.10.7"
99-
case VersionNumber(Seq(1, 0, _*), _, _) => "2.12.12"
99+
case VersionNumber(Seq(1, 0, _*), _, _) => "2.12.13"
100100
case _ => sys.error(s"Unsupported sbt binary version: $sv")
101101
}
102102
}

main/src/main/scala/sbt/internal/CompatParColls.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
package sbt.internal
99

10+
import scala.annotation.nowarn
11+
1012
// https://github.com/scala/scala-parallel-collections/issues/22
1113
private[sbt] object CompatParColls {
12-
@com.github.ghik.silencer.silent
14+
@nowarn
1315
val Converters = {
1416
import Compat._
1517
{

main/src/main/scala/sbt/internal/DeprecatedContinuous.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ package internal
1111
import java.nio.file.Path
1212
import java.util.concurrent.atomic.AtomicReference
1313

14-
import com.github.ghik.silencer.silent
1514
import sbt.{ ProjectRef, State, Watched }
1615
import sbt.internal.io.{ EventMonitor, Source, WatchState => WS }
1716
import sbt.internal.util.AttributeKey
1817
import sbt.nio.file.Glob
1918

20-
@silent
19+
import scala.annotation.nowarn
20+
21+
@nowarn
2122
private[internal] trait DeprecatedContinuous {
2223
protected type StartMessage =
2324
Option[Either[WS => String, (Int, ProjectRef, Seq[String]) => Option[String]]]
@@ -59,7 +60,7 @@ private[internal] trait DeprecatedContinuous {
5960
}
6061
}
6162

62-
@silent
63+
@nowarn
6364
private[sbt] object DeprecatedContinuous {
6465
private[sbt] val taskDefinitions: Seq[Def.Setting[_]] = Seq(
6566
sbt.Keys.watchTransitiveSources := sbt.Defaults.watchTransitiveSourcesTask.value,

main/src/main/scala/sbt/internal/KeyIndex.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ import sbt.internal.util.complete.DefaultParsers.validID
1414
import sbt.internal.util.Types.some
1515
import sbt.internal.util.{ AttributeKey, Relation }
1616
import sbt.librarymanagement.Configuration
17+
import scala.annotation.nowarn
1718

1819
object KeyIndex {
1920
def empty: ExtendableKeyIndex = new KeyIndex0(emptyBuildIndex)
20-
@com.github.ghik.silencer.silent
21+
22+
@nowarn
2123
def apply(
2224
known: Iterable[ScopedKey[_]],
2325
projects: Map[URI, Set[String]],
@@ -26,7 +28,8 @@ object KeyIndex {
2628
import sbt.internal.CompatParColls.Converters._
2729
known.par.foldLeft(base(projects, configurations)) { _ add _ }
2830
}
29-
@com.github.ghik.silencer.silent
31+
32+
@nowarn
3033
def aggregate(
3134
known: Iterable[ScopedKey[_]],
3235
extra: BuildUtil[_],

main/src/main/scala/sbt/internal/graph/rendering/DOT.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ object DOT {
2929
style
3030
)
3131
}
32-
}.mkString("\n")
32+
}.sorted.mkString("\n")
3333

3434
def originWasEvicted(edge: Edge): Boolean = graph.module(edge._1).isEvicted
3535
def targetWasEvicted(edge: Edge): Boolean = graph.module(edge._2).isEvicted
@@ -63,9 +63,9 @@ object DOT {
6363
else ""
6464
""" "%s" -> "%s"%s""".format(e._1.idString, e._2.idString, extra)
6565
}
66-
}.mkString("\n")
66+
}.sorted.mkString("\n")
6767

68-
"%s\n%s\n%s\n}".format(dotHead, nodes, edges)
68+
s"$dotHead\n$nodes\n$edges\n}"
6969
}
7070

7171
sealed trait HTMLLabelRendering {

main/src/main/scala/sbt/internal/graph/rendering/TreeView.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ import java.net.URI
1616
import graph.{ Module, ModuleGraph }
1717
import sbt.io.IO
1818

19-
import scala.annotation.tailrec
19+
import scala.annotation.{ nowarn, tailrec }
2020
import scala.util.parsing.json.{ JSONArray, JSONObject }
21-
import com.github.ghik.silencer.silent
2221

23-
@silent object TreeView {
22+
@nowarn object TreeView {
2423
def createJson(graph: ModuleGraph): String = {
2524
val trees = graph.roots
2625
.map(module => processSubtree(graph, module))

0 commit comments

Comments
 (0)