mirror of https://github.com/sbt/sbt.git
Merge pull request #8267 from xuwei-k/delete-unused-code
This commit is contained in:
commit
f75241ff95
30
build.sbt
30
build.sbt
|
|
@ -117,7 +117,7 @@ def testedBaseSettings: Seq[Setting[?]] =
|
|||
|
||||
val sbt20Plus =
|
||||
Seq(
|
||||
"2.0.0-RC2",
|
||||
"2.0.0-RC4",
|
||||
)
|
||||
val mimaSettings = mimaSettingsSince(sbt20Plus)
|
||||
def mimaSettingsSince(versions: Seq[String]): Seq[Def.Setting[?]] = Def settings (
|
||||
|
|
@ -372,6 +372,10 @@ lazy val utilCache = project
|
|||
Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||
Compile / generateContrabands / contrabandFormatsForType := ContrabandConfig.getFormats,
|
||||
mimaSettings,
|
||||
mimaBinaryIssueFilters ++= Seq(
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.util.ActionCacheError"),
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.util.ActionCacheError$")
|
||||
),
|
||||
Test / fork := true,
|
||||
)
|
||||
.configure(
|
||||
|
|
@ -730,7 +734,29 @@ lazy val mainProj = (project in file("main"))
|
|||
// TODO: Fix doc
|
||||
Compile / doc / sources := Nil,
|
||||
mimaSettings,
|
||||
// mimaBinaryIssueFilters ++= Vector(),
|
||||
mimaBinaryIssueFilters ++= Vector(
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.ConfigData"),
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.ConfigData$"),
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.graph.backend.IvyReport"),
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.graph.backend.IvyReport$"),
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.graph.rendering.LicenseInfo"),
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.graph.rendering.LicenseInfo$"),
|
||||
ProblemFilters.exclude[MissingClassProblem](
|
||||
"sbt.internal.librarymanagement.FakeRawRepository"
|
||||
),
|
||||
ProblemFilters.exclude[MissingClassProblem](
|
||||
"sbt.internal.librarymanagement.FakeRawRepository$"
|
||||
),
|
||||
ProblemFilters.exclude[MissingFieldProblem]("sbt.internal.server.NetworkChannel.SingleLine"),
|
||||
ProblemFilters.exclude[MissingFieldProblem]("sbt.internal.server.NetworkChannel.InHeader"),
|
||||
ProblemFilters.exclude[MissingFieldProblem]("sbt.internal.server.NetworkChannel.InBody"),
|
||||
ProblemFilters.exclude[MissingClassProblem](
|
||||
"sbt.internal.server.NetworkChannel$ChannelState"
|
||||
),
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.server.NetworkChannel$InBody$"),
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.server.NetworkChannel$InHeader$"),
|
||||
ProblemFilters.exclude[MissingClassProblem]("sbt.internal.server.NetworkChannel$SingleLine$"),
|
||||
),
|
||||
)
|
||||
.dependsOn(lmCore, lmIvy, lmCoursierShadedPublishing)
|
||||
.configure(addSbtIO, addSbtCompilerInterface, addSbtZincCompileCore)
|
||||
|
|
|
|||
|
|
@ -132,8 +132,6 @@ private[sbt] final class AKeyIndex(val data: Relation[Option[AttributeKey[?]], S
|
|||
|
||||
private[sbt] case class IdentifiableConfig(name: String, ident: Option[String])
|
||||
|
||||
private[sbt] case class ConfigData(ident: Option[String], keys: AKeyIndex)
|
||||
|
||||
/*
|
||||
* data contains the mapping between a configuration name and its keys.
|
||||
* configIdentToName contains the mapping between a configuration ident and its name
|
||||
|
|
|
|||
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* sbt
|
||||
* Copyright 2023, Scala center
|
||||
* Copyright 2011 - 2022, Lightbend, Inc.
|
||||
* Copyright 2008 - 2010, Mark Harrah
|
||||
* Licensed under Apache License 2.0 (see LICENSE)
|
||||
*/
|
||||
|
||||
package sbt
|
||||
package internal
|
||||
package graph
|
||||
package backend
|
||||
|
||||
import scala.xml.{ NodeSeq, Document, Node }
|
||||
import scala.xml.parsing.ConstructingParser
|
||||
|
||||
object IvyReport {
|
||||
def fromReportFile(ivyReportFile: String): ModuleGraph =
|
||||
fromReportXML(loadXML(ivyReportFile))
|
||||
|
||||
def fromReportXML(doc: Document): ModuleGraph = {
|
||||
def edgesForModule(id: GraphModuleId, revision: NodeSeq): Seq[Edge] =
|
||||
for {
|
||||
caller <- revision \ "caller"
|
||||
callerModule = moduleIdFromElement(caller, caller.attribute("callerrev").get.text)
|
||||
} yield (moduleIdFromElement(caller, caller.attribute("callerrev").get.text), id)
|
||||
|
||||
val moduleEdges: Seq[(Module, Seq[Edge])] = for {
|
||||
mod <- doc \ "dependencies" \ "module"
|
||||
revision <- mod \ "revision"
|
||||
rev = revision.attribute("name").get.text
|
||||
moduleId = moduleIdFromElement(mod, rev)
|
||||
module = Module(
|
||||
moduleId,
|
||||
(revision \ "license").headOption.flatMap(_.attribute("name")).map(_.text),
|
||||
evictedByVersion =
|
||||
(revision \ "evicted-by").headOption.flatMap(_.attribute("rev").map(_.text)),
|
||||
error = revision.attribute("error").map(_.text)
|
||||
)
|
||||
} yield (module, edgesForModule(moduleId, revision))
|
||||
|
||||
val (nodes, edges) = moduleEdges.unzip
|
||||
|
||||
val info = (doc \ "info").head
|
||||
def infoAttr(name: String): String =
|
||||
info
|
||||
.attribute(name)
|
||||
.getOrElse(throw new IllegalArgumentException("Missing attribute " + name))
|
||||
.text
|
||||
val rootModule = Module(
|
||||
GraphModuleId(infoAttr("organization"), infoAttr("module"), infoAttr("revision"))
|
||||
)
|
||||
|
||||
ModuleGraph(rootModule +: nodes, edges.flatten)
|
||||
}
|
||||
|
||||
private def moduleIdFromElement(element: Node, version: String): GraphModuleId =
|
||||
GraphModuleId(
|
||||
element.attribute("organization").get.text,
|
||||
element.attribute("name").get.text,
|
||||
version
|
||||
)
|
||||
|
||||
private def loadXML(ivyReportFile: String) =
|
||||
ConstructingParser
|
||||
.fromSource(scala.io.Source.fromFile(ivyReportFile), preserveWS = false)
|
||||
.document()
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* sbt
|
||||
* Copyright 2023, Scala center
|
||||
* Copyright 2011 - 2022, Lightbend, Inc.
|
||||
* Copyright 2008 - 2010, Mark Harrah
|
||||
* Licensed under Apache License 2.0 (see LICENSE)
|
||||
*/
|
||||
|
||||
package sbt
|
||||
package internal
|
||||
package graph
|
||||
package rendering
|
||||
|
||||
object LicenseInfo {
|
||||
def render(graph: ModuleGraph): String =
|
||||
graph.nodes
|
||||
.filter(_.isUsed)
|
||||
.groupBy(_.license)
|
||||
.toSeq
|
||||
.sortBy(_._1)
|
||||
.map { (license, modules) =>
|
||||
license.getOrElse("No license specified") + "\n" +
|
||||
modules.map(m => s"\t ${m.id.idString}").mkString("\n")
|
||||
}
|
||||
.mkString("\n\n")
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
/*
|
||||
* sbt
|
||||
* Copyright 2023, Scala center
|
||||
* Copyright 2011 - 2022, Lightbend, Inc.
|
||||
* Copyright 2008 - 2010, Mark Harrah
|
||||
* Licensed under Apache License 2.0 (see LICENSE)
|
||||
*/
|
||||
|
||||
package sbt
|
||||
package internal
|
||||
package librarymanagement
|
||||
|
||||
import sbt.io.IO
|
||||
import sbt.librarymanagement.RawRepository
|
||||
|
||||
object FakeRawRepository {
|
||||
def create(name: String): RawRepository =
|
||||
new RawRepository(new FakeResolver(name, IO.createTemporaryDirectory, Map.empty), name)
|
||||
}
|
||||
|
|
@ -946,10 +946,6 @@ final class NetworkChannel(
|
|||
}
|
||||
|
||||
object NetworkChannel {
|
||||
sealed trait ChannelState
|
||||
case object SingleLine extends ChannelState
|
||||
case object InHeader extends ChannelState
|
||||
case object InBody extends ChannelState
|
||||
private[sbt] def cancel(
|
||||
execID: Option[String],
|
||||
id: String,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package internal
|
|||
package util
|
||||
|
||||
import scala.collection.concurrent.TrieMap
|
||||
import xsbti.VirtualFileRef
|
||||
|
||||
enum ActionCacheEvent:
|
||||
case Found(storeName: String)
|
||||
|
|
@ -11,8 +10,6 @@ enum ActionCacheEvent:
|
|||
case Error
|
||||
end ActionCacheEvent
|
||||
|
||||
case class ActionCacheError(outputFiles: Seq[VirtualFileRef])
|
||||
|
||||
enum CacheEventSummary:
|
||||
case Empty
|
||||
case Data(
|
||||
|
|
|
|||
Loading…
Reference in New Issue