mirror of https://github.com/sbt/sbt.git
fix warning. prepare Scala 3
This commit is contained in:
parent
f4cd994ab4
commit
3ca1898721
|
|
@ -15,7 +15,7 @@ private[sbt] object JsonUtil {
|
|||
log: Logger
|
||||
): UpdateReport = {
|
||||
try {
|
||||
val lite = CacheStore(path).read[UpdateReportLite]
|
||||
val lite = CacheStore(path).read[UpdateReportLite]()
|
||||
fromLite(lite, cachedDescriptor)
|
||||
} catch {
|
||||
case e: Throwable =>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ object UpdateClassifiersUtil {
|
|||
classifiers: Vector[String],
|
||||
exclude: Map[ModuleID, Set[ConfigRef]]
|
||||
)(m: ModuleID): Option[ModuleID] = {
|
||||
val excluded: Set[ConfigRef] = exclude getOrElse (restrictedCopy(m, false), Set.empty)
|
||||
val excluded: Set[ConfigRef] = exclude.getOrElse(restrictedCopy(m, false), Set.empty)
|
||||
val exls = excluded map { _.name }
|
||||
val included = classifiers filterNot exls
|
||||
if (included.isEmpty) None
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ object VersionRange {
|
|||
// See https://github.com/sbt/sbt/issues/2954
|
||||
def stripMavenVersionRange(version: String): Option[String] =
|
||||
if (isVersionRange(version)) {
|
||||
val noSpace = version.replaceAllLiterally(" ", "")
|
||||
val noSpace = version.replace(" ", "")
|
||||
noSpace match {
|
||||
case MavenVersionSetPattern(open1, x1, comma, x2, close1, _) =>
|
||||
// http://maven.apache.org/components/enforcer/enforcer-rules/versionRanges.html
|
||||
|
|
@ -64,7 +64,7 @@ object VersionRange {
|
|||
val start = rev(0)
|
||||
val stop = rev(rev.length - 1)
|
||||
val mid = rev.substring(1, rev.length - 1)
|
||||
(if (start == ']') "(" else start) + mid + (if (stop == '[') ")" else stop)
|
||||
(if (start == ']') "(" else start.toString) + mid + (if (stop == '[') ")" else stop)
|
||||
case _ => revision
|
||||
}
|
||||
} catch {
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ object EvictionError {
|
|||
)
|
||||
}
|
||||
|
||||
implicit val evictionErrorLines: ShowLines[EvictionError] = ShowLines { a: EvictionError =>
|
||||
implicit val evictionErrorLines: ShowLines[EvictionError] = ShowLines { (a: EvictionError) =>
|
||||
a.toLines
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ final class EvictionPair private[sbt] (
|
|||
}
|
||||
|
||||
object EvictionPair {
|
||||
implicit val evictionPairLines: ShowLines[EvictionPair] = ShowLines { a: EvictionPair =>
|
||||
implicit val evictionPairLines: ShowLines[EvictionPair] = ShowLines { (a: EvictionPair) =>
|
||||
val revs = a.evicteds map { _.module.revision }
|
||||
val revsStr = if (revs.size <= 1) revs.mkString else "{" + revs.mkString(", ") + "}"
|
||||
val seen: mutable.Set[ModuleID] = mutable.Set()
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ private[librarymanagement] abstract class ModuleIDExtra {
|
|||
|
||||
/** String representation of the extra attributes, excluding any information only attributes. */
|
||||
def extraString: String =
|
||||
extraDependencyAttributes.map { case (k, v) => k + "=" + v } mkString ("(", ", ", ")")
|
||||
extraDependencyAttributes.map { case (k, v) => k + "=" + v }.mkString("(", ", ", ")")
|
||||
|
||||
/** Returns the extra attributes except for ones marked as information only (ones that typically would not be used for dependency resolution). */
|
||||
def extraDependencyAttributes: Map[String, String] =
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ object UnresolvedWarning {
|
|||
} map {
|
||||
case (_, p) => p
|
||||
}
|
||||
val failedPaths = err.failed map { x: ModuleID =>
|
||||
val failedPaths = err.failed map { (x: ModuleID) =>
|
||||
err.failedPaths(x).toList.reverse map { id =>
|
||||
(id, modulePosition(id))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -433,11 +433,11 @@ final class IvySbt(
|
|||
unionFormat2[IvyConfiguration, InlineIvyConfiguration, ExternalIvyConfiguration]
|
||||
|
||||
object NullLogger extends sbt.internal.util.BasicLogger {
|
||||
override def control(event: sbt.util.ControlEvent.Value, message: ⇒ String): Unit = ()
|
||||
override def log(level: Level.Value, message: ⇒ String): Unit = ()
|
||||
override def control(event: sbt.util.ControlEvent.Value, message: => String): Unit = ()
|
||||
override def log(level: Level.Value, message: => String): Unit = ()
|
||||
override def logAll(events: Seq[sbt.util.LogEvent]): Unit = ()
|
||||
override def success(message: ⇒ String): Unit = ()
|
||||
override def trace(t: ⇒ Throwable): Unit = ()
|
||||
override def success(message: => String): Unit = ()
|
||||
override def trace(t: => Throwable): Unit = ()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@ object IvyActions {
|
|||
val toRetrieve: Option[Vector[ConfigRef]] = config.configurationsToRetrieve
|
||||
val base = getRetrieveDirectory(config.retrieveDirectory)
|
||||
val pattern = getRetrievePattern(config.outputPattern)
|
||||
val existingFiles = PathFinder(base).allPaths.get filterNot { _.isDirectory }
|
||||
val existingFiles = PathFinder(base).allPaths.get() filterNot { _.isDirectory }
|
||||
val toCopy = new collection.mutable.HashSet[(File, File)]
|
||||
val retReport = report retrieve { (conf: ConfigRef, mid, art, cached) =>
|
||||
toRetrieve match {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import scala.util.{ Failure, Success, Try }
|
|||
|
||||
private[sbt] object IvyUtil {
|
||||
def separate[A, B](l: Seq[Either[A, B]]): (Seq[A], Seq[B]) =
|
||||
(l.flatMap(_.left.toOption), l.flatMap(_.right.toOption))
|
||||
(l.flatMap(_.left.toOption), l.flatMap(_.toOption))
|
||||
|
||||
@tailrec
|
||||
final def retryWithBackoff[T](
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ private[sbt] class CachedResolutionResolveCache {
|
|||
val maxConflictCacheSize: Int = 1024
|
||||
val maxUpdateReportCacheSize: Int = 1024
|
||||
|
||||
def clean(): Unit = updateReportCache.clear
|
||||
def clean(): Unit = updateReportCache.clear()
|
||||
|
||||
def directDependencies(md0: ModuleDescriptor): Vector[DependencyDescriptor] =
|
||||
md0.getDependencies.toVector
|
||||
|
|
@ -699,11 +699,11 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
|
|||
)
|
||||
}
|
||||
(if (n > guard) {
|
||||
warnCircular
|
||||
warnCircular()
|
||||
result0
|
||||
} else if (called.isEmpty) result0
|
||||
else if (notCalled.isEmpty) {
|
||||
warnCircular
|
||||
warnCircular()
|
||||
sortModules(cs.tail, acc, extra :+ cs.head, n + 1, guard)
|
||||
} else sortModules(called, acc ++ notCalled, extra, 0, called.size * called.size + 1))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ final class DirectCredentials(
|
|||
val dq = '"'
|
||||
val r =
|
||||
if (realm == null) "null"
|
||||
else dq + realm + dq
|
||||
else s"$dq$realm$dq"
|
||||
s"""DirectCredentials($r, "$host", "$userName", ****)"""
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ trait BaseIvySpecification extends AbstractEngineSpec {
|
|||
}
|
||||
}
|
||||
|
||||
def cleanCache: Unit = cleanIvyCache()
|
||||
def cleanCache(): Unit = cleanIvyCache()
|
||||
def cleanIvyCache(): Unit = IO.delete(currentTarget / "cache")
|
||||
|
||||
override def cleanCachedResolutionCache(module: ModuleDescriptor): Unit = {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package sbt.internal.librarymanagement
|
||||
|
||||
import java.io.File
|
||||
|
||||
import org.apache.ivy.util.Message
|
||||
import sbt.librarymanagement._
|
||||
import sbt.librarymanagement.ivy._
|
||||
|
|
|
|||
Loading…
Reference in New Issue