mirror of https://github.com/sbt/sbt.git
Remove more unused
This commit is contained in:
parent
369e647008
commit
12e9267e1e
|
|
@ -364,7 +364,6 @@ lazy val utilLogging = project
|
|||
),
|
||||
libraryDependencies ++= Seq(scalacheck % "test", scalatest % "test"),
|
||||
Compile / generateContrabands / contrabandCodecsDependencies := List(sjsonNewCore.value),
|
||||
Compile / scalacOptions ++= Seq("-Wunused:imports,implicits,nowarn"),
|
||||
Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
Compile / managedSourceDirectories +=
|
||||
baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
|
|
@ -472,7 +471,6 @@ lazy val testingProj = (project in file("testing"))
|
|||
sjsonNewScalaJson.value,
|
||||
sjsonNewCore.value,
|
||||
),
|
||||
Compile / scalacOptions += "-Wunused:imports,implicits,nowarn",
|
||||
Compile / managedSourceDirectories +=
|
||||
baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
|
|
@ -569,7 +567,6 @@ lazy val runProj = (project in file("run"))
|
|||
.settings(
|
||||
testedBaseSettings,
|
||||
name := "Run",
|
||||
Compile / scalacOptions += "-Wunused:imports,implicits,nowarn",
|
||||
Compile / managedSourceDirectories +=
|
||||
baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
|
|
@ -692,7 +689,6 @@ lazy val protocolProj = (project in file("protocol"))
|
|||
testedBaseSettings,
|
||||
name := "Protocol",
|
||||
libraryDependencies ++= Seq(sjsonNewScalaJson.value, sjsonNewCore.value, ipcSocket),
|
||||
Compile / scalacOptions += "-Wunused:imports,implicits,nowarn",
|
||||
Compile / managedSourceDirectories +=
|
||||
baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
|
|
@ -739,7 +735,6 @@ lazy val commandProj = (project in file("main-command"))
|
|||
sjsonNewScalaJson.value,
|
||||
templateResolverApi
|
||||
),
|
||||
Compile / scalacOptions += "-Wunused:imports,implicits,nowarn",
|
||||
Compile / managedSourceDirectories +=
|
||||
baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
|
|
|
|||
|
|
@ -2,13 +2,11 @@ package sbt
|
|||
package internal
|
||||
|
||||
import dotty.tools.dotc.ast
|
||||
import dotty.tools.dotc.ast.{ tpd, untpd }
|
||||
import dotty.tools.dotc.ast.tpd
|
||||
import dotty.tools.dotc.CompilationUnit
|
||||
import dotty.tools.dotc.config.ScalaSettings
|
||||
import dotty.tools.dotc.core.Contexts.{ atPhase, Context }
|
||||
import dotty.tools.dotc.core.{ Flags, Names, Phases, Symbols, Types }
|
||||
import dotty.tools.dotc.Driver
|
||||
import dotty.tools.dotc.parsing.Parsers.Parser
|
||||
import dotty.tools.dotc.reporting.Reporter
|
||||
import dotty.tools.dotc.Run
|
||||
import dotty.tools.dotc.util.SourceFile
|
||||
|
|
@ -53,7 +51,6 @@ class Eval(
|
|||
case None => EvalReporter.store
|
||||
|
||||
final class EvalDriver extends Driver:
|
||||
import dotty.tools.dotc.config.Settings.Setting._
|
||||
val compileCtx0 = initCtx.fresh
|
||||
val options = nonCpOptions ++ Seq("-classpath", classpathString, "dummy.scala")
|
||||
val compileCtx1 = setup(options.toArray, compileCtx0) match
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ package sbt
|
|||
package internal
|
||||
|
||||
import Def.Setting
|
||||
import java.io.File
|
||||
import java.nio.file.Path
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,12 +16,9 @@ import java.util.concurrent.ConcurrentHashMap
|
|||
import sbt.internal.parser.SbtParser._
|
||||
import dotty.tools.dotc.ast.Trees.Lazy
|
||||
import dotty.tools.dotc.ast.untpd.*
|
||||
import dotty.tools.dotc.CompilationUnit
|
||||
import dotty.tools.dotc.core.Contexts.*
|
||||
import dotty.tools.dotc.Driver
|
||||
import dotty.tools.dotc.util.NoSourcePosition
|
||||
import dotty.tools.dotc.util.SourceFile
|
||||
import dotty.tools.dotc.util.SourcePosition
|
||||
import dotty.tools.io.VirtualDirectory
|
||||
import dotty.tools.io.VirtualFile
|
||||
import dotty.tools.dotc.parsing.*
|
||||
|
|
@ -30,10 +27,7 @@ import dotty.tools.dotc.reporting.Diagnostic
|
|||
import dotty.tools.dotc.reporting.Reporter
|
||||
import dotty.tools.dotc.reporting.StoreReporter
|
||||
import scala.util.Random
|
||||
import scala.util.{ Failure, Success }
|
||||
import xsbti.VirtualFileRef
|
||||
import dotty.tools.dotc.printing.Printer
|
||||
import dotty.tools.dotc.config.Printers
|
||||
|
||||
private[sbt] object SbtParser:
|
||||
val END_OF_LINE_CHAR = '\n'
|
||||
|
|
@ -164,7 +158,6 @@ private[sbt] object SbtParser:
|
|||
* @return the parsed trees
|
||||
*/
|
||||
private def parse(filePath: String, reporterId: String)(using Context): List[Tree] =
|
||||
import defaultGlobalForParser.*
|
||||
val reporter = globalReporter.getOrCreateReporter(reporterId)
|
||||
reporter.removeBufferedMessages
|
||||
val parser = Parsers.Parser(ctx.source)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ package sbt
|
|||
package internal
|
||||
package parser
|
||||
|
||||
import java.io.File
|
||||
import dotty.tools.dotc.ast.untpd
|
||||
import dotty.tools.dotc.core.Contexts.Context
|
||||
|
||||
|
|
|
|||
|
|
@ -12,12 +12,9 @@ package parser
|
|||
import sbt.internal.inc.PlainVirtualFileConverter
|
||||
import sbt.internal.parser.SbtRefactorings.SessionSetting
|
||||
|
||||
import java.io.File
|
||||
import java.io.FilenameFilter
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Paths
|
||||
import scala.io.Source
|
||||
import scala.jdk.CollectionConverters.*
|
||||
|
||||
abstract class AbstractSessionSettingsSpec(folder: String) extends AbstractSpec {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ package sbt
|
|||
package internal
|
||||
package parser
|
||||
|
||||
import java.io.File
|
||||
|
||||
import sbt.internal.util.LineRange
|
||||
import xsbti.VirtualFileRef
|
||||
|
||||
|
|
|
|||
|
|
@ -4,22 +4,18 @@ package util
|
|||
package appmacro
|
||||
|
||||
import scala.collection.mutable.ListBuffer
|
||||
import scala.reflect.{ ClassTag, TypeTest }
|
||||
import scala.reflect.ClassTag
|
||||
import scala.quoted.*
|
||||
import sjsonnew.{ BasicJsonProtocol, HashWriter, JsonFormat }
|
||||
import sbt.util.{
|
||||
ActionCache,
|
||||
ActionCacheStore,
|
||||
Applicative,
|
||||
BuildWideCacheConfiguration,
|
||||
Cache,
|
||||
CacheLevelTag,
|
||||
Digest,
|
||||
Monad,
|
||||
}
|
||||
import xsbti.VirtualFile
|
||||
import Types.Id
|
||||
import scala.annotation.nowarn
|
||||
|
||||
/**
|
||||
* Implementation of a macro that provides a direct syntax for applicative functors and monads. It
|
||||
|
|
@ -267,7 +263,7 @@ trait Cont:
|
|||
val expr = input.term.asExprOf[F[a]]
|
||||
typed[F[A1]](
|
||||
'{
|
||||
$applicativeExpr.map[a @nowarn, A1]($expr.asInstanceOf[F[a @nowarn]])($lambda)
|
||||
$applicativeExpr.map[a, A1]($expr.asInstanceOf[F[a]])($lambda)
|
||||
}.asTerm
|
||||
).asExprOf[F[A1]]
|
||||
eitherTree match
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package sbt.internal.util.appmacro
|
||||
|
||||
import sbt.internal.util.Types.Id
|
||||
import scala.compiletime.summonInline
|
||||
import scala.quoted.*
|
||||
import scala.reflect.TypeTest
|
||||
import scala.collection.mutable
|
||||
import sbt.util.cacheLevel
|
||||
import sbt.util.CacheLevelTag
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import sbt.internal.util.appmacro.*
|
|||
import verify.*
|
||||
import ContTestMacro.*
|
||||
import sbt.util.Applicative
|
||||
import sjsonnew.BasicJsonProtocol
|
||||
|
||||
object ContTest extends BasicTestSuite:
|
||||
test("pure") {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package sbt.internal
|
|||
import sbt.internal.util.Types.Id
|
||||
import sbt.internal.util.appmacro.*
|
||||
import sbt.util.Applicative
|
||||
import sbt.util.{ ActionCacheStore, InMemoryActionCacheStore }
|
||||
import scala.quoted.*
|
||||
import ConvertTestMacro.InputInitConvert
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package sbt.internal
|
||||
|
||||
import sbt.internal.util.appmacro.*
|
||||
import verify.*
|
||||
import ConvertTestMacro._
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ import org.jline.utils.ClosedException
|
|||
import sbt.internal.util.complete.Parser
|
||||
import sbt.io.syntax._
|
||||
|
||||
import scala.annotation.tailrec
|
||||
import scala.concurrent.duration._
|
||||
import scala.util.control.NonFatal
|
||||
import java.nio.channels.ClosedByInterruptException
|
||||
import java.net.MalformedURLException
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
package sbt.internal.util
|
||||
package logic
|
||||
|
||||
import scala.annotation.{ nowarn, tailrec }
|
||||
import scala.annotation.tailrec
|
||||
import Formula.{ And, True }
|
||||
|
||||
/*
|
||||
|
|
@ -151,7 +151,6 @@ object Logic {
|
|||
if (contradictions.nonEmpty) Some(new InitialContradictions(contradictions)) else None
|
||||
}
|
||||
|
||||
@nowarn
|
||||
private[this] def checkAcyclic(clauses: Clauses): Option[CyclicNegation] = {
|
||||
val deps = dependencyMap(clauses)
|
||||
// println(s"deps = $deps")
|
||||
|
|
|
|||
|
|
@ -26,10 +26,7 @@ import sjsonnew.{
|
|||
}
|
||||
|
||||
import sbt.util.Logger
|
||||
import sbt.util.{ CacheStoreFactory, FilesInfo, ModifiedFileInfo, PlainFileInfo }
|
||||
import sbt.util.FileInfo.{ exists, lastModified }
|
||||
import sbt.util.CacheImplicits._
|
||||
import sbt.util.Tracked.{ inputChanged, outputChanged }
|
||||
import scala.sys.process.Process
|
||||
import xsbti.{ FileConverter, HashedVirtualFileRef, VirtualFile, VirtualFileRef }
|
||||
|
||||
|
|
@ -115,7 +112,6 @@ object Pkg:
|
|||
Vector[(HashedVirtualFileRef, String)] :*: VirtualFileRef :*: Seq[PackageOption] :*: LNil
|
||||
] =
|
||||
import sbt.util.CacheImplicits.given
|
||||
import sbt.util.PathHashWriters.given
|
||||
LList.iso(
|
||||
(c: Configuration) =>
|
||||
("sources", c.sources.toVector) :*: ("jar", c.jar) :*: ("options", c.options) :*: LNil,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import sbt.internal.io.TranslatedException
|
|||
import sbt.util.CacheImplicits._
|
||||
import sbt.util.{ CacheStore, FileInfo }
|
||||
import sbt.io.IO
|
||||
import sbt.librarymanagement.LibraryManagementCodec
|
||||
import sjsonnew.{
|
||||
Builder,
|
||||
IsoString,
|
||||
|
|
|
|||
|
|
@ -7,11 +7,9 @@
|
|||
|
||||
package sbt
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.Path
|
||||
import java.net.URI
|
||||
|
||||
import scala.annotation.compileTimeOnly
|
||||
import scala.annotation.tailrec
|
||||
import scala.annotation.targetName
|
||||
import sbt.KeyRanks.{ DTask, Invisible }
|
||||
|
|
@ -19,7 +17,7 @@ import sbt.Scope.{ GlobalScope, ThisScope }
|
|||
import sbt.internal.util.Types.const
|
||||
import sbt.internal.util.complete.Parser
|
||||
import sbt.internal.util.{ Terminal => ITerminal, * }
|
||||
import sbt.util.{ ActionCacheStore, AggregateActionCacheStore, BuildWideCacheConfiguration, InMemoryActionCacheStore }
|
||||
import sbt.util.{ ActionCacheStore, BuildWideCacheConfiguration, InMemoryActionCacheStore }
|
||||
import Util._
|
||||
import sbt.util.Show
|
||||
import xsbti.{ HashedVirtualFileRef, VirtualFile }
|
||||
|
|
@ -270,7 +268,7 @@ object Def extends Init[Scope] with TaskMacroExtra with InitializeImplicits:
|
|||
): Initialize[Task[A2]] =
|
||||
fab.zipWith(fin)((ab, in) => TaskExtra.select(ab, in))
|
||||
|
||||
import Scoped.syntax.{ *, given } // { Def => _, DTask => _, Invisible => _, * }
|
||||
import Scoped.syntax.*
|
||||
|
||||
// derived from select
|
||||
private[sbt] def branchS[A, B, C](
|
||||
|
|
|
|||
|
|
@ -8,11 +8,10 @@
|
|||
package sbt
|
||||
|
||||
import sbt.internal.util.complete.Parser
|
||||
import Def.{ Initialize, ScopedKey }
|
||||
import Def.Initialize
|
||||
import std.TaskExtra._
|
||||
import sbt.internal.util.{ AttributeKey, Types }
|
||||
import sbt.internal.util.Types
|
||||
import sbt.internal.util.Types._
|
||||
import sbt.internal.util.Util._
|
||||
import sbt.util.Applicative
|
||||
|
||||
/** Parses input and produces a task to run. Constructed using the companion object. */
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import sbt.util.StampedFormat
|
|||
import sjsonnew.JsonFormat
|
||||
|
||||
import scala.util.control.NonFatal
|
||||
import scala.annotation.nowarn
|
||||
|
||||
/**
|
||||
* Reads the previous value of tasks on-demand. The read values are cached so that they are only read once per task execution.
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ package sbt
|
|||
import java.io.File
|
||||
import java.util.Locale
|
||||
import sbt.librarymanagement.Configuration
|
||||
import sbt.Def.{ Flattened, Initialize, ScopedKey, Setting }
|
||||
import sbt.Def.{ Initialize, ScopedKey, Setting }
|
||||
import sbt.internal.util.Dag
|
||||
import sbt.internal.util.complete.Parser
|
||||
import sbt.internal.util.complete.DefaultParsers
|
||||
import Scope.{ Global, ThisScope }
|
||||
import Scope.ThisScope
|
||||
|
||||
sealed trait ProjectDefinition[PR <: ProjectReference] {
|
||||
|
||||
|
|
|
|||
|
|
@ -32,11 +32,9 @@ sealed trait Reference:
|
|||
def /(c: Configuration): RichConfiguration = RichConfiguration(asScope in c)
|
||||
|
||||
// This is for handling `Zero / Zero / name`.
|
||||
@nowarn
|
||||
def /(configAxis: ScopeAxis[ConfigKey]): RichConfiguration =
|
||||
new RichConfiguration(asScope.copy(config = configAxis))
|
||||
|
||||
@nowarn
|
||||
final def /[K](key: Scoped.ScopingSetting[K]): K = key.in(asScope)
|
||||
|
||||
@nowarn
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ object SlashSyntax {
|
|||
|
||||
sealed trait HasSlashKey {
|
||||
protected def scope: Scope
|
||||
@nowarn
|
||||
final def /[K](key: Scoped.ScopingSetting[K]): K = key.in(scope)
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +83,6 @@ object SlashSyntax {
|
|||
def /(c: Configuration): RichConfiguration = new RichConfiguration(scope in c)
|
||||
|
||||
// This is for handling `Zero / Zero / name`.
|
||||
@nowarn
|
||||
def /(configAxis: ScopeAxis[ConfigKey]): RichConfiguration =
|
||||
new RichConfiguration(scope.copy(config = configAxis))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@ import sbt.ConcurrentRestrictions.Tag
|
|||
import sbt.Def.{ Initialize, ScopedKey, Setting, setting }
|
||||
import std.TaskMacro
|
||||
import std.TaskExtra.{ task => mktask, _ }
|
||||
import scala.reflect.{ ClassTag, ManifestFactory }
|
||||
import scala.annotation.nowarn
|
||||
import scala.reflect.ClassTag
|
||||
|
||||
/** An abstraction on top of Settings for build configuration and task definition. */
|
||||
sealed trait Scoped extends Equals:
|
||||
|
|
@ -80,7 +79,7 @@ sealed abstract class SettingKey[A1]
|
|||
inline def settingMacro[A](inline a: A): Initialize[A] =
|
||||
${ std.SettingMacro.settingMacroImpl[A]('a) }
|
||||
|
||||
final inline def :=(inline v: A1): Setting[A1 @nowarn] =
|
||||
final inline def :=(inline v: A1): Setting[A1] =
|
||||
${ TaskMacro.settingAssignMacroImpl('this, 'v) }
|
||||
|
||||
final inline def +=[A2](inline v: A2)(using Append.Value[A1, A2]): Setting[A1] =
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ object InputTaskMacro:
|
|||
private[this] def inputTaskMacro0[A1: Type](tree: Expr[A1])(using
|
||||
qctx: Quotes
|
||||
): Expr[Def.Initialize[InputTask[A1]]] =
|
||||
import qctx.reflect.*
|
||||
// println(s"tree = ${tree.show}")
|
||||
iInitializeMacro(tree) { et =>
|
||||
val pt: Expr[State => Parser[Task[A1]]] = iParserMacro(et) { pt =>
|
||||
|
|
@ -109,7 +108,6 @@ object InputTaskMacro:
|
|||
convert1.contMapN[A1, ParserInstance.F1, F1](tree, convert1.appExpr, None, inner)
|
||||
|
||||
private[this] def iTaskMacro[A1: Type](tree: Expr[A1])(using qctx: Quotes): Expr[Task[A1]] =
|
||||
import qctx.reflect.*
|
||||
val convert1 = new TaskConvert(qctx, 2000)
|
||||
convert1.contMapN[A1, Task, Id](tree, convert1.appExpr, None)
|
||||
/*
|
||||
|
|
@ -218,7 +216,6 @@ object InputTaskMacro:
|
|||
): Expr[Def.Initialize[InputTask[A2]]] =
|
||||
import qctx.reflect.*
|
||||
val convert1 = new FullConvert(qctx, 1000)
|
||||
import convert1.Converted
|
||||
def mkInputTask(params: List[ValDef], body: Term): Expr[Def.Initialize[InputTask[A2]]] =
|
||||
val lambdaTpe =
|
||||
MethodType(params.map(_.name))(
|
||||
|
|
|
|||
|
|
@ -11,12 +11,6 @@ package std
|
|||
import scala.language.experimental.macros
|
||||
|
||||
import scala.annotation.compileTimeOnly
|
||||
import scala.quoted.*
|
||||
// import scala.reflect.macros._
|
||||
|
||||
import Def.Initialize
|
||||
import sbt.internal.util.appmacro.ContextUtil
|
||||
import sbt.internal.util.complete.Parser
|
||||
|
||||
/** Implementation detail. The wrap methods temporarily hold inputs (as a Tree, at compile time) until a task or setting macro processes it. */
|
||||
object InputWrapper:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ package sbt
|
|||
package std
|
||||
|
||||
import java.io.File
|
||||
import scala.annotation.tailrec
|
||||
import scala.quoted.*
|
||||
import scala.reflect.ClassTag
|
||||
|
||||
|
|
|
|||
|
|
@ -9,12 +9,9 @@ package sbt
|
|||
package std
|
||||
|
||||
import Def.{ Initialize, Setting }
|
||||
import sbt.util.{ ActionCacheStore, Applicative, Monad }
|
||||
import sbt.internal.util.Types.Id
|
||||
import sbt.internal.util.appmacro.{
|
||||
Cont,
|
||||
ContextUtil,
|
||||
Convert,
|
||||
// Instance,
|
||||
// LinterDSL,
|
||||
// MixedBuilder,
|
||||
|
|
@ -24,10 +21,8 @@ import sbt.internal.util.appmacro.{
|
|||
import sbt.internal.util.{ LinePosition, NoPosition, SourcePosition }
|
||||
|
||||
import language.experimental.macros
|
||||
import scala.annotation.tailrec
|
||||
import scala.reflect.internal.util.UndefinedPosition
|
||||
import scala.quoted.*
|
||||
import sjsonnew.{ BasicJsonProtocol, JsonFormat }
|
||||
import sjsonnew.JsonFormat
|
||||
|
||||
object TaskMacro:
|
||||
final val AssignInitName = "set"
|
||||
|
|
@ -104,7 +99,6 @@ object TaskMacro:
|
|||
def settingAssignMacroImpl[A1: Type](rec: Expr[Scoped.DefinableSetting[A1]], v: Expr[A1])(using
|
||||
qctx: Quotes
|
||||
): Expr[Setting[A1]] =
|
||||
import qctx.reflect.*
|
||||
val init = SettingMacro.settingMacroImpl[A1](v)
|
||||
'{
|
||||
$rec.set0($init, $sourcePosition)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ package sbt.test
|
|||
|
||||
import sbt._
|
||||
import sbt.Def.Initialize
|
||||
import sbt.internal.util.Types.Id
|
||||
|
||||
object TupleSyntaxTest:
|
||||
def t1[A](a: SettingKey[A], b: TaskKey[A], c: Def.Initialize[A], d: Def.Initialize[Task[A]]) = {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import sbt.Project.{
|
|||
// richTaskSessionVar,
|
||||
// sbtRichTaskPromise
|
||||
}
|
||||
import sbt.ProjectExtra.{ *, given }
|
||||
import sbt.ProjectExtra.*
|
||||
import sbt.Scope.{ GlobalScope, ThisScope, fillTaskAxis }
|
||||
import sbt.State.StateOpsImpl
|
||||
import sbt.coursierint._
|
||||
|
|
@ -88,7 +88,6 @@ import sbt.util.CacheImplicits.given
|
|||
import sbt.util.InterfaceUtil.{ t2, toJavaFunction => f1 }
|
||||
import sbt.util._
|
||||
import sjsonnew._
|
||||
import sjsonnew.support.scalajson.unsafe.Converter
|
||||
import xsbti.compile.TastyFiles
|
||||
import xsbti.{ FileConverter, Position }
|
||||
|
||||
|
|
@ -1068,15 +1067,15 @@ object Defaults extends BuildCommon {
|
|||
private def watchTransitiveSourcesTaskImpl(
|
||||
key: TaskKey[Seq[Source]]
|
||||
): Initialize[Task[Seq[Source]]] = {
|
||||
import ScopeFilter.Make.{ inDependencies => inDeps, _ }
|
||||
val selectDeps = ScopeFilter(inAggregates(ThisProject) || inDeps(ThisProject))
|
||||
import ScopeFilter.Make.*
|
||||
val selectDeps = ScopeFilter(inAggregates(ThisProject) || inDependencies(ThisProject))
|
||||
val allWatched = (key ?? Nil).all(selectDeps)
|
||||
Def.task { allWatched.value.flatten }
|
||||
}
|
||||
|
||||
def transitiveUpdateTask: Initialize[Task[Seq[UpdateReport]]] = {
|
||||
import ScopeFilter.Make.{ inDependencies => inDeps, _ }
|
||||
val selectDeps = ScopeFilter(inDeps(ThisProject, includeRoot = false))
|
||||
import ScopeFilter.Make.*
|
||||
val selectDeps = ScopeFilter(inDependencies(ThisProject, includeRoot = false))
|
||||
val allUpdates = update.?.all(selectDeps)
|
||||
// If I am a "build" (a project inside project/) then I have a globalPluginUpdate.
|
||||
Def.task { allUpdates.value.flatten ++ globalPluginUpdate.?.value }
|
||||
|
|
@ -1440,10 +1439,10 @@ object Defaults extends BuildCommon {
|
|||
stamps.getOrElse(
|
||||
c, {
|
||||
val x = {
|
||||
import analysis.{ apis, relations => rel }
|
||||
rel.internalClassDeps(c).map(intlStamp(_, analysis, s + c)) ++
|
||||
rel.externalDeps(c).map(stamp) ++
|
||||
rel.productClassName.reverse(c).flatMap { pc =>
|
||||
import analysis.{ apis, relations }
|
||||
relations.internalClassDeps(c).map(intlStamp(_, analysis, s + c)) ++
|
||||
relations.externalDeps(c).map(stamp) ++
|
||||
relations.productClassName.reverse(c).flatMap { pc =>
|
||||
apis.internal.get(pc).map(_.compilationTimestamp)
|
||||
} + Long.MinValue
|
||||
}.max
|
||||
|
|
@ -3046,7 +3045,6 @@ object Classpaths {
|
|||
case (a, true) => a
|
||||
})
|
||||
|
||||
@nowarn
|
||||
def forallIn[T](
|
||||
key: Scoped.ScopingSetting[SettingKey[T]], // should be just SettingKey[T] (mea culpa)
|
||||
pkgTasks: Seq[TaskKey[_]],
|
||||
|
|
@ -4217,7 +4215,6 @@ object Classpaths {
|
|||
depMap(bd.classpathTransitiveRefs(thisProj), data, s.log)
|
||||
}
|
||||
|
||||
@nowarn
|
||||
private[sbt] def depMap(
|
||||
projects: Seq[ProjectRef],
|
||||
data: Settings[Scope],
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ object EvaluateTask {
|
|||
triggers: Triggers,
|
||||
config: EvaluateTaskConfig
|
||||
)(using taskToNode: NodeView): (State, Result[T]) = {
|
||||
import ConcurrentRestrictions.{ cancellableCompletionService, tagged, tagsKey }
|
||||
import ConcurrentRestrictions.{ cancellableCompletionService, tagged }
|
||||
|
||||
val log = state.log
|
||||
log.debug(
|
||||
|
|
|
|||
|
|
@ -112,7 +112,6 @@ final case class Extracted(
|
|||
show = Aggregation.defaultShow(state, false),
|
||||
)
|
||||
|
||||
@nowarn
|
||||
private[this] def resolve[K <: Scoped.ScopingSetting[K] with Scoped](key: K): K =
|
||||
key in Scope.resolveScope(GlobalScope, currentRef.build, rootProject)(key.scope)
|
||||
|
||||
|
|
@ -149,7 +148,6 @@ final case class Extracted(
|
|||
state: State,
|
||||
sessionSettings: Seq[Setting[_]],
|
||||
): State = {
|
||||
import sbt.ProjectExtra.extract
|
||||
val appendSettings =
|
||||
Load.transformSettings(Load.projectScope(currentRef), currentRef.build, rootProject, settings)
|
||||
val newStructure = Load.reapply(sessionSettings ++ appendSettings, structure)
|
||||
|
|
|
|||
|
|
@ -823,9 +823,9 @@ object BuiltinCommands {
|
|||
def showProjects(s: State): Unit = {
|
||||
val extracted = Project extract s
|
||||
import extracted._
|
||||
import currentRef.{ build => curi, project => cid }
|
||||
listBuild(curi, structure.units(curi), true, cid, s.log)
|
||||
for ((uri, build) <- structure.units if curi != uri) listBuild(uri, build, false, cid, s.log)
|
||||
listBuild(currentRef.build, structure.units(currentRef.build), true, currentRef.project, s.log)
|
||||
for ((uri, build) <- structure.units if currentRef.build != uri)
|
||||
listBuild(uri, build, false, currentRef.project, s.log)
|
||||
}
|
||||
|
||||
def transformExtraBuilds(s: State, f: List[URI] => List[URI]): State = {
|
||||
|
|
|
|||
|
|
@ -18,14 +18,12 @@ import sbt.internal.CommandStrings._
|
|||
import Cross.{ spacedFirst, requireSession }
|
||||
import sbt.librarymanagement.VersionNumber
|
||||
import Project.inScope
|
||||
import ProjectExtra.{ extract, getProject, setProject }
|
||||
import scala.annotation.nowarn
|
||||
import ProjectExtra.{ extract, setProject }
|
||||
|
||||
/**
|
||||
* Module responsible for plugin cross building.
|
||||
*/
|
||||
private[sbt] object PluginCross {
|
||||
@nowarn
|
||||
lazy val pluginSwitch: Command = {
|
||||
def switchParser(state: State): Parser[(String, String)] = {
|
||||
lazy val switchArgs = token(NotSpace.examples()) ~ (token(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ package sbt
|
|||
import java.io.File
|
||||
import java.nio.file.{ Path => NioPath }
|
||||
import java.net.URI
|
||||
import java.util.Locale
|
||||
// import Project._
|
||||
import Keys.{
|
||||
stateBuildStructure,
|
||||
|
|
@ -46,12 +45,10 @@ import sbt.internal.{
|
|||
LoadedBuild,
|
||||
LoadedBuildUnit,
|
||||
SettingGraph,
|
||||
SettingCompletions,
|
||||
SessionSettings
|
||||
}
|
||||
import sbt.internal.util.{ AttributeKey, AttributeMap, Dag, Relation, Settings }
|
||||
import sbt.internal.util.{ AttributeKey, AttributeMap, Relation, Settings }
|
||||
import sbt.internal.util.Types.const
|
||||
import sbt.internal.util.complete.DefaultParsers
|
||||
import sbt.internal.server.ServerHandler
|
||||
import sbt.librarymanagement.Configuration
|
||||
import sbt.util.{ ActionCacheStore, Show, Level }
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ package sbt
|
|||
package internal
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.{ Files, Path }
|
||||
import java.nio.file.Path
|
||||
|
||||
import org.apache.ivy.core.module.descriptor.{ DefaultArtifact, Artifact => IArtifact }
|
||||
import org.apache.ivy.core.report.DownloadStatus
|
||||
|
|
@ -46,14 +46,12 @@ import sbt.util.{
|
|||
AggregateActionCacheStore,
|
||||
CacheImplicits,
|
||||
DiskActionCacheStore,
|
||||
InMemoryActionCacheStore,
|
||||
Logger
|
||||
}
|
||||
import sjsonnew.JsonFormat
|
||||
import xsbti.{ HashedVirtualFileRef, VirtualFileRef }
|
||||
import xsbti.compile.{ AnalysisContents, CompileAnalysis, MiniSetup, MiniOptions }
|
||||
|
||||
import scala.annotation.nowarn
|
||||
import scala.collection.mutable
|
||||
|
||||
object RemoteCache {
|
||||
|
|
@ -266,7 +264,6 @@ object RemoteCache {
|
|||
file
|
||||
}
|
||||
|
||||
@nowarn
|
||||
def configCacheSettings[A <: RemoteCacheArtifact](
|
||||
cacheArtifactTask: Def.Initialize[Task[A]]
|
||||
): Seq[Def.Setting[_]] =
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import Def.ScopedKey
|
|||
import sbt.internal.util.KeyTag
|
||||
|
||||
final case class ScopedKeyData[A](scoped: ScopedKey[A], value: Any) {
|
||||
import sbt.internal.util.Types.const
|
||||
val key = scoped.key
|
||||
val scope = scoped.scope
|
||||
def typeName: String = key.tag.toString
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import lmcoursier.definitions.{
|
|||
import lmcoursier.*
|
||||
import lmcoursier.syntax.*
|
||||
import lmcoursier.credentials.Credentials
|
||||
import lmcoursier.syntax.*
|
||||
import Keys._
|
||||
import sbt.internal.util.Util
|
||||
import sbt.librarymanagement._
|
||||
|
|
@ -34,7 +33,6 @@ import sbt.librarymanagement.ivy.{
|
|||
import sbt.util.Logger
|
||||
import sbt.io.syntax._
|
||||
import xsbti.AppConfiguration
|
||||
import sbt.SlashSyntax0._
|
||||
|
||||
object LMCoursier {
|
||||
private[this] val credentialRegistry: ConcurrentHashMap[(String, String), IvyCredentials] =
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
package sbt
|
||||
package internal
|
||||
|
||||
import java.io.File
|
||||
import java.net.{ MalformedURLException, URI, URL }
|
||||
|
||||
import sbt.internal.librarymanagement.mavenint.SbtPomExtraProperties
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ package sbt
|
|||
package internal
|
||||
|
||||
import sbt.internal.util.Types.const
|
||||
import java.io.File
|
||||
import xsbti.VirtualFile
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -12,14 +12,12 @@ import java.text.DateFormat
|
|||
|
||||
import sbt.Def.ScopedKey
|
||||
import sbt.Keys.{ showSuccess, showTiming, timingFormat }
|
||||
import sbt.SlashSyntax0._
|
||||
import sbt.ProjectExtra.*
|
||||
import sbt.internal.util.complete.Parser
|
||||
import sbt.internal.util.complete.Parser.{ failure, seq, success }
|
||||
import sbt.internal.util._
|
||||
import sbt.std.Transform.DummyTaskMap
|
||||
import sbt.util.{ Logger, Show }
|
||||
import scala.annotation.nowarn
|
||||
|
||||
sealed trait Aggregation
|
||||
object Aggregation {
|
||||
|
|
@ -297,7 +295,6 @@ object Aggregation {
|
|||
ScopedKey(resolved, key.key)
|
||||
}
|
||||
|
||||
@nowarn
|
||||
def aggregationEnabled(key: ScopedKey[_], data: Settings[Scope]): Boolean =
|
||||
Keys.aggregate in Scope.fillTaskAxis(key.scope, key.key) get data getOrElse true
|
||||
private[sbt] val suppressShow =
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import Def.Setting
|
|||
import sbt.io.Hash
|
||||
import sbt.internal.util.Attributed
|
||||
import sbt.internal.inc.ReflectUtilities
|
||||
import xsbti.HashedVirtualFileRef
|
||||
|
||||
trait BuildDef {
|
||||
def projectDefinitions(@deprecated("unused", "") baseDirectory: File): Seq[Project] = projects
|
||||
|
|
|
|||
|
|
@ -16,13 +16,11 @@ import Def.{ ScopeLocal, ScopedKey, Setting, displayFull }
|
|||
import BuildPaths.outputDirectory
|
||||
import Scope.GlobalScope
|
||||
import BuildStreams.Streams
|
||||
import sbt.LocalRootProject
|
||||
import sbt.io.syntax._
|
||||
import sbt.internal.inc.MappedFileConverter
|
||||
import sbt.internal.util.{ AttributeEntry, AttributeKey, AttributeMap, Attributed, Settings }
|
||||
import sbt.internal.util.Attributed.data
|
||||
import sbt.util.Logger
|
||||
import scala.annotation.nowarn
|
||||
import xsbti.FileConverter
|
||||
|
||||
final class BuildStructure(
|
||||
|
|
@ -400,7 +398,6 @@ object BuildStreams {
|
|||
def refTarget(ref: ResolvedReference, fallbackBase: File, data: Settings[Scope]): File =
|
||||
refTarget(GlobalScope.copy(project = Select(ref)), fallbackBase, data)
|
||||
|
||||
@nowarn
|
||||
def refTarget(scope: Scope, fallbackBase: File, data: Settings[Scope]): File =
|
||||
(Keys.target in scope get data getOrElse outputDirectory(fallbackBase)) / StreamsDirectory
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.nio.file.{ DirectoryNotEmptyException, Files, Path }
|
|||
import sbt.Def._
|
||||
import sbt.Keys._
|
||||
// import sbt.Project.richInitializeTask
|
||||
import sbt.ProjectExtra.{ *, given }
|
||||
import sbt.ProjectExtra.*
|
||||
import sbt.SlashSyntax0._
|
||||
import sbt.io.syntax._
|
||||
import sbt.nio.Keys._
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ package internal
|
|||
import java.nio.file.Path
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
import sbt.{ ProjectRef, State, Watched }
|
||||
import sbt.internal.io.{ EventMonitor, Source, WatchState => WS }
|
||||
import sbt.internal.util.AttributeKey
|
||||
import sbt.nio.file.Glob
|
||||
|
|
@ -63,11 +62,10 @@ private[internal] trait DeprecatedContinuous {
|
|||
}
|
||||
}
|
||||
|
||||
@nowarn
|
||||
private[sbt] object DeprecatedContinuous {
|
||||
private[sbt] val taskDefinitions: Seq[Def.Setting[_]] = Seq(
|
||||
sbt.Keys.watchTransitiveSources := sbt.Defaults.watchTransitiveSourcesTask.value,
|
||||
/* sbt.Keys.watchTransitiveSources := sbt.Defaults.watchTransitiveSourcesTask.value,
|
||||
sbt.Keys.watch := sbt.Defaults.watchSetting.value,
|
||||
sbt.nio.Keys.watchTasks := Continuous.continuousTask.evaluated,
|
||||
sbt.nio.Keys.watchTasks := Continuous.continuousTask.evaluated, */
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ object FileChangesMacro:
|
|||
changeKey: Expr[TaskKey[Seq[(NioPath, FileStamp)] => FileChanges]],
|
||||
mapKey: Expr[TaskKey[Seq[(NioPath, FileStamp)]]],
|
||||
)(using qctx: Quotes): Expr[FileChanges] =
|
||||
import qctx.reflect.*
|
||||
val taskScope = getTaskScope[A](in)
|
||||
'{
|
||||
val ts: Scope = $taskScope
|
||||
|
|
|
|||
|
|
@ -14,12 +14,10 @@ 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)
|
||||
|
||||
@nowarn
|
||||
def apply(
|
||||
known: Iterable[ScopedKey[_]],
|
||||
projects: Map[URI, Set[String]],
|
||||
|
|
@ -29,7 +27,6 @@ object KeyIndex {
|
|||
known.par.foldLeft(base(projects, configurations)) { _ add _ }
|
||||
}
|
||||
|
||||
@nowarn
|
||||
def aggregate(
|
||||
known: Iterable[ScopedKey[_]],
|
||||
extra: BuildUtil[_],
|
||||
|
|
|
|||
|
|
@ -188,17 +188,17 @@ private[sbt] object LibraryManagement {
|
|||
uwconfig: UnresolvedWarningConfiguration,
|
||||
log: Logger
|
||||
): Either[UnresolvedWarning, UpdateReport] = {
|
||||
import config.{ updateConfiguration => c, module => mod }
|
||||
import mod.{ id, dependencies => deps, scalaModuleInfo }
|
||||
import config.{ updateConfiguration, module }
|
||||
import module.{ id, dependencies, scalaModuleInfo }
|
||||
val base = restrictedCopy(id, true).withName(id.name + "$" + label)
|
||||
val module = lm.moduleDescriptor(base, deps, scalaModuleInfo)
|
||||
val report = lm.update(module, c, uwconfig, log) match {
|
||||
val mod = lm.moduleDescriptor(base, dependencies, scalaModuleInfo)
|
||||
val report = lm.update(mod, updateConfiguration, uwconfig, log) match {
|
||||
case Right(r) => r
|
||||
case Left(w) =>
|
||||
throw w.resolveException
|
||||
}
|
||||
val newConfig = config
|
||||
.withModule(mod.withDependencies(report.allModules))
|
||||
.withModule(module.withDependencies(report.allModules))
|
||||
lm.updateClassifiers(newConfig, uwconfig, Vector(), log)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,14 +12,12 @@ import sbt.BuildPaths._
|
|||
import sbt.Def.{ ScopeLocal, ScopedKey, Setting, isDummy }
|
||||
import sbt.Keys._
|
||||
import sbt.Project.inScope
|
||||
import sbt.ProjectExtra.{ checkTargets, prefixConfigs, setProject, showLoadingKey, structure }
|
||||
import sbt.ProjectExtra.{ prefixConfigs, setProject, showLoadingKey, structure }
|
||||
import sbt.Scope.GlobalScope
|
||||
import sbt.SlashSyntax0._
|
||||
import sbt.internal.{ Eval, EvalReporter }
|
||||
import sbt.internal.BuildStreams._
|
||||
import sbt.internal.inc.classpath.ClasspathUtil
|
||||
import sbt.internal.inc.{ MappedFileConverter, ScalaInstance, ZincLmUtil, ZincUtil }
|
||||
import sbt.internal.server.BuildServerEvalReporter
|
||||
import sbt.internal.util.Attributed.data
|
||||
import sbt.internal.util.Types.const
|
||||
import sbt.internal.util.{ Attributed, Settings }
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import sbt.internal.util.{ Terminal => ITerminal, _ }
|
|||
import sbt.util.{ Level, Logger, LoggerContext }
|
||||
|
||||
import java.io.PrintWriter
|
||||
import scala.annotation.nowarn
|
||||
|
||||
sealed abstract class LogManager {
|
||||
def apply(
|
||||
|
|
@ -61,7 +60,6 @@ object LogManager {
|
|||
|
||||
// This is called by mkStreams
|
||||
//
|
||||
@nowarn
|
||||
def construct(
|
||||
data: Settings[Scope],
|
||||
state: State
|
||||
|
|
|
|||
|
|
@ -8,10 +8,8 @@
|
|||
package sbt
|
||||
package internal
|
||||
|
||||
import sbt.internal.util.Attributed
|
||||
import java.io.File
|
||||
import java.net.URL
|
||||
import Attributed.data
|
||||
import sbt.internal.BuildDef.analyzed
|
||||
import xsbti.FileConverter
|
||||
import xsbt.api.{ Discovered, Discovery }
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import sbt.util.Logger
|
|||
|
||||
import sbt.ProjectExtra.*
|
||||
import Def.Setting
|
||||
import sbt.SlashSyntax0._
|
||||
import Plugins._
|
||||
import PluginsDebug._
|
||||
import java.net.URI
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ package internal
|
|||
|
||||
import java.net.URI
|
||||
import sbt.internal.util.complete, complete.{ DefaultParsers, Parser }, DefaultParsers._
|
||||
import sbt.internal.Eval
|
||||
import Keys.sessionSettings
|
||||
import sbt.ProjectExtra.{ extract, updateCurrent }
|
||||
|
||||
|
|
|
|||
|
|
@ -8,11 +8,10 @@
|
|||
package sbt
|
||||
package internal
|
||||
|
||||
import sbt.internal.util.{ complete, LineRange, RangePosition, Types }
|
||||
import sbt.internal.util.{ complete, LineRange, RangePosition }
|
||||
|
||||
import java.io.File
|
||||
import java.net.URI
|
||||
import sbt.ProjectExtra.extract
|
||||
import Def.{ ScopedKey, Setting }
|
||||
import SessionSettings._
|
||||
import sbt.ProjectExtra.{ extract, getProject, session, structure }
|
||||
|
|
|
|||
|
|
@ -8,18 +8,15 @@
|
|||
package sbt
|
||||
package internal
|
||||
|
||||
import sbt.internal.util.{ AttributeKey, complete, KeyTag, Relation, Settings, Types, Util }
|
||||
import sbt.internal.util.{ AttributeKey, complete, Relation, Settings, Util }
|
||||
import sbt.util.Show
|
||||
import sbt.librarymanagement.Configuration
|
||||
|
||||
import ProjectExtra.{ relation }
|
||||
import Def.{ ScopedKey, Setting }
|
||||
import Scope.Global
|
||||
import Types.idFun
|
||||
import complete._
|
||||
import DefaultParsers._
|
||||
import scala.annotation.nowarn
|
||||
import scala.reflect.ClassTag
|
||||
|
||||
/**
|
||||
* The resulting `session` and verbose and quiet summaries of the result of a set operation.
|
||||
|
|
@ -56,7 +53,6 @@ private[sbt] object SettingCompletions {
|
|||
def resolve(s: Setting[_]): Seq[Setting[_]] =
|
||||
Load.transformSettings(projectScope, currentRef.build, rootProject, s :: Nil)
|
||||
|
||||
@nowarn
|
||||
def rescope[T](setting: Setting[T]): Seq[Setting[_]] = {
|
||||
val akey = setting.key.key
|
||||
val global = ScopedKey(Global, akey)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ private[sbt] object WatchTransitiveDependencies {
|
|||
def data: Map[Scope, AttributeMap] = extracted.structure.data.data
|
||||
}
|
||||
|
||||
@nowarn
|
||||
private def argumentsImpl(
|
||||
scopedKey: ScopedKey[_],
|
||||
extracted: Extracted,
|
||||
|
|
@ -138,7 +137,6 @@ private[sbt] object WatchTransitiveDependencies {
|
|||
(inputGlobs ++ triggerGlobs ++ legacy(keys :+ scopedKey, args)).distinct.sorted
|
||||
}
|
||||
|
||||
@nowarn
|
||||
private def legacy(keys: Seq[ScopedKey[_]], args: Arguments): Seq[DynamicInput] = {
|
||||
import args._
|
||||
val projectScopes =
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ import sjsonnew.support.scalajson.unsafe.{ CompactPrinter, Converter }
|
|||
|
||||
import java.io.{ File, FileOutputStream, InputStream, OutputStream }
|
||||
import java.net.URI
|
||||
import scala.annotation.{ nowarn, tailrec }
|
||||
import scala.annotation.tailrec
|
||||
|
||||
@nowarn object TreeView {
|
||||
object TreeView {
|
||||
def createJson(graph: ModuleGraph): String = {
|
||||
val moduleModels = graph.roots
|
||||
.map(module => processSubtree(graph, module))
|
||||
|
|
|
|||
|
|
@ -10,21 +10,20 @@ package sbt.internal.server
|
|||
import dotty.tools.dotc.core.Contexts.Context
|
||||
import dotty.tools.dotc.reporting.{ Diagnostic => ScalaDiagnostic }
|
||||
import dotty.tools.dotc.reporting.Reporter
|
||||
import sbt.StandardMain.exchange
|
||||
// import sbt.StandardMain.exchange
|
||||
import sbt.internal.ForwardingReporter
|
||||
import sbt.internal.bsp
|
||||
import sbt.internal.bsp.{
|
||||
BuildTargetIdentifier,
|
||||
Diagnostic,
|
||||
DiagnosticSeverity,
|
||||
PublishDiagnosticsParams,
|
||||
Range,
|
||||
TextDocumentIdentifier
|
||||
// DiagnosticSeverity,
|
||||
// PublishDiagnosticsParams,
|
||||
// Range,
|
||||
// TextDocumentIdentifier
|
||||
}
|
||||
|
||||
import java.nio.file.{ Files, Path, Paths }
|
||||
import java.nio.file.Path
|
||||
import scala.collection.mutable
|
||||
import sbt.internal.bsp.codec.JsonProtocol._
|
||||
|
||||
class BuildServerEvalReporter(buildTarget: BuildTargetIdentifier, delegate: Reporter)
|
||||
extends ForwardingReporter(delegate):
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import java.net.URI
|
|||
import sbt.BuildPaths.{ configurationSources, projectStandard }
|
||||
import sbt.BuildSyntax._
|
||||
import sbt.Def._
|
||||
import sbt.Def.{ parsed }
|
||||
import sbt.Keys._
|
||||
import sbt.Project._
|
||||
import sbt.ProjectExtra.*
|
||||
|
|
@ -41,7 +40,7 @@ import scala.collection.mutable
|
|||
|
||||
// import scala.annotation.nowarn
|
||||
import scala.util.control.NonFatal
|
||||
import scala.util.{ Failure, Success, Try }
|
||||
import scala.util.{ Failure, Success }
|
||||
import scala.annotation.nowarn
|
||||
import sbt.testing.Framework
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ package server
|
|||
import java.net.URI
|
||||
import java.nio.file._
|
||||
|
||||
import scala.annotation.{ nowarn, tailrec }
|
||||
import scala.annotation.tailrec
|
||||
import scala.jdk.CollectionConverters.*
|
||||
import scala.concurrent.{ ExecutionContext, Future }
|
||||
import scala.reflect.NameTransformer
|
||||
|
|
@ -27,7 +27,6 @@ import sbt.internal.inc.JavaInterfaceUtil._
|
|||
import sbt.internal.parser.SbtParser
|
||||
import sbt.internal.protocol.JsonRpcResponseError
|
||||
import sbt.internal.protocol.codec.JsonRPCProtocol
|
||||
import sbt.internal.langserver
|
||||
import sbt.internal.langserver.{ ErrorCodes, Location, Position, Range, TextDocumentPositionParams }
|
||||
import sbt.util.Logger
|
||||
import sbt.Keys._
|
||||
|
|
@ -239,7 +238,6 @@ private[sbt] object Definition {
|
|||
result.future
|
||||
}
|
||||
|
||||
@nowarn
|
||||
def lspDefinition(
|
||||
jsonDefinition: JValue,
|
||||
requestId: String,
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import sbt.internal.util.Terminal.TerminalImpl
|
|||
import sbt.internal.util.complete.{ Parser, Parsers }
|
||||
import sbt.util.Logger
|
||||
|
||||
import scala.annotation.{ nowarn, tailrec }
|
||||
import scala.annotation.tailrec
|
||||
import scala.collection.mutable
|
||||
import scala.concurrent.duration._
|
||||
import scala.util.Try
|
||||
|
|
@ -422,7 +422,6 @@ final class NetworkChannel(
|
|||
}
|
||||
}
|
||||
|
||||
@nowarn
|
||||
protected def onCompletionRequest(execId: Option[String], cp: CompletionParams) = {
|
||||
if (initialized) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import java.net.URI
|
|||
import sjsonnew.shaded.scalajson.ast.unsafe.JValue
|
||||
import scala.util.{ Left, Right }
|
||||
import sbt.util.{ SomeJsonWriter, NoJsonWriter }
|
||||
import sbt.librarymanagement.LibraryManagementCodec._
|
||||
import sbt.protocol._
|
||||
import sjsonnew._
|
||||
import sjsonnew.support.scalajson.unsafe._
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ import sbt.protocol.{
|
|||
TerminalSetRawModeCommand,
|
||||
}
|
||||
import sbt.protocol.codec.JsonProtocol._
|
||||
import sbt.protocol.TerminalGetSizeResponse
|
||||
|
||||
object VirtualTerminal {
|
||||
private[this] val pendingTerminalProperties =
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import sbt.io.IO
|
|||
import sbt.nio.file.FileAttributes
|
||||
import sjsonnew.{ Builder, JsonFormat, Unbuilder, deserializationError }
|
||||
import xsbti.compile.analysis.{ Stamp => XStamp }
|
||||
import org.checkerframework.checker.units.qual.A
|
||||
|
||||
/**
|
||||
* A trait that indicates what file stamping implementation should be used to track the state of
|
||||
|
|
|
|||
|
|
@ -107,7 +107,6 @@ private[sbt] object Settings {
|
|||
}
|
||||
}
|
||||
|
||||
@nowarn
|
||||
private[sbt] val inject: Def.ScopedKey[_] => Seq[Def.Setting[_]] = scopedKey =>
|
||||
scopedKey.key match {
|
||||
case transitiveDynamicInputs.key =>
|
||||
|
|
@ -142,7 +141,6 @@ private[sbt] object Settings {
|
|||
* @return a task definition that retrieves the file input files and their attributes scoped
|
||||
* to a particular task.
|
||||
*/
|
||||
@nowarn
|
||||
private[sbt] def inputPathSettings(setting: Def.Setting[_]): Seq[Def.Setting[_]] = {
|
||||
val scopedKey = setting.key
|
||||
val scope = scopedKey.scope
|
||||
|
|
@ -172,7 +170,6 @@ private[sbt] object Settings {
|
|||
* @param scope the key whose file inputs we are seeking
|
||||
* @return a task definition that retrieves all of the input paths scoped to the input key.
|
||||
*/
|
||||
@nowarn
|
||||
private[this] def allFilesImpl(scope: Scope): Def.Setting[_] = {
|
||||
addTaskDefinition(Keys.allInputFiles in scope := {
|
||||
val filter =
|
||||
|
|
@ -192,7 +189,6 @@ private[sbt] object Settings {
|
|||
* @param scope the scope corresponding to the task whose fileInputs we are seeking
|
||||
* @return a task definition that retrieves the changed input files scoped to the key.
|
||||
*/
|
||||
@nowarn
|
||||
private[this] def changedInputFilesImpl(scope: Scope): List[Def.Setting[_]] =
|
||||
changedFilesImpl(scope, changedInputFiles, inputFileStamps) ::
|
||||
(watchForceTriggerOnAnyChange in scope := {
|
||||
|
|
@ -202,7 +198,6 @@ private[sbt] object Settings {
|
|||
}
|
||||
}) :: Nil
|
||||
|
||||
@nowarn
|
||||
private[this] def changedFilesImpl(
|
||||
scope: Scope,
|
||||
changeKey: TaskKey[Seq[(Path, FileStamp)] => FileChanges],
|
||||
|
|
@ -249,7 +244,6 @@ private[sbt] object Settings {
|
|||
* @param scope the scope to add the custom clean
|
||||
* @return a task specific clean implementation
|
||||
*/
|
||||
@nowarn
|
||||
private[sbt] def cleanImpl(scope: Scope): Def.Setting[_] = addTaskDefinition {
|
||||
sbt.Keys.clean in scope := Clean.task(scope, full = false).value
|
||||
}
|
||||
|
|
@ -286,7 +280,6 @@ private[sbt] object Settings {
|
|||
* @return a task definition that retrieves the input files and their file stamps scoped to the
|
||||
* input key.
|
||||
*/
|
||||
@nowarn
|
||||
private[sbt] def fileStamps(scopedKey: Def.ScopedKey[_]): Def.Setting[_] = {
|
||||
import sbt.internal.CompatParColls.Converters._
|
||||
val scope = scopedKey.scope
|
||||
|
|
@ -324,7 +317,6 @@ private[sbt] object Settings {
|
|||
allOutputPathsImpl(scope) :: outputFileStampsImpl(scope) :: cleanImpl(taskKey) :: changes
|
||||
}
|
||||
|
||||
@nowarn
|
||||
private[this] def allOutputPathsImpl(scope: Scope): Def.Setting[_] =
|
||||
addTaskDefinition(allOutputFiles in scope := {
|
||||
val filter =
|
||||
|
|
@ -351,7 +343,6 @@ private[sbt] object Settings {
|
|||
}
|
||||
})
|
||||
|
||||
@nowarn
|
||||
private[this] def outputFileStampsImpl(scope: Scope): Def.Setting[_] =
|
||||
addTaskDefinition(outputFileStamps in scope := {
|
||||
val stamper: Path => Option[FileStamp] = (outputFileStamper in scope).value match {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import java.util.Locale
|
|||
import java.util.concurrent.TimeUnit
|
||||
|
||||
import sbt.BasicCommandStrings.{ ContinuousExecutePrefix, TerminateAction }
|
||||
import sbt.SlashSyntax0._
|
||||
import sbt._
|
||||
import sbt.internal.LabeledFunctions._
|
||||
import sbt.internal.nio.FileEvent
|
||||
|
|
|
|||
|
|
@ -30,6 +30,13 @@ object HouseRulesPlugin extends AutoPlugin {
|
|||
scalacOptions ++= "-Ywarn-numeric-widen".ifScala2.value.toList,
|
||||
scalacOptions ++= "-Ywarn-value-discard".ifScala2.value.toList,
|
||||
scalacOptions ++= "-Ywarn-unused-import".ifScala2x(v => 11 <= v && v <= 12).value.toList,
|
||||
scalacOptions ++= {
|
||||
scalaPartV.value match {
|
||||
case Some((3, _)) => Seq("-Wunused:imports,implicits,nowarn")
|
||||
case Some((2, _)) => Seq("-Ywarn-unused:-privates,-locals,-explicits")
|
||||
case _ => Seq.empty
|
||||
}
|
||||
},
|
||||
scalacOptions ++= "-Xsource:3".ifScala2.value.toList
|
||||
) ++ Seq(Compile, Test).flatMap(c =>
|
||||
(c / console / scalacOptions) --= Seq("-Ywarn-unused-import", "-Xlint")
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import sbt.nio.FileStamp
|
|||
import sjsonnew.JsonFormat
|
||||
import java.nio.file.{ Path => NioPath }
|
||||
|
||||
import sbt.internal.FileChangesMacro
|
||||
import sbt.librarymanagement.{ Configuration, ConfigurationMacro }
|
||||
import scala.language.experimental.macros
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import RemoteSbtCreatorProp._
|
|||
|
||||
import scala.annotation.nowarn
|
||||
import scala.collection.parallel.ForkJoinTaskSupport
|
||||
import scala.collection.{ GenSeq, mutable }
|
||||
import scala.collection.mutable
|
||||
import scala.util.control.NonFatal
|
||||
|
||||
final class ScriptedTests(
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ package sbt
|
|||
package std
|
||||
|
||||
import sbt.internal.Action
|
||||
import sbt.internal.util.{ DelegatingPMap, RMap }
|
||||
import sbt.internal.util.DelegatingPMap
|
||||
import sbt.internal.util.TupleMapExtension.*
|
||||
import TaskExtra.{ all, existToAny }
|
||||
import sbt.internal.util.Types.*
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import TaskGen.MaxWorkers
|
|||
import org.scalacheck._
|
||||
import Prop.forAll
|
||||
import Transform.taskToNode
|
||||
import ConcurrentRestrictions.{ completionService, limitTotal, tagged }
|
||||
import ConcurrentRestrictions.{ completionService, limitTotal }
|
||||
|
||||
import java.util.concurrent.{ CountDownLatch, TimeUnit }
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ package sbt
|
|||
import scala.collection.mutable.ListBuffer
|
||||
|
||||
import sbt.internal.util.IDSet
|
||||
import Incomplete.{ Error, Value => IValue }
|
||||
import Incomplete.{ Value => IValue }
|
||||
import scala.jdk.CollectionConverters.*
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
package sbt
|
||||
|
||||
import sbt.internal.util.AttributeMap
|
||||
|
||||
trait TaskId[A]:
|
||||
def tags: ConcurrentRestrictions.TagMap
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ package internal
|
|||
package util
|
||||
|
||||
import java.io.InputStream
|
||||
import java.nio.file.{ Files, Path, Paths }
|
||||
import java.nio.file.{ Files, Path }
|
||||
import sbt.util.{ Digest, HashUtil }
|
||||
import xsbti.{ BasicVirtualFileRef, FileConverter, PathBasedFile, VirtualFileRef, VirtualFile }
|
||||
import xsbti.{ BasicVirtualFileRef, PathBasedFile }
|
||||
|
||||
class PlainVirtualFile1(path: Path, id: String) extends BasicVirtualFileRef(id) with PathBasedFile:
|
||||
override def contentHash: Long = HashUtil.farmHash(path)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package sbt.util
|
||||
|
||||
import java.io.InputStream
|
||||
import java.nio.file.{ Files, Path }
|
||||
import sjsonnew.*
|
||||
import sjsonnew.support.scalajson.unsafe.{ CompactPrinter, Converter, Parser }
|
||||
|
|
@ -9,11 +8,9 @@ import sjsonnew.shaded.scalajson.ast.unsafe.JValue
|
|||
import scala.collection.mutable
|
||||
import scala.reflect.ClassTag
|
||||
import scala.util.control.NonFatal
|
||||
import sbt.internal.util.PlainVirtualFile1
|
||||
import sbt.io.IO
|
||||
import sbt.io.syntax.*
|
||||
import xsbti.{ HashedVirtualFileRef, PathBasedFile, VirtualFile, VirtualFileRef }
|
||||
import sbt.nio.file.FileAttributes
|
||||
import xsbti.{ HashedVirtualFileRef, PathBasedFile, VirtualFile }
|
||||
|
||||
/**
|
||||
* An abstration of a remote or local cache store.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package sbt.util
|
|||
|
||||
import java.nio.file.{ Files, Path }
|
||||
import net.openhft.hashing.LongHashFunction
|
||||
import scala.util.Try
|
||||
|
||||
object HashUtil:
|
||||
private[sbt] def farmHash(bytes: Array[Byte]): Long =
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package sbt.util
|
|||
|
||||
import java.io.File
|
||||
import java.nio.file.Path
|
||||
import sjsonnew.{ Builder, HashWriter, JsonWriter }
|
||||
import sjsonnew.{ Builder, HashWriter }
|
||||
import StringStrings.StringString
|
||||
import xsbti.{ HashedVirtualFileRef, VirtualFile }
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import sbt.internal.util.StringVirtualFile1
|
|||
import sbt.io.IO
|
||||
import sbt.io.syntax.*
|
||||
import verify.BasicTestSuite
|
||||
import java.nio.file.Paths
|
||||
import xsbti.VirtualFile
|
||||
|
||||
object ActionCacheTest extends BasicTestSuite:
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
package sbt.util
|
||||
|
||||
import java.io.File
|
||||
import sbt.internal.util.StringVirtualFile1
|
||||
import sjsonnew.BasicJsonProtocol
|
||||
import sjsonnew.support.murmurhash.Hasher
|
||||
import verify.BasicTestSuite
|
||||
import xsbti.{ BasicVirtualFileRef, HashedVirtualFileRef, VirtualFile }
|
||||
import xsbti.HashedVirtualFileRef
|
||||
|
||||
object HasherTest extends BasicTestSuite:
|
||||
import BasicJsonProtocol.implicitHashWriter
|
||||
|
||||
final val blankContentHash = -7286425919675154353L
|
||||
val blankContentHashStr = "farm64-9ae16a3b2f90404f"
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import scala.util.{ Failure, Try, Success => USuccess }
|
|||
|
||||
import java.io.File
|
||||
import sbt.io.IO
|
||||
import sbt.io.syntax._
|
||||
import sbt.internal.util.EmptyCacheError
|
||||
|
||||
import sjsonnew.{ JsonFormat, JsonWriter }
|
||||
|
|
|
|||
Loading…
Reference in New Issue