mirror of https://github.com/sbt/sbt.git
Merge pull request #6291 from eed3si9n/wip/bump_scala2_12_13
Scala 2.12.13
This commit is contained in:
commit
8d8a376757
|
|
@ -30,8 +30,8 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
JAVA_OPTS: -Xms800M -Xmx2G -Xss6M -XX:ReservedCodeCacheSize=128M -server -Dsbt.io.virtual=false -Dfile.encoding=UTF-8
|
||||
SCALA_212: 2.12.12
|
||||
SCALA_213: 2.13.1
|
||||
SCALA_212: 2.12.13
|
||||
SCALA_213: 2.13.3
|
||||
UTIL_TESTS: utilCache/test;utilControl/test;utilInterface/test;utilLogging/test;utilPosition/test;utilRelation/test;utilScripted/test;utilTracking/test
|
||||
SBT_LOCAL: false
|
||||
steps:
|
||||
|
|
|
|||
28
build.sbt
28
build.sbt
|
|
@ -106,16 +106,12 @@ def commonBaseSettings: Seq[Setting[_]] = Def.settings(
|
|||
crossScalaVersions := List(scala212, scala213),
|
||||
publishArtifact in Test := false,
|
||||
fork in run := true,
|
||||
libraryDependencies ++= {
|
||||
if (autoScalaLibrary.value) List(silencerLib)
|
||||
else Nil
|
||||
},
|
||||
)
|
||||
def commonSettings: Seq[Setting[_]] =
|
||||
commonBaseSettings :+
|
||||
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.11.0" cross CrossVersion.full)
|
||||
addCompilerPlugin(kindProjector)
|
||||
def utilCommonSettings: Seq[Setting[_]] =
|
||||
commonBaseSettings :+ (crossScalaVersions := (scala212 :: scala213 :: Nil))
|
||||
baseSettings :+ (crossScalaVersions := (scala212 :: scala213 :: Nil))
|
||||
|
||||
def minimalSettings: Seq[Setting[_]] =
|
||||
commonSettings ++ customCommands ++
|
||||
|
|
@ -329,10 +325,6 @@ val logicProj = (project in file("internal") / "util-logic")
|
|||
testedBaseSettings,
|
||||
name := "Logic",
|
||||
mimaSettings,
|
||||
libraryDependencies ++= (scalaVersion.value match {
|
||||
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
|
||||
case _ => List()
|
||||
}),
|
||||
)
|
||||
|
||||
// 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")
|
|||
scalaReflect.value
|
||||
),
|
||||
libraryDependencies ++= Seq(scalacheck % "test", scalatest % "test"),
|
||||
libraryDependencies ++= (scalaVersion.value match {
|
||||
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
|
||||
case _ => List()
|
||||
}),
|
||||
Compile / scalacOptions ++= (scalaVersion.value match {
|
||||
case v if v.startsWith("2.12.") => List("-Ywarn-unused:-locals,-explicits,-privates")
|
||||
case _ => List()
|
||||
|
|
@ -622,10 +610,6 @@ lazy val scriptedSbtReduxProj = (project in file("scripted-sbt-redux"))
|
|||
baseSettings,
|
||||
name := "Scripted sbt Redux",
|
||||
libraryDependencies ++= Seq(launcherInterface % "provided"),
|
||||
libraryDependencies ++= (scalaVersion.value match {
|
||||
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
|
||||
case _ => List()
|
||||
}),
|
||||
mimaSettings,
|
||||
scriptedSbtReduxMimaSettings,
|
||||
)
|
||||
|
|
@ -753,10 +737,6 @@ lazy val commandProj = (project in file("main-command"))
|
|||
testedBaseSettings,
|
||||
name := "Command",
|
||||
libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi),
|
||||
libraryDependencies ++= (scalaVersion.value match {
|
||||
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
|
||||
case _ => List()
|
||||
}),
|
||||
Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates",
|
||||
managedSourceDirectories in Compile +=
|
||||
baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
|
|
@ -932,10 +912,6 @@ lazy val mainProj = (project in file("main"))
|
|||
case v if v.startsWith("2.12.") => List()
|
||||
case _ => List(scalaPar)
|
||||
}),
|
||||
libraryDependencies ++= (scalaVersion.value match {
|
||||
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
|
||||
case _ => List()
|
||||
}),
|
||||
managedSourceDirectories in Compile +=
|
||||
baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@ trait TypeFunctions {
|
|||
private type AnyLeft[T] = Left[T, Nothing]
|
||||
private type AnyRight[T] = Right[Nothing, T]
|
||||
|
||||
final val left: Id ~> Left[?, Nothing] =
|
||||
final val left: Id ~> Left[*, Nothing] =
|
||||
λ[Id ~> AnyLeft](Left(_)).setToString("TypeFunctions.left")
|
||||
final val right: Id ~> Right[Nothing, ?] =
|
||||
final val right: Id ~> Right[Nothing, *] =
|
||||
λ[Id ~> AnyRight](Right(_)).setToString("TypeFunctions.right")
|
||||
final val some: Id ~> Some[?] = λ[Id ~> Some](Some(_)).setToString("TypeFunctions.some")
|
||||
final val some: Id ~> Some[*] = λ[Id ~> Some](Some(_)).setToString("TypeFunctions.some")
|
||||
final def idFun[T]: T => T = ((t: T) => t).setToString("TypeFunctions.id")
|
||||
final def const[A, B](b: B): A => B = ((_: A) => b).setToString(s"TypeFunctions.const($b)")
|
||||
final def idK[M[_]]: M ~> M = λ[M ~> M](m => m).setToString("TypeFunctions.idK")
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@
|
|||
package sbt.internal.util
|
||||
|
||||
import sbt.util._
|
||||
import com.github.ghik.silencer.silent
|
||||
import scala.annotation.nowarn
|
||||
|
||||
/**
|
||||
* A filter logger is used to delegate messages but not the logging level to another logger. This means
|
||||
* that messages are logged at the higher of the two levels set by this logger and its delegate.
|
||||
*/
|
||||
class FilterLogger(delegate: AbstractLogger) extends BasicLogger {
|
||||
@silent override lazy val ansiCodesSupported = delegate.ansiCodesSupported
|
||||
@nowarn override lazy val ansiCodesSupported = delegate.ansiCodesSupported
|
||||
def trace(t: => Throwable): Unit = {
|
||||
if (traceEnabled)
|
||||
delegate.trace(t)
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@
|
|||
package sbt.internal.util
|
||||
|
||||
import sbt.util._
|
||||
import com.github.ghik.silencer.silent
|
||||
import scala.annotation.nowarn
|
||||
|
||||
// note that setting the logging level on this logger has no effect on its behavior, only
|
||||
// on the behavior of the delegates.
|
||||
class MultiLogger(delegates: List[AbstractLogger]) extends BasicLogger {
|
||||
@deprecated("No longer used.", "1.0.0")
|
||||
override lazy val ansiCodesSupported = delegates exists supported
|
||||
@silent private[this] def supported = (_: AbstractLogger).ansiCodesSupported
|
||||
@nowarn private[this] def supported = (_: AbstractLogger).ansiCodesSupported
|
||||
|
||||
override def setLevel(newLevel: Level.Value): Unit = {
|
||||
super.setLevel(newLevel)
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ import org.scalatest._
|
|||
import sbt.util._
|
||||
import java.io.{ File, PrintWriter }
|
||||
import sbt.io.Using
|
||||
import com.github.ghik.silencer.silent
|
||||
import scala.annotation.nowarn
|
||||
|
||||
class ManagedLoggerSpec extends FlatSpec with Matchers {
|
||||
val context = LoggerContext(useLog4J = true)
|
||||
@silent
|
||||
@nowarn
|
||||
val asyncStdout = new ConsoleAppenderFromLog4J("asyncStdout", LogExchange.asyncStdout)
|
||||
def newLogger(name: String): ManagedLogger = context.logger(name, None, None)
|
||||
"ManagedLogger" should "log to console" in {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
package sbt.internal.util
|
||||
package logic
|
||||
|
||||
import scala.annotation.tailrec
|
||||
import scala.annotation.{ nowarn, tailrec }
|
||||
import Formula.{ And, True }
|
||||
|
||||
/*
|
||||
|
|
@ -152,7 +152,7 @@ object Logic {
|
|||
if (contradictions.nonEmpty) Some(new InitialContradictions(contradictions)) else None
|
||||
}
|
||||
|
||||
@com.github.ghik.silencer.silent
|
||||
@nowarn
|
||||
private[this] def checkAcyclic(clauses: Clauses): Option[CyclicNegation] = {
|
||||
val deps = dependencyMap(clauses)
|
||||
// println(s"deps = $deps")
|
||||
|
|
|
|||
|
|
@ -11,13 +11,14 @@ package compiler
|
|||
import scala.language.reflectiveCalls
|
||||
import org.scalacheck._
|
||||
import Prop._
|
||||
import scala.tools.nsc.Settings
|
||||
import scala.tools.nsc.reporters.StoreReporter
|
||||
|
||||
import sbt.io.IO
|
||||
|
||||
class EvalTest extends Properties("eval") {
|
||||
private[this] lazy val reporter = new StoreReporter
|
||||
import reporter.{ ERROR, Info }
|
||||
private[this] lazy val reporter = new StoreReporter(new Settings())
|
||||
import reporter.ERROR
|
||||
private[this] lazy val eval = new Eval(_ => reporter, None)
|
||||
|
||||
property("inferred integer") = forAll { (i: Int) =>
|
||||
|
|
@ -100,7 +101,7 @@ val p = {
|
|||
("Has errors" |: is.nonEmpty) &&
|
||||
all(is.toSeq.map(validPosition(line, src)): _*)
|
||||
}
|
||||
private[this] def validPosition(line: Int, src: String)(i: Info) = {
|
||||
private[this] def validPosition(line: Int, src: String)(i: StoreReporter.Info) = {
|
||||
val nme = i.pos.source.file.name
|
||||
(label("Severity", i.severity) |: (i.severity == ERROR)) &&
|
||||
(label("Line", i.pos.line) |: (i.pos.line == line)) &&
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ package sbt
|
|||
|
||||
import java.io.File
|
||||
|
||||
import com.github.ghik.silencer.silent
|
||||
import sbt.internal.inc.classpath.{ ClassLoaderCache => IncClassLoaderCache }
|
||||
import sbt.internal.classpath.ClassLoaderCache
|
||||
import sbt.internal.server.ServerHandler
|
||||
import sbt.internal.util.AttributeKey
|
||||
import sbt.librarymanagement.ModuleID
|
||||
import sbt.util.Level
|
||||
import scala.annotation.nowarn
|
||||
import scala.concurrent.duration.FiniteDuration
|
||||
|
||||
object BasicKeys {
|
||||
|
|
@ -41,7 +41,7 @@ object BasicKeys {
|
|||
"The function that constructs the command prompt from the current build state for a given terminal.",
|
||||
10000
|
||||
)
|
||||
@silent val watch =
|
||||
@nowarn val watch =
|
||||
AttributeKey[Watched]("watched", "Continuous execution configuration.", 1000)
|
||||
val serverPort =
|
||||
AttributeKey[Int]("server-port", "The port number used by server command.", 10000)
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ import sjsonnew.support.scalajson.unsafe.Converter
|
|||
import xsbti.compile.TastyFiles
|
||||
import xsbti.{ FileConverter, Position }
|
||||
|
||||
import scala.annotation.nowarn
|
||||
import scala.collection.immutable.ListMap
|
||||
import scala.concurrent.duration._
|
||||
import scala.util.Try
|
||||
|
|
@ -4083,7 +4084,7 @@ object Classpaths {
|
|||
ivyRepo.allowInsecureProtocol
|
||||
} catch { case _: NoSuchMethodError => false }
|
||||
|
||||
@com.github.ghik.silencer.silent
|
||||
@nowarn
|
||||
private[this] def bootRepository(repo: xsbti.Repository): Resolver = {
|
||||
import xsbti.Predefined
|
||||
repo match {
|
||||
|
|
@ -4346,7 +4347,7 @@ trait BuildExtra extends BuildCommon with DefExtra {
|
|||
// I tried "Def.spaceDelimited().parsed" (after importing Def.parserToInput)
|
||||
// but it broke actions/run-task
|
||||
// Maybe it needs to be defined inside a Def.inputTask?
|
||||
@com.github.ghik.silencer.silent
|
||||
@nowarn
|
||||
def inputTask[T](f: TaskKey[Seq[String]] => Initialize[Task[T]]): Initialize[InputTask[T]] =
|
||||
InputTask.apply(Def.value((s: State) => Def.spaceDelimited()))(f)
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import sbt.librarymanagement.{ Resolver, UpdateReport }
|
|||
import sbt.std.Transform.DummyTaskMap
|
||||
import sbt.util.{ Logger, Show }
|
||||
|
||||
import scala.annotation.nowarn
|
||||
import scala.Console.RED
|
||||
import scala.concurrent.duration.Duration
|
||||
|
||||
|
|
@ -154,7 +155,7 @@ object EvaluateTask {
|
|||
import Keys.state
|
||||
import std.Transform
|
||||
|
||||
@com.github.ghik.silencer.silent
|
||||
@nowarn
|
||||
lazy private val sharedProgress = new TaskTimings(reportOnShutdown = true)
|
||||
def taskTimingProgress: Option[ExecuteProgress[Task]] =
|
||||
if (SysProp.taskTimingsOnShutdown) Some(sharedProgress)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import sbt.io.syntax._
|
|||
import sbt.util.{ Level, Logger, Show }
|
||||
import xsbti.compile.CompilerCache
|
||||
|
||||
import scala.annotation.tailrec
|
||||
import scala.annotation.{ nowarn, tailrec }
|
||||
import scala.concurrent.ExecutionContext
|
||||
import scala.concurrent.duration.Duration
|
||||
import scala.util.control.NonFatal
|
||||
|
|
@ -271,7 +271,7 @@ object BuiltinCommands {
|
|||
def ScriptCommands: Seq[Command] =
|
||||
Seq(ignore, exit, Script.command, setLogLevel, early, act, nop)
|
||||
|
||||
@com.github.ghik.silencer.silent
|
||||
@nowarn
|
||||
def DefaultCommands: Seq[Command] =
|
||||
Seq(
|
||||
multi,
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ private[sbt] object PluginCross {
|
|||
VersionNumber(sv) match {
|
||||
case VersionNumber(Seq(0, 12, _*), _, _) => "2.9.2"
|
||||
case VersionNumber(Seq(0, 13, _*), _, _) => "2.10.7"
|
||||
case VersionNumber(Seq(1, 0, _*), _, _) => "2.12.12"
|
||||
case VersionNumber(Seq(1, 0, _*), _, _) => "2.12.13"
|
||||
case _ => sys.error(s"Unsupported sbt binary version: $sv")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,11 @@
|
|||
|
||||
package sbt.internal
|
||||
|
||||
import scala.annotation.nowarn
|
||||
|
||||
// https://github.com/scala/scala-parallel-collections/issues/22
|
||||
private[sbt] object CompatParColls {
|
||||
@com.github.ghik.silencer.silent
|
||||
@nowarn
|
||||
val Converters = {
|
||||
import Compat._
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,13 +11,14 @@ package internal
|
|||
import java.nio.file.Path
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
import com.github.ghik.silencer.silent
|
||||
import sbt.{ ProjectRef, State, Watched }
|
||||
import sbt.internal.io.{ EventMonitor, Source, WatchState => WS }
|
||||
import sbt.internal.util.AttributeKey
|
||||
import sbt.nio.file.Glob
|
||||
|
||||
@silent
|
||||
import scala.annotation.nowarn
|
||||
|
||||
@nowarn
|
||||
private[internal] trait DeprecatedContinuous {
|
||||
protected type StartMessage =
|
||||
Option[Either[WS => String, (Int, ProjectRef, Seq[String]) => Option[String]]]
|
||||
|
|
@ -59,7 +60,7 @@ private[internal] trait DeprecatedContinuous {
|
|||
}
|
||||
}
|
||||
|
||||
@silent
|
||||
@nowarn
|
||||
private[sbt] object DeprecatedContinuous {
|
||||
private[sbt] val taskDefinitions: Seq[Def.Setting[_]] = Seq(
|
||||
sbt.Keys.watchTransitiveSources := sbt.Defaults.watchTransitiveSourcesTask.value,
|
||||
|
|
|
|||
|
|
@ -14,10 +14,12 @@ import sbt.internal.util.complete.DefaultParsers.validID
|
|||
import sbt.internal.util.Types.some
|
||||
import sbt.internal.util.{ AttributeKey, Relation }
|
||||
import sbt.librarymanagement.Configuration
|
||||
import scala.annotation.nowarn
|
||||
|
||||
object KeyIndex {
|
||||
def empty: ExtendableKeyIndex = new KeyIndex0(emptyBuildIndex)
|
||||
@com.github.ghik.silencer.silent
|
||||
|
||||
@nowarn
|
||||
def apply(
|
||||
known: Iterable[ScopedKey[_]],
|
||||
projects: Map[URI, Set[String]],
|
||||
|
|
@ -26,7 +28,8 @@ object KeyIndex {
|
|||
import sbt.internal.CompatParColls.Converters._
|
||||
known.par.foldLeft(base(projects, configurations)) { _ add _ }
|
||||
}
|
||||
@com.github.ghik.silencer.silent
|
||||
|
||||
@nowarn
|
||||
def aggregate(
|
||||
known: Iterable[ScopedKey[_]],
|
||||
extra: BuildUtil[_],
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ object DOT {
|
|||
style
|
||||
)
|
||||
}
|
||||
}.mkString("\n")
|
||||
}.sorted.mkString("\n")
|
||||
|
||||
def originWasEvicted(edge: Edge): Boolean = graph.module(edge._1).isEvicted
|
||||
def targetWasEvicted(edge: Edge): Boolean = graph.module(edge._2).isEvicted
|
||||
|
|
@ -63,9 +63,9 @@ object DOT {
|
|||
else ""
|
||||
""" "%s" -> "%s"%s""".format(e._1.idString, e._2.idString, extra)
|
||||
}
|
||||
}.mkString("\n")
|
||||
}.sorted.mkString("\n")
|
||||
|
||||
"%s\n%s\n%s\n}".format(dotHead, nodes, edges)
|
||||
s"$dotHead\n$nodes\n$edges\n}"
|
||||
}
|
||||
|
||||
sealed trait HTMLLabelRendering {
|
||||
|
|
|
|||
|
|
@ -16,11 +16,10 @@ import java.net.URI
|
|||
import graph.{ Module, ModuleGraph }
|
||||
import sbt.io.IO
|
||||
|
||||
import scala.annotation.tailrec
|
||||
import scala.annotation.{ nowarn, tailrec }
|
||||
import scala.util.parsing.json.{ JSONArray, JSONObject }
|
||||
import com.github.ghik.silencer.silent
|
||||
|
||||
@silent object TreeView {
|
||||
@nowarn object TreeView {
|
||||
def createJson(graph: ModuleGraph): String = {
|
||||
val trees = graph.roots
|
||||
.map(module => processSubtree(graph, module))
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ import scala.compat.Platform.EOL
|
|||
import scala.reflect.internal.util.{ BatchSourceFile, Position }
|
||||
import scala.reflect.io.VirtualDirectory
|
||||
import scala.reflect.internal.Positions
|
||||
import scala.tools.nsc.{ CompilerCommand, Global }
|
||||
import scala.tools.nsc.reporters.{ ConsoleReporter, Reporter, StoreReporter }
|
||||
import scala.tools.nsc.{ CompilerCommand, Global, Settings }
|
||||
import scala.tools.nsc.reporters.{ ConsoleReporter, FilteringReporter, StoreReporter }
|
||||
import scala.util.Random
|
||||
import scala.util.{ Failure, Success }
|
||||
|
||||
|
|
@ -59,33 +59,53 @@ private[sbt] object SbtParser {
|
|||
* when we know for a fact that the user-provided snippet doesn't
|
||||
* parse.
|
||||
*/
|
||||
private[sbt] class UniqueParserReporter extends Reporter {
|
||||
private[sbt] class UniqueParserReporter(val settings: Settings) extends FilteringReporter {
|
||||
|
||||
private val reporters = new ConcurrentHashMap[String, StoreReporter]()
|
||||
|
||||
override def info0(pos: Position, msg: String, severity: Severity, force: Boolean): Unit = {
|
||||
override def doReport(pos: Position, msg: String, severity: Severity): Unit = {
|
||||
val reporter = getReporter(pos.source.file.name)
|
||||
severity.id match {
|
||||
case 0 => reporter.info(pos, msg, force)
|
||||
case 0 => reporter.echo(pos, msg)
|
||||
case 1 => reporter.warning(pos, msg)
|
||||
case 2 => reporter.error(pos, msg)
|
||||
}
|
||||
}
|
||||
|
||||
// weird hack to make sure errors are counted by the underlying
|
||||
// reporters in both Scala 2.12 and 2.13.x
|
||||
// see https://github.com/scala/bug/issues/12317
|
||||
override def filter(pos: Position, msg: String, severity: Severity): Int = {
|
||||
val reporter = getReporter(pos.source.file.name)
|
||||
val result = reporter.filter(pos, msg, severity)
|
||||
if (result <= 1) reporter.increment(severity)
|
||||
if (result == 0) reporter.doReport(pos, msg, severity)
|
||||
result
|
||||
}
|
||||
|
||||
override def hasErrors: Boolean = {
|
||||
var result = false
|
||||
reporters.forEachValue(100, r => if (r.hasErrors) result = true)
|
||||
result
|
||||
}
|
||||
|
||||
def createReporter(uniqueFileName: String): StoreReporter = {
|
||||
val r = new StoreReporter(settings)
|
||||
reporters.put(uniqueFileName, r)
|
||||
r
|
||||
}
|
||||
|
||||
def getOrCreateReporter(uniqueFileName: String): StoreReporter = {
|
||||
val reporter = reporters.get(uniqueFileName)
|
||||
if (reporter == null) {
|
||||
val newReporter = new StoreReporter
|
||||
reporters.put(uniqueFileName, newReporter)
|
||||
newReporter
|
||||
} else reporter
|
||||
val r = reporters.get(uniqueFileName)
|
||||
if (r == null) createReporter(uniqueFileName)
|
||||
else r
|
||||
}
|
||||
|
||||
private def getReporter(fileName: String) = {
|
||||
val reporter = reporters.get(fileName)
|
||||
if (reporter == null) {
|
||||
scalacGlobalInitReporter.getOrElse(
|
||||
sys.error(s"Sbt forgot to initialize `scalacGlobalInitReporter`.")
|
||||
sys.error(s"sbt forgot to initialize `scalacGlobalInitReporter`.")
|
||||
)
|
||||
} else reporter
|
||||
}
|
||||
|
|
@ -105,10 +125,9 @@ private[sbt] object SbtParser {
|
|||
}
|
||||
}
|
||||
|
||||
private[sbt] final val globalReporter = new UniqueParserReporter
|
||||
private[sbt] var scalacGlobalInitReporter: Option[ConsoleReporter] = None
|
||||
|
||||
private[sbt] final val defaultGlobalForParser = {
|
||||
private[sbt] final val (defaultGlobalForParser, globalReporter) = {
|
||||
val options = "-cp" :: s"$defaultClasspath" :: "-Yrangepos" :: Nil
|
||||
val reportError = (msg: String) => System.err.println(msg)
|
||||
val command = new CompilerCommand(options, reportError)
|
||||
|
|
@ -116,14 +135,15 @@ private[sbt] object SbtParser {
|
|||
settings.outputDirs.setSingleOutput(new VirtualDirectory("(memory)", None))
|
||||
scalacGlobalInitReporter = Some(new ConsoleReporter(settings))
|
||||
|
||||
val reporter = new UniqueParserReporter(settings)
|
||||
// Mix Positions, otherwise global ignores -Yrangepos
|
||||
val global = new Global(settings, globalReporter) with Positions
|
||||
val global = new Global(settings, reporter) with Positions
|
||||
val run = new global.Run
|
||||
// Add required dummy unit for initialization...
|
||||
val initFile = new BatchSourceFile("<wrapper-init>", "")
|
||||
val _ = new global.CompilationUnit(initFile)
|
||||
global.phase = run.parserPhase
|
||||
global
|
||||
(global, reporter)
|
||||
}
|
||||
|
||||
import defaultGlobalForParser.Tree
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ package server
|
|||
import java.net.URI
|
||||
import java.nio.file._
|
||||
|
||||
import scala.annotation.tailrec
|
||||
import scala.annotation.{ nowarn, tailrec }
|
||||
import scala.collection.JavaConverters._
|
||||
import scala.concurrent.{ ExecutionContext, Future }
|
||||
import scala.reflect.NameTransformer
|
||||
|
|
@ -259,7 +259,7 @@ private[sbt] object Definition {
|
|||
result.future
|
||||
}
|
||||
|
||||
@com.github.ghik.silencer.silent
|
||||
@nowarn
|
||||
def lspDefinition(
|
||||
jsonDefinition: JValue,
|
||||
requestId: String,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import sbt.nio.file.{ AllPass, FileAttributes, Glob, RecursiveGlob }
|
|||
import sbt.std.TaskExtra._
|
||||
import sjsonnew.JsonFormat
|
||||
|
||||
import scala.annotation.nowarn
|
||||
import scala.collection.immutable.VectorBuilder
|
||||
|
||||
private[sbt] object Settings {
|
||||
|
|
@ -269,7 +270,7 @@ private[sbt] object Settings {
|
|||
* @return a task definition that retrieves the input files and their file stamps scoped to the
|
||||
* input key.
|
||||
*/
|
||||
@com.github.ghik.silencer.silent
|
||||
@nowarn
|
||||
private[sbt] def fileStamps(scopedKey: Def.ScopedKey[_]): Def.Setting[_] = {
|
||||
import sbt.internal.CompatParColls.Converters._
|
||||
val scope = scopedKey.scope
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sbt.contraband.ContrabandPlugin.autoImport._
|
|||
|
||||
object Dependencies {
|
||||
// WARNING: Please Scala update versions in PluginCross.scala too
|
||||
val scala212 = "2.12.12"
|
||||
val scala212 = "2.12.13"
|
||||
val scala213 = "2.13.3"
|
||||
val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up")
|
||||
val baseScalaVersion = scala212
|
||||
|
|
@ -114,6 +114,5 @@ object Dependencies {
|
|||
|
||||
val hedgehog = "qa.hedgehog" %% "hedgehog-sbt" % "0.6.1"
|
||||
val disruptor = "com.lmax" % "disruptor" % "3.4.2"
|
||||
val silencerPlugin = "com.github.ghik" %% "silencer-plugin" % "1.4.2"
|
||||
val silencerLib = "com.github.ghik" %% "silencer-lib" % "1.4.2" % Provided
|
||||
val kindProjector = ("org.typelevel" % "kind-projector" % "0.11.3").cross(CrossVersion.full)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ object Util {
|
|||
"-language:existentials",
|
||||
"-language:postfixOps",
|
||||
"-Yrangepos",
|
||||
"-Wconf:cat=unused-nowarn:s",
|
||||
),
|
||||
Compile / doc / scalacOptions -= "-Xlint",
|
||||
Compile / doc / scalacOptions -= "-Xfatal-warnings",
|
||||
|
|
|
|||
|
|
@ -10,19 +10,19 @@ lazy val root = (project in file("."))
|
|||
|
||||
lazy val foo = project
|
||||
.settings(
|
||||
crossScalaVersions := Seq("2.12.12", "2.13.1"),
|
||||
crossScalaVersions := Seq("2.12.13", "2.13.1"),
|
||||
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.0",
|
||||
|
||||
check := {
|
||||
// This tests that +check will respect bar's crossScalaVersions and not switch
|
||||
val x = (LocalProject("bar") / scalaVersion).value
|
||||
assert(x == "2.12.12", s"$x == 2.12.12")
|
||||
assert(x == "2.12.13", s"$x == 2.12.12")
|
||||
(Compile / compile).value
|
||||
},
|
||||
(Test / testOnly) := {
|
||||
// This tests that +testOnly will respect bar's crossScalaVersions and not switch
|
||||
val x = (LocalProject("bar") / scalaVersion).value
|
||||
assert(x == "2.12.12", s"$x == 2.12.12")
|
||||
assert(x == "2.12.13", s"$x == 2.12.12")
|
||||
val _ = (Test / testOnly).evaluated
|
||||
},
|
||||
compile2 := {
|
||||
|
|
@ -35,7 +35,7 @@ lazy val foo = project
|
|||
|
||||
lazy val bar = project
|
||||
.settings(
|
||||
crossScalaVersions := Seq("2.12.12"),
|
||||
crossScalaVersions := Seq("2.12.13"),
|
||||
check := (Compile / compile).value,
|
||||
compile2 := (Compile / compile).value,
|
||||
)
|
||||
|
|
@ -46,14 +46,14 @@ lazy val baz = project
|
|||
check := {
|
||||
// This tests that +baz/check will respect bar's crossScalaVersions and not switch
|
||||
val x = (LocalProject("bar") / scalaVersion).value
|
||||
assert(x == "2.12.12", s"$x == 2.12.12")
|
||||
assert(x == "2.12.13", s"$x == 2.12.13")
|
||||
(Compile / compile).value
|
||||
},
|
||||
)
|
||||
|
||||
lazy val client = project
|
||||
.settings(
|
||||
crossScalaVersions := Seq("2.12.12", "2.13.1"),
|
||||
crossScalaVersions := Seq("2.12.13", "2.13.1"),
|
||||
check := (Compile / compile).value,
|
||||
compile2 := (Compile / compile).value,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
## test + with command or alias
|
||||
> clean
|
||||
## for command cross building you do need crossScalaVerions on root
|
||||
> set root/crossScalaVersions := Seq("2.12.12", "2.13.1")
|
||||
> set root/crossScalaVersions := Seq("2.12.13", "2.13.1")
|
||||
> + build
|
||||
$ exists foo/target/scala-2.12
|
||||
$ exists foo/target/scala-2.13
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@ lazy val test_project = project
|
|||
| edge [
|
||||
| arrowtail="none"
|
||||
| ]
|
||||
| "test_project:test_project_2.9.2:0.1-SNAPSHOT"[label=<test_project<BR/><B>test_project_2.9.2</B><BR/>0.1-SNAPSHOT> style=""]
|
||||
| "justadependencyproject:justadependencyproject_2.9.2:0.1-SNAPSHOT"[label=<justadependencyproject<BR/><B>justadependencyproject_2.9.2</B><BR/>0.1-SNAPSHOT> style=""]
|
||||
| "justatransitivedependencyproject:justatransitivedependencyproject_2.9.2:0.1-SNAPSHOT"[label=<justatransitivedependencyproject<BR/><B>justatransitivedependencyproject_2.9.2</B><BR/>0.1-SNAPSHOT> style=""]
|
||||
| "justatransivitedependencyendpointproject:justatransivitedependencyendpointproject_2.9.2:0.1-SNAPSHOT"[label=<justatransivitedependencyendpointproject<BR/><B>justatransivitedependencyendpointproject_2.9.2</B><BR/>0.1-SNAPSHOT> style=""]
|
||||
| "justadependencyproject:justadependencyproject_2.9.2:0.1-SNAPSHOT"[label=<justadependencyproject<BR/><B>justadependencyproject_2.9.2</B><BR/>0.1-SNAPSHOT> style=""]
|
||||
| "test_project:test_project_2.9.2:0.1-SNAPSHOT" -> "justatransitivedependencyproject:justatransitivedependencyproject_2.9.2:0.1-SNAPSHOT"
|
||||
| "test_project:test_project_2.9.2:0.1-SNAPSHOT"[label=<test_project<BR/><B>test_project_2.9.2</B><BR/>0.1-SNAPSHOT> style=""]
|
||||
| "justatransitivedependencyproject:justatransitivedependencyproject_2.9.2:0.1-SNAPSHOT" -> "justatransivitedependencyendpointproject:justatransivitedependencyendpointproject_2.9.2:0.1-SNAPSHOT"
|
||||
| "test_project:test_project_2.9.2:0.1-SNAPSHOT" -> "justadependencyproject:justadependencyproject_2.9.2:0.1-SNAPSHOT"
|
||||
| "test_project:test_project_2.9.2:0.1-SNAPSHOT" -> "justatransitivedependencyproject:justatransitivedependencyproject_2.9.2:0.1-SNAPSHOT"
|
||||
|}
|
||||
""".stripMargin
|
||||
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ Apache-2.0
|
|||
org.typelevel:cats-effect_2.12:2.2.0
|
||||
|
||||
MIT
|
||||
org.typelevel:cats-kernel_2.12:2.2.0
|
||||
org.typelevel:cats-core_2.12:2.2.0
|
||||
org.typelevel:cats-core_2.12:2.2.0
|
||||
org.typelevel:cats-kernel_2.12:2.2.0
|
||||
|
|
@ -3,7 +3,7 @@ import sbt.internal.inc.ScalaInstance
|
|||
lazy val OtherScala = config("other-scala").hide
|
||||
lazy val junitinterface = "com.novocode" % "junit-interface" % "0.11"
|
||||
lazy val akkaActor = "com.typesafe.akka" %% "akka-actor" % "2.5.17"
|
||||
ThisBuild / scalaVersion := "2.12.12"
|
||||
ThisBuild / scalaVersion := "2.12.13"
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.configs(OtherScala)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import sbt.internal.io.Resources
|
|||
import sbt.internal.scripted._
|
||||
import RemoteSbtCreatorProp._
|
||||
|
||||
import scala.annotation.nowarn
|
||||
import scala.collection.parallel.ForkJoinTaskSupport
|
||||
import scala.collection.{ GenSeq, mutable }
|
||||
import scala.util.control.NonFatal
|
||||
|
|
@ -482,7 +483,7 @@ class ScriptedRunner {
|
|||
instances: Int
|
||||
) = run(baseDir, bufferLog, tests, logger, launchOpts, prescripted, prop, instances, true)
|
||||
|
||||
@com.github.ghik.silencer.silent
|
||||
@nowarn
|
||||
private[this] def run(
|
||||
baseDir: File,
|
||||
bufferLog: Boolean,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import sbt.internal.server.{ ServerHandler, ServerIntent }
|
||||
|
||||
ThisBuild / scalaVersion := "2.12.12"
|
||||
ThisBuild / scalaVersion := "2.12.13"
|
||||
|
||||
Global / serverLog / logLevel := Level.Debug
|
||||
// custom handler
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ private[sbt] final class Execute[F[_] <: AnyRef](
|
|||
private[this] val reverse = idMap[F[_], Iterable[F[_]]]
|
||||
private[this] val callers = pMap[F, Compose[IDSet, F]#Apply]
|
||||
private[this] val state = idMap[F[_], State]
|
||||
private[this] val viewCache = pMap[F, Node[F, ?]]
|
||||
private[this] val viewCache = pMap[F, Node[F, *]]
|
||||
private[this] val results = pMap[F, Result]
|
||||
|
||||
private[this] val getResult: F ~> Result = λ[F ~> Result](
|
||||
|
|
|
|||
Loading…
Reference in New Issue