mirror of https://github.com/sbt/sbt.git
Apply Scalafmt
This commit is contained in:
parent
4ad6ede56e
commit
8041bdd28b
|
|
@ -205,10 +205,10 @@ lazy val sbtRoot: Project = (project in file("."))
|
|||
val dir = nativeInstallDirectory.?.value
|
||||
val target = Def.spaceDelimited("").parsed.headOption match {
|
||||
case Some(p) => file(p).toPath
|
||||
case _ =>
|
||||
case _ =>
|
||||
dir match {
|
||||
case Some(d) => d / "sbtn"
|
||||
case _ =>
|
||||
case _ =>
|
||||
val msg = "Expected input parameter <path>: installNativeExecutable /usr/local/bin"
|
||||
throw new IllegalStateException(msg)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ package util
|
|||
package appmacro
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.{ Path as NioPath }
|
||||
import java.nio.file.Path as NioPath
|
||||
import scala.collection.mutable.ListBuffer
|
||||
import scala.reflect.ClassTag
|
||||
import scala.quoted.*
|
||||
|
|
@ -203,7 +203,7 @@ trait Cont:
|
|||
$applicativeExpr.pure[A1] { () => $body }
|
||||
}
|
||||
eitherTree match
|
||||
case Left(_) => pure0[Effect[A]](inner(body).asExprOf[Effect[A]])
|
||||
case Left(_) => pure0[Effect[A]](inner(body).asExprOf[Effect[A]])
|
||||
case Right(_) =>
|
||||
flatten(pure0[F[Effect[A]]](inner(body).asExprOf[F[Effect[A]]]))
|
||||
|
||||
|
|
@ -296,7 +296,7 @@ trait Cont:
|
|||
s"qual (${qual}) not found in ${inputs.map(_.qual)}"
|
||||
)
|
||||
applyTuple(p0, br.inputTupleTypeRepr, idx)
|
||||
}
|
||||
}
|
||||
val modifiedBody =
|
||||
transformWrappers(body.asTerm.changeOwner(sym), substitute, sym).asExprOf[A1]
|
||||
cacheConfigExprOpt match
|
||||
|
|
@ -467,7 +467,7 @@ trait Cont:
|
|||
// todo cache opt-out attribute
|
||||
inputBuf += Input(TypeRepr.of[a], qual, replacement, freshName("q"))
|
||||
oldTree
|
||||
}
|
||||
}
|
||||
val exprWithConfig =
|
||||
cacheConfigExprOpt.map(config => '{ $config; $expr }).getOrElse(expr)
|
||||
val body = transformWrappers(exprWithConfig.asTerm, record, Symbol.spliceOwner)
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ trait ContextUtil[C <: Quotes & scala.Singleton](val valStart: Int):
|
|||
case Some(annot) =>
|
||||
annot.asExprOf[cacheLevel] match
|
||||
case '{ cacheLevel(include = Array.empty[CacheLevelTag](using $_)) } => Nil
|
||||
case '{ cacheLevel(include = Array[CacheLevelTag]($include*)) } =>
|
||||
case '{ cacheLevel(include = Array[CacheLevelTag]($include*)) } =>
|
||||
include.value.get.toList
|
||||
case _ => sys.error(Printer.TreeStructure.show(annot) + " does not match")
|
||||
case _ =>
|
||||
|
|
@ -119,14 +119,14 @@ trait ContextUtil[C <: Quotes & scala.Singleton](val valStart: Int):
|
|||
case Apply(TypeApply(_, _), List(t @ Ident(_))) =>
|
||||
t.symbol.getAnnotation(cacheLevelSym) match
|
||||
case Some(_) => cacheLevelsForSym(t.symbol)
|
||||
case None =>
|
||||
case None =>
|
||||
t.symbol.getAnnotation(transientSym) match
|
||||
case Some(_) => Nil
|
||||
case _ => CacheLevelTag.all.toList
|
||||
case u =>
|
||||
u.symbol.getAnnotation(cacheLevelSym) match
|
||||
case Some(_) => cacheLevelsForSym(u.symbol)
|
||||
case None =>
|
||||
case None =>
|
||||
u.symbol.getAnnotation(transientSym) match
|
||||
case Some(_) => Nil
|
||||
case _ => CacheLevelTag.all.toList
|
||||
|
|
@ -136,7 +136,7 @@ trait ContextUtil[C <: Quotes & scala.Singleton](val valStart: Int):
|
|||
case Some(annot) if annot.symbol.owner.name == "cacheLevel" =>
|
||||
annot.asExprOf[cacheLevel] match
|
||||
case '{ cacheLevel(include = Array.empty[CacheLevelTag](using $_)) } => Nil
|
||||
case '{ cacheLevel(include = Array[CacheLevelTag]($include*)) } =>
|
||||
case '{ cacheLevel(include = Array[CacheLevelTag]($include*)) } =>
|
||||
include.value.get
|
||||
case _ => report.errorAndAbort(Printer.TreeStructure.show(annot) + " does not match")
|
||||
case _ => CacheLevelTag.all.toList
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ object ConvertTestMacro:
|
|||
(name: String, tpe: Type[a], qual: Term, replace: Term) =>
|
||||
convert1.convert[Boolean](name, qual) transform { (tree: Term) =>
|
||||
addTypeCon(tpe, tree, replace)
|
||||
}
|
||||
}
|
||||
convert1.transformWrappers(expr.asTerm, substitute, Symbol.spliceOwner).asExprOf[Boolean]
|
||||
|
||||
class InputInitConvert[C <: Quotes & scala.Singleton](override val qctx: C)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
package sbt.internal.util
|
||||
|
||||
import java.io.*
|
||||
import java.util.{ List as JList }
|
||||
import java.util.List as JList
|
||||
|
||||
import jline.console.ConsoleReader
|
||||
import jline.console.history.{ FileHistory, MemoryHistory }
|
||||
|
|
@ -215,7 +215,7 @@ abstract class JLine extends LineReader {
|
|||
val lines0 = """\r?\n""".r.split(prompt)
|
||||
lines0.length match {
|
||||
case 0 | 1 => handleProgress(prompt)
|
||||
case _ =>
|
||||
case _ =>
|
||||
val lines = lines0.toList map handleProgress
|
||||
// Workaround for regression jline/jline2#205
|
||||
reader.getOutput.write(lines.init.mkString("\n") + "\n")
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
package sbt.internal.util
|
||||
package complete
|
||||
|
||||
import java.lang.Character.{ toLowerCase as lower }
|
||||
import java.lang.Character.toLowerCase as lower
|
||||
|
||||
/** @author Paul Phillips */
|
||||
object EditDistance {
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ object Parser extends ParserMain:
|
|||
a.ifValid {
|
||||
a.result match {
|
||||
case Some(av) => success(f(av))
|
||||
case None =>
|
||||
case None =>
|
||||
a match {
|
||||
case m: MapParser[?, ?] => m.map(f)
|
||||
case _ => new MapParser(a, f)
|
||||
|
|
@ -311,7 +311,7 @@ object Parser extends ParserMain:
|
|||
repeated match {
|
||||
case _: Invalid if min == 0 => invalidButOptional
|
||||
case i: Invalid => i
|
||||
case _ =>
|
||||
case _ =>
|
||||
repeated.result match {
|
||||
case Some(value) =>
|
||||
success(revAcc reverse_::: value :: Nil) // revAcc should be Nil here
|
||||
|
|
@ -517,7 +517,7 @@ trait ParserMain {
|
|||
def loop(i: Int, a: Parser[T]): Either[() => (Seq[String], Int), T] =
|
||||
a match {
|
||||
case Invalid(f) => Left(() => (f.errors, i))
|
||||
case _ =>
|
||||
case _ =>
|
||||
val ci = i + 1
|
||||
if (ci >= s.length)
|
||||
a.resultEmpty.toEither.left.map { msgs0 => () =>
|
||||
|
|
@ -578,7 +578,7 @@ trait ParserMain {
|
|||
if (a.valid) {
|
||||
a.result match {
|
||||
case Some(av) => success(av)
|
||||
case None =>
|
||||
case None =>
|
||||
new ParserWithExamples(a, completions, maxNumberOfExamples, removeInvalidExamples)
|
||||
}
|
||||
} else a
|
||||
|
|
@ -590,7 +590,7 @@ trait ParserMain {
|
|||
): Parser[String] =
|
||||
t match {
|
||||
case i: Invalid => if (partial && seen.nonEmpty) success(seen.mkString) else i
|
||||
case _ =>
|
||||
case _ =>
|
||||
if (t.result.isEmpty)
|
||||
new MatchedString(t, seen, partial)
|
||||
else
|
||||
|
|
@ -1029,7 +1029,7 @@ private final class Repeat[T](
|
|||
lazy val resultEmpty: Result[Seq[T]] = {
|
||||
val partialAccumulatedOption =
|
||||
partial match {
|
||||
case None => (Value(accumulatedReverse): Result[List[T]])
|
||||
case None => (Value(accumulatedReverse): Result[List[T]])
|
||||
case Some(partialPattern) =>
|
||||
partialPattern.resultEmpty.map(_ :: accumulatedReverse)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ trait Parsers {
|
|||
def impl(): Parser[String] = {
|
||||
(open ~ (notDelim ~ close).?).flatMap {
|
||||
case (l, Some((content, r))) => Parser.success(s"$l$content$r")
|
||||
case (l, None) =>
|
||||
case (l, None) =>
|
||||
((notDelim ~ impl()).map { (leftPrefix, nestedBraces) =>
|
||||
leftPrefix + nestedBraces
|
||||
}.+ ~ notDelim ~ close).map { case ((nested, suffix), r) =>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
package sbt.internal.util
|
||||
|
||||
import java.lang.{ Process as JProcess }
|
||||
import java.lang.Process as JProcess
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import scala.sys.process.Process
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
package sbt.internal.util.hashing
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.{ Path as NioPath }
|
||||
import java.nio.file.Path as NioPath
|
||||
|
||||
trait FileHash:
|
||||
def hash(file: File): Long
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ package sbt.internal.util.hashing
|
|||
|
||||
import java.io.{ File, RandomAccessFile }
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.file.{ Path as NioPath }
|
||||
import java.nio.file.Path as NioPath
|
||||
import scala.util.Using
|
||||
|
||||
object FileSampleHash:
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ object Util:
|
|||
lazy val javaHome: Path =
|
||||
sys.env.get("JAVA_HOME") match
|
||||
case Some(home) => Paths.get(home)
|
||||
case None =>
|
||||
case None =>
|
||||
if sys.props("java.home").endsWith("jre") then Paths.get(sys.props("java.home")).getParent()
|
||||
else Paths.get(sys.props("java.home"))
|
||||
|
||||
|
|
|
|||
|
|
@ -514,7 +514,7 @@ trait Appender extends AutoCloseable {
|
|||
contentType match {
|
||||
case "sbt.internal.util.TraceEvent" => appendTraceEvent(oe.message.asInstanceOf[TraceEvent])
|
||||
case "sbt.internal.util.ProgressEvent" =>
|
||||
case _ =>
|
||||
case _ =>
|
||||
LogExchange.stringCodec[AnyRef](contentType) match {
|
||||
case Some(codec) if contentType == "sbt.internal.util.SuccessEvent" =>
|
||||
codec.showLines(oe.message.asInstanceOf[AnyRef]).toVector foreach { success(_) }
|
||||
|
|
|
|||
|
|
@ -101,12 +101,12 @@ object EscHelpers {
|
|||
val digit = new ArrayBuffer[Byte]
|
||||
while (i < bytes.length) {
|
||||
bytes(i) match {
|
||||
case 27 => state = esc
|
||||
case 27 => state = esc
|
||||
case b if (state == esc || state == csi) && b >= 48 && b < 58 =>
|
||||
state = csi
|
||||
digit += b
|
||||
case '[' if state == esc => state = csi
|
||||
case 8 =>
|
||||
case 8 =>
|
||||
state = 0
|
||||
index = index - 1
|
||||
case b if state == csi =>
|
||||
|
|
@ -163,7 +163,7 @@ object EscHelpers {
|
|||
state = csi
|
||||
digit += b
|
||||
case '[' if state == esc => state = csi
|
||||
case 8 =>
|
||||
case 8 =>
|
||||
state = 0
|
||||
index = math.max(index - 1, 0)
|
||||
case b if state == csi =>
|
||||
|
|
@ -205,21 +205,21 @@ object EscHelpers {
|
|||
var limit = 0
|
||||
val digit = new ArrayBuffer[Byte]
|
||||
bytes.foreach {
|
||||
case 27 => state = esc
|
||||
case 27 => state = esc
|
||||
case b if (state == esc || state == csi) && b >= 48 && b < 58 =>
|
||||
state = csi
|
||||
digit += b
|
||||
case '[' if state == esc => state = csi
|
||||
case 8 =>
|
||||
case 8 =>
|
||||
state = 0
|
||||
index = math.max(index - 1, 0)
|
||||
case b if state == csi =>
|
||||
val leftDigit = Try(new String(digit.toArray).toInt).getOrElse(0)
|
||||
state = 0
|
||||
b.toChar match {
|
||||
case 'h' => index = math.max(index - 1, 0)
|
||||
case 'D' => index = math.max(index - leftDigit, 0)
|
||||
case 'C' => index = math.min(limit, math.min(index + leftDigit, res.length - 1))
|
||||
case 'h' => index = math.max(index - 1, 0)
|
||||
case 'D' => index = math.max(index - leftDigit, 0)
|
||||
case 'C' => index = math.min(limit, math.min(index + leftDigit, res.length - 1))
|
||||
case 'K' | 'J' =>
|
||||
if (leftDigit > 0) (0 until index).foreach(res(_) = 32)
|
||||
else res(index) = 32
|
||||
|
|
@ -229,7 +229,7 @@ object EscHelpers {
|
|||
}
|
||||
digit.clear()
|
||||
case b if state == esc => state = 0
|
||||
case b =>
|
||||
case b =>
|
||||
res(index) = b
|
||||
index += 1
|
||||
limit = math.max(limit, index)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ private[sbt] object JLine3 {
|
|||
var res = -2
|
||||
while (i < 4 && res == -2) {
|
||||
inputStream.read() match {
|
||||
case -1 => res = -1
|
||||
case -1 => res = -1
|
||||
case byte =>
|
||||
bytes(i) = byte.toByte
|
||||
i += 1
|
||||
|
|
@ -154,7 +154,7 @@ private[sbt] object JLine3 {
|
|||
if (buffer.isEmpty) fillBuffer()
|
||||
buffer.take match {
|
||||
case i if i == -1 => -1
|
||||
case i =>
|
||||
case i =>
|
||||
buf(0) = i.toChar
|
||||
1
|
||||
}
|
||||
|
|
|
|||
|
|
@ -716,7 +716,7 @@ object Terminal {
|
|||
override def read(b: Array[Byte]): Int = read(b, 0, b.length)
|
||||
override def read(b: Array[Byte], off: Int, len: Int): Int = {
|
||||
read() match {
|
||||
case -1 => -1
|
||||
case -1 => -1
|
||||
case byte =>
|
||||
b(off) = byte.toByte
|
||||
1
|
||||
|
|
@ -743,12 +743,12 @@ object Terminal {
|
|||
override def run(): Unit = while (running.get) {
|
||||
bootInputStreamHolder.get match {
|
||||
case null =>
|
||||
case is =>
|
||||
case is =>
|
||||
def readFrom(inputStream: InputStream) =
|
||||
try {
|
||||
if (running.get) {
|
||||
inputStream.read match {
|
||||
case -1 =>
|
||||
case -1 =>
|
||||
case `NO_BOOT_CLIENTS_CONNECTED` =>
|
||||
if (!Terminal.hasConsole) {
|
||||
result.put(-1)
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ private[util] class WindowsInputStream(term: org.jline.terminal.Terminal, in: In
|
|||
*/
|
||||
private def readConsoleInput(): Array[Byte] = {
|
||||
WindowsSupport.readConsoleInput(1) match {
|
||||
case null => Array.empty
|
||||
case null => Array.empty
|
||||
case events =>
|
||||
val sb = new StringBuilder();
|
||||
events.foreach { event =>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ package sbt.util
|
|||
import java.io.File
|
||||
import java.util.Optional
|
||||
import java.util.function.Supplier
|
||||
import java.{ util as ju }
|
||||
import java.util as ju
|
||||
|
||||
import xsbti.{
|
||||
Action,
|
||||
|
|
@ -32,7 +32,7 @@ object InterfaceUtil {
|
|||
override def get: A = a
|
||||
}
|
||||
|
||||
import java.util.function.{ Function as JavaFunction }
|
||||
import java.util.function.Function as JavaFunction
|
||||
def toJavaFunction[A1, R](f: A1 => R): JavaFunction[A1, R] =
|
||||
(t: A1) => f(t)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
package sbt.util
|
||||
|
||||
import xsbti.{ Logger as xLogger }
|
||||
import xsbti.Logger as xLogger
|
||||
|
||||
import sys.process.ProcessLogger
|
||||
import sbt.internal.util.{ BufferedLogger, FullLogger }
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ object Logic {
|
|||
state: Matched
|
||||
): Matched =
|
||||
applyAll(clauses, factsToProcess) match {
|
||||
case None => state // all of the remaining clauses failed on the new facts
|
||||
case None => state // all of the remaining clauses failed on the new facts
|
||||
case Some(applied) =>
|
||||
val (proven, unprovenClauses) = findProven(applied)
|
||||
val processedFacts = state.add(keepPositive(factsToProcess))
|
||||
|
|
@ -397,7 +397,7 @@ object Logic {
|
|||
else (And(newLits): Formula)
|
||||
Some(newF) // 1.
|
||||
}
|
||||
case True => Some(True)
|
||||
case True => Some(True)
|
||||
case lit: Literal => // define in terms of And
|
||||
substitute(And(Set(lit)), facts)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ object LogicTest extends Properties("Logic") {
|
|||
*/
|
||||
|
||||
def expect(result: Either[LogicException, Matched], expected: Set[Atom]) = result match {
|
||||
case Left(_) => false
|
||||
case Left(_) => false
|
||||
case Right(res) =>
|
||||
val actual = res.provenSet
|
||||
if (actual != expected)
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class FileCommands(baseDirectory: File) extends BasicStatementHandler {
|
|||
val combined = globs(exprs1) match
|
||||
case Nil => sys.error("unexpected Nil")
|
||||
case g :: Nil => g
|
||||
case g :: gs =>
|
||||
case g :: gs =>
|
||||
gs.foldLeft(g) { (acc, g) =>
|
||||
acc || g
|
||||
}
|
||||
|
|
@ -164,7 +164,7 @@ class FileCommands(baseDirectory: File) extends BasicStatementHandler {
|
|||
commandName -> {
|
||||
case Nil => scriptError("No paths specified for " + commandName + " command.")
|
||||
case path :: Nil => scriptError("No destination specified for " + commandName + " command.")
|
||||
case paths =>
|
||||
case paths =>
|
||||
val mapped = fromStrings(paths)
|
||||
val map = mapper(mapped.last)
|
||||
IO.copy(mapped.init.pair(map))
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ package sbt
|
|||
package internal
|
||||
package scripted
|
||||
|
||||
import java.{ util as ju }
|
||||
import java.util as ju
|
||||
import java.net.URL
|
||||
|
||||
final class FilteredLoader(parent: ClassLoader) extends ClassLoader(parent) {
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class TestScriptParser(handlers: Map[Char, StatementHandler]) extends RegexParse
|
|||
): List[(StatementHandler, Statement)] = {
|
||||
parseAll(statements(stripQuotes), script) match {
|
||||
case Success(result, next) => result
|
||||
case err: NoSuccess => {
|
||||
case err: NoSuccess => {
|
||||
val labelString = label.map("'" + _ + "' ").getOrElse("")
|
||||
sys.error("Could not parse test script, " + labelString + err.toString)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ private[librarymanagement] abstract class InlineConfigurationFunctions {
|
|||
) =
|
||||
if (explicitConfigurations.isEmpty) {
|
||||
defaultConfiguration match {
|
||||
case Some(Configurations.DefaultIvyConfiguration) => Configurations.Default :: Nil
|
||||
case Some(Configurations.DefaultIvyConfiguration) => Configurations.Default :: Nil
|
||||
case Some(Configurations.DefaultMavenConfiguration) =>
|
||||
Configurations.defaultMavenConfigurations
|
||||
case _ => Nil
|
||||
|
|
|
|||
|
|
@ -125,9 +125,9 @@ private[librarymanagement] abstract class SemComparatorExtra {
|
|||
// Identifiers consisting of only digits are compared numerically.
|
||||
// Numeric identifiers always have lower precedence than non-numeric identifiers.
|
||||
// Identifiers with letters are compared case-insensitive lexical order.
|
||||
case (true, true) => implicitly[Ordering[Long]].compare(ts1head.toLong, ts2head.toLong)
|
||||
case (false, true) => 1
|
||||
case (true, false) => -1
|
||||
case (true, true) => implicitly[Ordering[Long]].compare(ts1head.toLong, ts2head.toLong)
|
||||
case (false, true) => 1
|
||||
case (true, false) => -1
|
||||
case (false, false) =>
|
||||
ts1head.toLowerCase(Locale.ENGLISH).compareTo(ts2head.toLowerCase(Locale.ENGLISH))
|
||||
}
|
||||
|
|
@ -195,7 +195,7 @@ private[librarymanagement] abstract class SemComparatorFunctions {
|
|||
case Some(">=") => Gte
|
||||
case Some("=") => Eq
|
||||
case None => Eq
|
||||
case Some(_) =>
|
||||
case Some(_) =>
|
||||
throw new IllegalArgumentException(s"Invalid operator: $opStr")
|
||||
}
|
||||
SemComparator(
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ private[sbt] object VersionSchemes {
|
|||
def validateScheme(value: String): Unit =
|
||||
value match {
|
||||
case EarlySemVer | SemVerSpec | PackVer | Strict | Always => ()
|
||||
case "semver" =>
|
||||
case "semver" =>
|
||||
sys.error(
|
||||
s"""'semver' is ambiguous.
|
||||
|Based on the Semantic Versioning 2.0.0, 0.y.z updates are all initial development and thus
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ object CrossVersionUtil {
|
|||
private[sbt] def binaryScala3Version(full: String): String = full match {
|
||||
case ReleaseV(maj, _, _, _) => maj
|
||||
case NonReleaseV_n(maj, min, patch, _) if min.toLong > 0 || patch.toLong > 0 => maj
|
||||
case BinCompatV(maj, min, patch, stageOrNull, _) =>
|
||||
case BinCompatV(maj, min, patch, stageOrNull, _) =>
|
||||
val stage = if (stageOrNull != null) stageOrNull else ""
|
||||
binaryScala3Version(s"$maj.$min.$patch$stage")
|
||||
case _ => full
|
||||
|
|
@ -118,7 +118,7 @@ object CrossVersionUtil {
|
|||
def binaryScalaVersion(full: String): String =
|
||||
full match {
|
||||
// Handle dynamic Scala 3 version patterns like "3-latest.candidate"
|
||||
case DynamicScala3V(maj) => maj
|
||||
case DynamicScala3V(maj) => maj
|
||||
case _ if full.startsWith("2.") =>
|
||||
binaryVersionWithApi(full, TransitionScalaVersion)(
|
||||
scalaApiVersion
|
||||
|
|
@ -135,7 +135,7 @@ object CrossVersionUtil {
|
|||
def earlyScalaVersion(full: String): String =
|
||||
full match {
|
||||
// Handle dynamic Scala 3 version patterns like "3-latest.candidate"
|
||||
case DynamicScala3V(maj) => maj
|
||||
case DynamicScala3V(maj) => maj
|
||||
case _ if full.startsWith("2.") =>
|
||||
partialVersion(full) match
|
||||
case Some((major, minor)) => s"$major.$minor"
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ private[librarymanagement] abstract class ArtifactFunctions {
|
|||
val cross = CrossVersion(module.crossVersion, scalaVersion.full, scalaVersion.binary)
|
||||
val withPlatform = module.crossVersion match {
|
||||
case _: Disabled => artifact.name
|
||||
case _ =>
|
||||
case _ =>
|
||||
module.platformOpt match {
|
||||
case Some(p) if p.nonEmpty && p != Platform.jvm => s"${artifact.name}_$p"
|
||||
case _ => artifact.name
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ object CredentialUtils:
|
|||
|
||||
def toDirect(c: Credentials): Credentials.DirectCredentials = c match
|
||||
case dc: Credentials.DirectCredentials => dc
|
||||
case fc: Credentials.FileCredentials =>
|
||||
case fc: Credentials.FileCredentials =>
|
||||
loadCredentials(fc.path) match
|
||||
case Left(err) => sys.error(err)
|
||||
case Right(dc) => dc
|
||||
|
|
|
|||
|
|
@ -122,11 +122,11 @@ private[librarymanagement] abstract class CrossVersionFunctions {
|
|||
binaryVersion: String
|
||||
): Option[String => String] =
|
||||
cross match {
|
||||
case _: Disabled => None
|
||||
case b: Binary => append(b.prefix + binaryVersion + b.suffix)
|
||||
case c: Constant => append(c.value)
|
||||
case _: Patch => append(patchFun(fullVersion))
|
||||
case f: Full => append(f.prefix + fullVersion + f.suffix)
|
||||
case _: Disabled => None
|
||||
case b: Binary => append(b.prefix + binaryVersion + b.suffix)
|
||||
case c: Constant => append(c.value)
|
||||
case _: Patch => append(patchFun(fullVersion))
|
||||
case f: Full => append(f.prefix + fullVersion + f.suffix)
|
||||
case c: For3Use2_13 =>
|
||||
val compat =
|
||||
if (binaryVersion == "3" || binaryVersion.startsWith("3.0.0")) "2.13"
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class DependencyResolution private[sbt] (lmEngine: DependencyResolutionInterface
|
|||
log
|
||||
) match {
|
||||
case Left(unresolvedWarning) => Left(unresolvedWarning)
|
||||
case Right(updateReport) =>
|
||||
case Right(updateReport) =>
|
||||
val allFiles =
|
||||
for {
|
||||
conf <- updateReport.configurations
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ trait LibraryManagementSyntax
|
|||
type InclusionRule = InclExclRule
|
||||
final val InclusionRule = InclExclRule
|
||||
|
||||
import sbt.librarymanagement.{ Configurations as C }
|
||||
import sbt.librarymanagement.Configurations as C
|
||||
final val Compile = C.Compile
|
||||
final val Test = C.Test
|
||||
final val Runtime = C.Runtime
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ private[librarymanagement] abstract class ModuleIDExtra {
|
|||
*/
|
||||
def cross(v: CrossVersion): ModuleID =
|
||||
withCrossVersion(CrossVersion.getPrefixSuffix(this.crossVersion) match {
|
||||
case ("", "") => v
|
||||
case ("", "") => v
|
||||
case (prefix, suffix) =>
|
||||
CrossVersion.getPrefixSuffix(v) match {
|
||||
case ("", "") => CrossVersion.setPrefixSuffix(v, prefix, suffix)
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ private[librarymanagement] abstract class ResolverFunctions {
|
|||
// Occurs inside File constructor when property or environment variable does not exist
|
||||
case _: NullPointerException => None
|
||||
// Occurs when File does not exist
|
||||
case _: IOException => None
|
||||
case _: IOException => None
|
||||
case e: SAXParseException =>
|
||||
System.err.println(s"WARNING: Problem parsing ${f().getAbsolutePath}, ${e.getMessage}");
|
||||
None
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
package sbt.librarymanagement
|
||||
|
||||
import java.io.File
|
||||
import java.{ util as ju }
|
||||
import java.util as ju
|
||||
|
||||
private[librarymanagement] abstract class ConfigurationReportExtra {
|
||||
def configuration: ConfigRef
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ object UpdateReportPersistenceBenchmark:
|
|||
val iterations = args.headOption.flatMap(s => Try(s.toInt).toOption).getOrElse(500)
|
||||
run(iterations = iterations) match
|
||||
case Right(result) => println(formatResult(result))
|
||||
case Left(error) =>
|
||||
case Left(error) =>
|
||||
System.err.println(error)
|
||||
sys.exit(1)
|
||||
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ class CoursierDependencyResolution(
|
|||
case Some(lockData) =>
|
||||
LockedArtifactsRun.fetchFromLockFile(lockData, cache0, verbosityLevel, log) match {
|
||||
case Right(arts) => Right(arts)
|
||||
case Left(err) =>
|
||||
case Left(err) =>
|
||||
if (verbosityLevel >= 1) {
|
||||
log.warn(s"Failed to fetch from lock file: $err, falling back to normal fetch")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package lmcoursier
|
||||
|
||||
import coursier.ivy.IvyXml.{ mappings as ivyXmlMappings }
|
||||
import coursier.ivy.IvyXml.mappings as ivyXmlMappings
|
||||
import lmcoursier.definitions.{
|
||||
Classifier,
|
||||
Configuration,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package lmcoursier
|
||||
|
||||
import coursier.ivy.IvyXml.{ mappings as initialIvyXmlMappings }
|
||||
import coursier.ivy.IvyXml.mappings as initialIvyXmlMappings
|
||||
import lmcoursier.definitions.{ Configuration, Module, ModuleName, Organization }
|
||||
import sbt.librarymanagement.{ CrossVersion, InclExclRule, ModuleID }
|
||||
import sbt.util.Logger
|
||||
|
|
@ -62,7 +62,7 @@ object Inputs {
|
|||
toAdd: List[Configuration]
|
||||
): LazyList[(Configuration, Seq[Configuration])] =
|
||||
toAdd match {
|
||||
case Nil => LazyList.empty
|
||||
case Nil => LazyList.empty
|
||||
case config :: rest =>
|
||||
val extends0 = map.getOrElse(config, Nil)
|
||||
val missingExtends = extends0.filterNot(done)
|
||||
|
|
|
|||
|
|
@ -117,8 +117,7 @@ object Resolvers {
|
|||
case r: URLRepository if patternMatchGuard(r.patterns) =>
|
||||
parseMavenCompatResolver(log, ivyProperties, authentication, r.patterns, classLoaders)
|
||||
|
||||
case raw: RawRepository
|
||||
if raw.name == "inter-project" => // sbt.RawRepository.equals just compares names anyway
|
||||
case raw: RawRepository if raw.name == "inter-project" => // sbt.RawRepository.equals just compares names anyway
|
||||
None
|
||||
|
||||
// Pattern Match resolver-type-specific RawRepositories
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ private[internal] object SbtUpdateReport {
|
|||
def lookupProject(mv: coursier.core.Resolution.ModuleVersion): Option[Project] =
|
||||
res.projectCache.get(mv) match {
|
||||
case Some((_, p)) => Some(p)
|
||||
case _ =>
|
||||
case _ =>
|
||||
interProjectDependencies.find(p => mv == (p.module, p.version))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class CoursierDependencyResolutionTests extends AnyPropSpec with Matchers {
|
|||
val module = depRes.moduleDescriptor(desc)
|
||||
|
||||
depRes.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), logger) match {
|
||||
case Left(x) => throw x.resolveException
|
||||
case Left(x) => throw x.resolveException
|
||||
case Right(x) =>
|
||||
x.allModules.collect {
|
||||
case m: ModuleID if m.organization == scalaModule212.organization && m.name == m.name =>
|
||||
|
|
@ -87,7 +87,7 @@ class CoursierDependencyResolutionTests extends AnyPropSpec with Matchers {
|
|||
val module = depRes.moduleDescriptor(desc)
|
||||
|
||||
depRes.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), logger) match {
|
||||
case Left(x) => throw x.resolveException
|
||||
case Left(x) => throw x.resolveException
|
||||
case Right(x) =>
|
||||
x.allModules.collect {
|
||||
case m: ModuleID if m.organization == scalaModule212.organization && m.name == m.name =>
|
||||
|
|
@ -108,7 +108,7 @@ class CoursierDependencyResolutionTests extends AnyPropSpec with Matchers {
|
|||
val module = depRes.moduleDescriptor(desc)
|
||||
|
||||
depRes.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), logger) match {
|
||||
case Left(x) => throw x.resolveException
|
||||
case Left(x) => throw x.resolveException
|
||||
case Right(x) =>
|
||||
x.allModules.collect {
|
||||
case m: ModuleID if m.organization == scalaModule212.organization && m.name == m.name =>
|
||||
|
|
@ -130,7 +130,7 @@ class CoursierDependencyResolutionTests extends AnyPropSpec with Matchers {
|
|||
val module = depRes.moduleDescriptor(desc)
|
||||
|
||||
depRes.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), logger) match {
|
||||
case Left(x) => throw x.resolveException
|
||||
case Left(x) => throw x.resolveException
|
||||
case Right(x) =>
|
||||
x.allModules.collect {
|
||||
case m: ModuleID if m.organization == scalaModule212.organization && m.name == m.name =>
|
||||
|
|
@ -154,7 +154,7 @@ class CoursierDependencyResolutionTests extends AnyPropSpec with Matchers {
|
|||
val module = depRes.moduleDescriptor(desc)
|
||||
|
||||
depRes.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), logger) match {
|
||||
case Left(x) => throw x.resolveException
|
||||
case Left(x) => throw x.resolveException
|
||||
case Right(x) =>
|
||||
x.allModules.collect {
|
||||
case m: ModuleID if m.organization == scalaModule212.organization && m.name == m.name =>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ final class ResolutionSpec extends AnyPropSpec with Matchers {
|
|||
|
||||
private def unresolvedWarningLines(module: ModuleDescriptor): Seq[String] =
|
||||
lmEngine.update(module, UpdateConfiguration(), UnresolvedWarningConfiguration(), log) match {
|
||||
case Left(uw) => uw.lines
|
||||
case Left(uw) => uw.lines
|
||||
case Right(report) =>
|
||||
fail(s"Expected resolution to fail, but it succeeded with report: $report")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class ComponentManager(
|
|||
def notFound = invalid("Could not find required component '" + id + "'")
|
||||
def createAndCache =
|
||||
ifMissing match {
|
||||
case IfMissing.Fail => notFound
|
||||
case IfMissing.Fail => notFound
|
||||
case d: IfMissing.Define =>
|
||||
d()
|
||||
if (d.cache) cache(id)
|
||||
|
|
@ -66,7 +66,7 @@ class ComponentManager(
|
|||
def file(id: String)(ifMissing: IfMissing): File =
|
||||
files(id)(ifMissing).toList match {
|
||||
case x :: Nil => x
|
||||
case xs =>
|
||||
case xs =>
|
||||
invalid("Expected single file for component '" + id + "', found: " + xs.mkString(", "))
|
||||
}
|
||||
private def invalid(msg: String) = throw new InvalidComponent(msg)
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ import org.apache.ivy.plugins.resolver.{
|
|||
SshResolver,
|
||||
URLResolver
|
||||
}
|
||||
import org.apache.ivy.plugins.repository.url.{ URLRepository as URLRepo }
|
||||
import org.apache.ivy.plugins.repository.url.URLRepository as URLRepo
|
||||
import org.apache.ivy.plugins.repository.file.{ FileResource, FileRepository as FileRepo }
|
||||
import java.io.{ File, IOException }
|
||||
import java.util.Date
|
||||
|
||||
import org.apache.ivy.core.module.descriptor.{ Artifact as IArtifact }
|
||||
import org.apache.ivy.core.module.descriptor.Artifact as IArtifact
|
||||
import org.apache.ivy.core.module.id.ModuleRevisionId
|
||||
import org.apache.ivy.core.module.descriptor.DefaultArtifact
|
||||
import org.apache.ivy.core.report.DownloadReport
|
||||
|
|
|
|||
|
|
@ -139,8 +139,7 @@ object CustomPomParser {
|
|||
(Option(extraInfo.get(TransformedHashKey))
|
||||
.orElse(Option(extraInfo.get(oldTransformedHashKey))) match
|
||||
case Some(MyHash) => true
|
||||
case _ => false
|
||||
)
|
||||
case _ => false)
|
||||
}
|
||||
|
||||
private def defaultTransformImpl(
|
||||
|
|
@ -315,8 +314,7 @@ object CustomPomParser {
|
|||
addExtra(dd, dependencyExtra)
|
||||
}
|
||||
val withVersionRangeMod: Seq[DependencyDescriptor] =
|
||||
if (LMSysProp.modifyVersionRange) withExtra map { stripVersionRange }
|
||||
else withExtra
|
||||
if (LMSysProp.modifyVersionRange) withExtra map { stripVersionRange } else withExtra
|
||||
val unique = IvySbt.mergeDuplicateDefinitions(withVersionRangeMod)
|
||||
unique foreach dmd.addDependency
|
||||
|
||||
|
|
|
|||
|
|
@ -674,7 +674,7 @@ private[sbt] object IvySbt {
|
|||
settings.setDefaultRepositoryCacheManager(manager)
|
||||
}
|
||||
def toIvyConfiguration(configuration: Configuration) = {
|
||||
import org.apache.ivy.core.module.descriptor.{ Configuration as IvyConfig }
|
||||
import org.apache.ivy.core.module.descriptor.Configuration as IvyConfig
|
||||
import IvyConfig.Visibility.*
|
||||
import configuration.*
|
||||
new IvyConfig(
|
||||
|
|
@ -758,7 +758,7 @@ private[sbt] object IvySbt {
|
|||
(m: ModuleID) =>
|
||||
m.crossVersion match
|
||||
case _: Disabled => m
|
||||
case _ =>
|
||||
case _ =>
|
||||
(platform, m.platformOpt) match
|
||||
case (Some(p), None) => addSuffix(m, p)
|
||||
case (_, Some(p)) => addSuffix(m, p)
|
||||
|
|
@ -812,8 +812,7 @@ private[sbt] object IvySbt {
|
|||
}
|
||||
private[sbt] def javaMap(m: Map[String, String], unqualify: Boolean = false) = {
|
||||
import scala.jdk.CollectionConverters.*
|
||||
val map = if (unqualify) m map { (k, v) => (k.stripPrefix("e:"), v) }
|
||||
else m
|
||||
val map = if (unqualify) m map { (k, v) => (k.stripPrefix("e:"), v) } else m
|
||||
if (map.isEmpty) null else map.asJava
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import org.apache.ivy.core.module.descriptor.{
|
|||
}
|
||||
import org.apache.ivy.core.resolve.ResolveOptions
|
||||
import org.apache.ivy.plugins.resolver.{ BasicResolver, DependencyResolver }
|
||||
import org.apache.ivy.util.filter.{ Filter as IvyFilter }
|
||||
import org.apache.ivy.util.filter.Filter as IvyFilter
|
||||
import sbt.io.{ IO, PathFinder }
|
||||
import sbt.util.Logger
|
||||
import sbt.librarymanagement.{ ModuleDescriptorConfiguration as InlineConfiguration, * }
|
||||
|
|
@ -149,7 +149,7 @@ object IvyActions {
|
|||
case Some(overrideRev) =>
|
||||
def updateAttrs(metadata: scala.xml.MetaData): scala.xml.MetaData = {
|
||||
metadata match {
|
||||
case scala.xml.Null => scala.xml.Null
|
||||
case scala.xml.Null => scala.xml.Null
|
||||
case attr if attr.key == "rev" =>
|
||||
new scala.xml.UnprefixedAttribute(
|
||||
"rev",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ package internal.librarymanagement
|
|||
import java.io.File
|
||||
import sbt.librarymanagement.IvyPaths
|
||||
import sbt.io.syntax.*
|
||||
import xsbti.{ Logger as XLogger }
|
||||
import xsbti.Logger as XLogger
|
||||
import sbt.util.Logger
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
package sbt.internal.librarymanagement
|
||||
|
||||
import java.io.File
|
||||
import java.{ util as ju }
|
||||
import java.util as ju
|
||||
import collection.mutable
|
||||
import collection.immutable.ArraySeq
|
||||
import org.apache.ivy.core.{ module, report, resolve }
|
||||
|
|
@ -12,7 +12,7 @@ import module.descriptor.{ Artifact as IvyArtifact, License as IvyLicense }
|
|||
import module.id.{ ModuleRevisionId, ModuleId as IvyModuleId }
|
||||
import report.{ ArtifactDownloadReport, ConfigurationResolveReport, ResolveReport }
|
||||
import resolve.{ IvyNode, IvyNodeCallers }
|
||||
import IvyNodeCallers.{ Caller as IvyCaller }
|
||||
import IvyNodeCallers.Caller as IvyCaller
|
||||
import ivyint.SbtDefaultDependencyDescriptor
|
||||
import sbt.librarymanagement.*, syntax.*
|
||||
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ class MakePom(val log: Logger) {
|
|||
module.getAllArtifacts match {
|
||||
case Array() => "pom"
|
||||
case Array(x) => x.getType
|
||||
case xs =>
|
||||
case xs =>
|
||||
val types = xs.map(_.getType).toList.filterNot(IgnoreTypes)
|
||||
types match {
|
||||
case Nil => Artifact.PomType
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ object IvyCredentials {
|
|||
def allDirect(sc: Seq[Credentials]): Seq[Credentials.DirectCredentials] = sc map toDirect
|
||||
def toDirect(c: Credentials): Credentials.DirectCredentials = c match {
|
||||
case dc: Credentials.DirectCredentials => dc
|
||||
case fc: Credentials.FileCredentials =>
|
||||
case fc: Credentials.FileCredentials =>
|
||||
loadCredentials(fc.path) match {
|
||||
case Left(err) => sys.error(err)
|
||||
case Right(dc) => dc
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import core.module.descriptor.{
|
|||
import core.module.descriptor.{ OverrideDependencyDescriptorMediator, DependencyArtifactDescriptor }
|
||||
import core.IvyPatternHelper
|
||||
import org.apache.ivy.util.{ Message, MessageLogger }
|
||||
import org.apache.ivy.plugins.latest.{ ArtifactInfo as IvyArtifactInfo }
|
||||
import org.apache.ivy.plugins.latest.ArtifactInfo as IvyArtifactInfo
|
||||
import org.apache.ivy.plugins.matcher.{ MapMatcher, PatternMatcher }
|
||||
import annotation.tailrec
|
||||
import scala.concurrent.duration.*
|
||||
|
|
@ -295,10 +295,10 @@ private[sbt] class CachedResolutionResolveCache {
|
|||
}
|
||||
(conflictCache get ((cf0, cf1))) match {
|
||||
case Some((surviving, evicted, mgr)) => reconstructReports(surviving, evicted, mgr)
|
||||
case _ =>
|
||||
case _ =>
|
||||
(conflictCache get ((cf1, cf0))) match {
|
||||
case Some((surviving, evicted, mgr)) => reconstructReports(surviving, evicted, mgr)
|
||||
case _ =>
|
||||
case _ =>
|
||||
val (surviving, evicted, mgr) = f
|
||||
if (conflictCache.size > maxConflictCacheSize) {
|
||||
conflictCache.remove(conflictCache.head._1)
|
||||
|
|
@ -629,7 +629,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
|
|||
allModules0.to(mutable.Map)
|
||||
@tailrec def breakLoops(loops: List[List[(String, String)]]): Unit =
|
||||
loops match {
|
||||
case Nil => ()
|
||||
case Nil => ()
|
||||
case loop :: rest =>
|
||||
loop match {
|
||||
case Nil =>
|
||||
|
|
@ -717,7 +717,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
|
|||
allModules: Map[(String, String), Vector[OrganizationArtifactReport]]
|
||||
): List[OrganizationArtifactReport] =
|
||||
cs match {
|
||||
case Nil => Nil
|
||||
case Nil => Nil
|
||||
case (organization, name) :: rest =>
|
||||
val reports = allModules((organization, name))
|
||||
reports match {
|
||||
|
|
@ -820,7 +820,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
|
|||
val reports: Seq[((String, String), Vector[OrganizationArtifactReport])] =
|
||||
reports0.toSeq flatMap {
|
||||
case (k, _) if !(pairs.contains[(String, String)](k)) => Seq()
|
||||
case ((organization, name), oars0) =>
|
||||
case ((organization, name), oars0) =>
|
||||
val oars = oars0 map { oar =>
|
||||
val (affected, unaffected) = oar.modules partition { mr =>
|
||||
val x = !mr.evicted && mr.problem.isEmpty && isTransitivelyEvicted(mr)
|
||||
|
|
@ -940,7 +940,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
|
|||
}
|
||||
case _ =>
|
||||
getSettings.getConflictManager(IvyModuleId.newInstance(organization, name)) match {
|
||||
case ncm: NoConflictManager => (conflicts, Vector(), ncm.toString)
|
||||
case ncm: NoConflictManager => (conflicts, Vector(), ncm.toString)
|
||||
case _: StrictConflictManager =>
|
||||
sys.error(
|
||||
(s"conflict was found in $rootModuleConf:$organization:$name " + (conflicts map {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ object ErrorMessageAuthenticator {
|
|||
def doInstallIfIvy(original: Option[Authenticator]): Unit =
|
||||
original match {
|
||||
case Some(_: ErrorMessageAuthenticator) => // Ignore, we're already installed
|
||||
case Some(ivy: IvyAuthenticator) =>
|
||||
case Some(ivy: IvyAuthenticator) =>
|
||||
installIntoIvy(ivy); ()
|
||||
case original => doInstall(original)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import org.apache.ivy.core.{ IvyContext, LogOptions }
|
|||
import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor
|
||||
import org.apache.ivy.core.module.descriptor.DependencyDescriptor
|
||||
import org.apache.ivy.core.module.descriptor.ModuleDescriptor
|
||||
import org.apache.ivy.core.module.descriptor.{ Artifact as IArtifact }
|
||||
import org.apache.ivy.core.module.descriptor.Artifact as IArtifact
|
||||
import org.apache.ivy.core.resolve.{ ResolveData, ResolvedModuleRevision }
|
||||
import org.apache.ivy.plugins.latest.LatestStrategy
|
||||
import org.apache.ivy.plugins.repository.file.{ FileResource, FileRepository as IFileRepository }
|
||||
|
|
@ -202,7 +202,7 @@ private[sbt] case class SbtChainResolver(
|
|||
val chosenPublicationDate = Option(publicationDate).orElse(Option(descriptorDate))
|
||||
chosenPublicationDate match {
|
||||
case Some(date) => date.getTime
|
||||
case None =>
|
||||
case None =>
|
||||
val id = rmr.getId
|
||||
val resolvedResource = (resolver.findIvyFileRef(descriptor, data), rmr.getDescriptor)
|
||||
resolvedResource match {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ object PomExtraDependencyAttributes {
|
|||
): Map[ModuleRevisionId, Map[String, String]] = {
|
||||
import scala.jdk.CollectionConverters.*
|
||||
(props.asScala get ExtraAttributesKey) match {
|
||||
case None => Map.empty
|
||||
case None => Map.empty
|
||||
case Some(str) =>
|
||||
def processDep(m: ModuleRevisionId) = (simplify(m), filterCustomExtra(m, include = true))
|
||||
(for {
|
||||
|
|
@ -68,7 +68,7 @@ object PomExtraDependencyAttributes {
|
|||
*/
|
||||
def getDependencyExtra(m: Map[String, String]): Map[ModuleRevisionId, Map[String, String]] =
|
||||
(m get ExtraAttributesKey) match {
|
||||
case None => Map.empty
|
||||
case None => Map.empty
|
||||
case Some(str) =>
|
||||
def processDep(m: ModuleRevisionId) = (simplify(m), filterCustomExtra(m, include = true))
|
||||
readDependencyExtra(str).map(processDep).toMap
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package sbt.internal.librarymanagement
|
||||
|
||||
import java.io.File
|
||||
import org.apache.ivy.core.module.descriptor.{ Artifact as IvyArtifact }
|
||||
import org.apache.ivy.core.module.descriptor.Artifact as IvyArtifact
|
||||
import org.apache.ivy.core.module.id.ModuleRevisionId
|
||||
import org.apache.ivy.core.resolve.ResolveOptions
|
||||
import sbt.internal.librarymanagement.ivy.InlineIvyConfiguration
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ object SftpRepoSpec extends BaseIvySpecification {
|
|||
// log.setLevel(Level.Debug)
|
||||
lmEngine().retrieve(module(org(repo)), scalaModuleInfo = None, currentTarget, log) match {
|
||||
case Right(v) => log.debug(v.toString())
|
||||
case Left(e) =>
|
||||
case Left(e) =>
|
||||
log.log(Level.Error, e.failedPaths.toString())
|
||||
throw e.resolveException
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ object Pkg:
|
|||
for option <- conf.options do
|
||||
option match
|
||||
case PackageOption.JarManifest(mergeManifest) => mergeManifests(manifest, mergeManifest)
|
||||
case PackageOption.MainClass(mainClassName) =>
|
||||
case PackageOption.MainClass(mainClassName) =>
|
||||
main.put(Attributes.Name.MAIN_CLASS, mainClassName)
|
||||
case PackageOption.ManifestAttributes(attributes*) => main.asScala ++= attributes
|
||||
case PackageOption.FixedTimestamp(value) => ()
|
||||
|
|
|
|||
|
|
@ -200,8 +200,8 @@ object Sync {
|
|||
try {
|
||||
readUncaught[F](store)(using infoFormat)
|
||||
} catch {
|
||||
case _: IOException => (Relation.empty[File, File], Map.empty[File, F])
|
||||
case _: ZipException => (Relation.empty[File, File], Map.empty[File, F])
|
||||
case _: IOException => (Relation.empty[File, File], Map.empty[File, F])
|
||||
case _: ZipException => (Relation.empty[File, File], Map.empty[File, F])
|
||||
case e: TranslatedException =>
|
||||
e.getCause match {
|
||||
case _: ZipException => (Relation.empty[File, File], Map.empty[File, F])
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ object Tests {
|
|||
|
||||
for (option <- config.options) {
|
||||
option match {
|
||||
case Filter(include) => testFilters += include; ()
|
||||
case Filter(include) => testFilters += include; ()
|
||||
case Filters(includes) =>
|
||||
if (orderedFilters.nonEmpty) sys.error("Cannot define multiple ordered test filters.")
|
||||
else orderedFilters = includes
|
||||
|
|
@ -502,7 +502,7 @@ object Tests {
|
|||
} else {
|
||||
def sequence(tasks: List[Task[Output]], acc: List[Output]): Task[List[Output]] =
|
||||
tasks match {
|
||||
case Nil => task(acc.reverse)
|
||||
case Nil => task(acc.reverse)
|
||||
case hd :: tl =>
|
||||
hd flatMap { out =>
|
||||
sequence(tl, out :: acc)
|
||||
|
|
|
|||
|
|
@ -63,8 +63,7 @@ object WorkerExchange:
|
|||
) ++
|
||||
(socketOpt match
|
||||
case Some(s) => Seq("--tcp", s.getLocalPort().toString())
|
||||
case _ => Nil
|
||||
)
|
||||
case _ => Nil)
|
||||
val onStdoutLine: String => Unit = connectionType match
|
||||
case WorkerConnection.Stdio => notifyListeners
|
||||
case _ => (line) => scala.Console.out.println(line)
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class SonaClient(reqTransform: Request => Request, uploadRequestTimeout: FiniteD
|
|||
waitForDeploy(deploymentId, deploymentName, publishingType, attempt + 1, log)
|
||||
case DeploymentState.PUBLISHED if publishingType == PublishingType.Automatic => ()
|
||||
case DeploymentState.VALIDATED if publishingType == PublishingType.UserManaged => ()
|
||||
case DeploymentState.VALIDATED =>
|
||||
case DeploymentState.VALIDATED =>
|
||||
Thread.sleep(sleepSec * 1000L)
|
||||
waitForDeploy(deploymentId, deploymentName, publishingType, attempt + 1, log)
|
||||
case _ =>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ package sbt
|
|||
|
||||
import java.io.File
|
||||
import java.nio.file.Path
|
||||
import sbt.internal.inc.classpath.{ ClassLoaderCache as IncClassLoaderCache }
|
||||
import sbt.internal.inc.classpath.ClassLoaderCache as IncClassLoaderCache
|
||||
import sbt.internal.classpath.ClassLoaderCache
|
||||
import sbt.internal.server.ServerHandler
|
||||
import sbt.internal.util.AttributeKey
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import sbt.internal.inc.ReflectUtilities
|
|||
import sbt.internal.util.complete.{ DefaultParsers, EditDistance, Parser }
|
||||
import sbt.internal.util.Types.const
|
||||
import sbt.internal.util.{ AttributeKey, AttributeMap, Util }
|
||||
import sbt.internal.util.Util.{ nilSeq }
|
||||
import sbt.internal.util.Util.nilSeq
|
||||
|
||||
/**
|
||||
* An operation that can be executed from the sbt console.
|
||||
|
|
@ -185,7 +185,7 @@ object Command {
|
|||
def process(command: String, state: State, onParseError: String => Unit): State = {
|
||||
(if (command.contains(";")) parse(command, state.combinedParser)
|
||||
else parse(command, state.nonMultiParser)) match {
|
||||
case Right(s) => s() // apply command. command side effects happen here
|
||||
case Right(s) => s() // apply command. command side effects happen here
|
||||
case Left(errMsg) =>
|
||||
state.log.error(errMsg)
|
||||
onParseError(errMsg)
|
||||
|
|
@ -279,7 +279,7 @@ object Help {
|
|||
def message(h: Help, arg: Option[String]): String =
|
||||
arg match {
|
||||
case Some(x) => detail(x, h.detail)
|
||||
case None =>
|
||||
case None =>
|
||||
val brief = aligned(" ", " ", h.brief).mkString("\n", "\n", "\n")
|
||||
val more = h.more
|
||||
if (more.isEmpty)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ object CommandUtil {
|
|||
def detail(selected: String, detailMap: Map[String, String]): String =
|
||||
detailMap.get(selected) match {
|
||||
case Some(exactDetail) => exactDetail
|
||||
case None =>
|
||||
case None =>
|
||||
try {
|
||||
val details = searchHelp(selected, detailMap)
|
||||
if (details.isEmpty)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ private[sbt] object ExceptionCategory {
|
|||
|
||||
@tailrec def apply(t: Throwable): ExceptionCategory = t match {
|
||||
case _: AlreadyHandledException | _: UnprintableException => AlreadyHandled
|
||||
case ite: InvocationTargetException =>
|
||||
case ite: InvocationTargetException =>
|
||||
val cause = ite.getCause
|
||||
if (cause == null || cause == ite) new Full(ite) else apply(cause)
|
||||
case _: MessageOnlyException => new MessageOnly(t.toString)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ package sbt
|
|||
import java.util.regex.Pattern
|
||||
import scala.Console.{ BOLD, RESET }
|
||||
|
||||
import sbt.internal.util.{ Terminal as UTerminal }
|
||||
import sbt.internal.util.Terminal as UTerminal
|
||||
|
||||
object Highlight {
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import java.net.{ URL, URLClassLoader }
|
|||
import java.util.concurrent.Callable
|
||||
|
||||
import sbt.internal.classpath.ClassLoaderCache
|
||||
import sbt.internal.inc.classpath.{ ClassLoaderCache as IncClassLoaderCache }
|
||||
import sbt.internal.inc.classpath.ClassLoaderCache as IncClassLoaderCache
|
||||
import sbt.internal.util.complete.{ HistoryCommands, Parser }
|
||||
import sbt.internal.util.*
|
||||
import sbt.util.Logger
|
||||
|
|
@ -270,7 +270,7 @@ object State {
|
|||
f(cmd, s1)
|
||||
}
|
||||
s.remainingCommands match {
|
||||
case Nil => exit(true)
|
||||
case Nil => exit(true)
|
||||
case x :: xs =>
|
||||
(x.execId, x.source) match {
|
||||
/*
|
||||
|
|
@ -394,14 +394,14 @@ object State {
|
|||
s.get(BasicKeys.extendedClassLoaderCache).foreach(_.close())
|
||||
val cache = newClassLoaderCache
|
||||
s.configuration.provider.scalaProvider.loader match {
|
||||
case null => // This can happen in scripted
|
||||
case null => // This can happen in scripted
|
||||
case fullScalaLoader =>
|
||||
val jars = s.configuration.provider.scalaProvider.jars
|
||||
val (library, rest) = jars.partition(_.getName == "scala-library.jar")
|
||||
library.toList match {
|
||||
case l @ lj :: Nil =>
|
||||
fullScalaLoader.getParent match {
|
||||
case null => // This can happen for old launchers.
|
||||
case null => // This can happen for old launchers.
|
||||
case libraryLoader =>
|
||||
cache.cachedCustomClassloader(l, () => new UncloseableURLLoader(l, libraryLoader))
|
||||
fullScalaLoader match {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import java.io.File
|
|||
import java.nio.file.FileSystems
|
||||
|
||||
import sbt.internal.LabeledFunctions.*
|
||||
import sbt.internal.io.{ Source }
|
||||
import sbt.internal.io.Source
|
||||
import sbt.io.*
|
||||
|
||||
import scala.concurrent.duration.*
|
||||
|
|
@ -64,7 +64,7 @@ object Watched:
|
|||
FileSystems.getDefault.newWatchService()
|
||||
case Some("closewatch") => closeWatch
|
||||
case _ if Properties.isMac => closeWatch
|
||||
case _ =>
|
||||
case _ =>
|
||||
FileSystems.getDefault.newWatchService()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ abstract class CommandChannel {
|
|||
case "debug" => setLevel(Level.Debug, "debug")
|
||||
case "info" => setLevel(Level.Info, "info")
|
||||
case "warn" => setLevel(Level.Warn, "warn")
|
||||
case cmd =>
|
||||
case cmd =>
|
||||
if (cmd.nonEmpty) appendExec(cmd, None)
|
||||
else false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ private[sbt] class ClassLoaderCache(
|
|||
private def get(key: Key, f: () => ClassLoader): ClassLoader = {
|
||||
scalaProviderKey match {
|
||||
case Some(k) if k == key => k.toClassLoader
|
||||
case _ =>
|
||||
case _ =>
|
||||
def addLoader(): ClassLoader = {
|
||||
val ref = mkReference(key, f())
|
||||
val loader = ref.get
|
||||
|
|
@ -211,7 +211,7 @@ private[sbt] class ClassLoaderCache(
|
|||
lock.synchronized {
|
||||
delegate.get(key) match {
|
||||
case null => addLoader()
|
||||
case ref =>
|
||||
case ref =>
|
||||
ref.get match {
|
||||
case null => addLoader()
|
||||
case l => l
|
||||
|
|
@ -223,7 +223,7 @@ private[sbt] class ClassLoaderCache(
|
|||
private def clear(lock: Object): Unit = {
|
||||
delegate.asScala.foreach {
|
||||
case (_, ClassLoaderReference(_, classLoader)) => close(classLoader)
|
||||
case (_, r: Reference[ClassLoader]) =>
|
||||
case (_, r: Reference[ClassLoader]) =>
|
||||
r.get match {
|
||||
case null =>
|
||||
case classLoader => close(classLoader)
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ class NetworkClient(
|
|||
else {
|
||||
startInputThread()
|
||||
stdinBytes.poll(5, TimeUnit.SECONDS) match {
|
||||
case null => System.exit(0)
|
||||
case null => System.exit(0)
|
||||
case i if i == 9 =>
|
||||
errorStream.println("\nStarting server...")
|
||||
waitForServer(portfile, !promptCompleteUsers, startServer = true)
|
||||
|
|
@ -300,7 +300,7 @@ class NetworkClient(
|
|||
Option(inputThread.get).foreach(_.close())
|
||||
Option(interactiveThread.get).foreach(_.interrupt)
|
||||
}
|
||||
case `readSystemIn` => startInputThread()
|
||||
case `readSystemIn` => startInputThread()
|
||||
case `cancelReadSystemIn` =>
|
||||
inputThread.get match {
|
||||
case null =>
|
||||
|
|
@ -459,14 +459,14 @@ class NetworkClient(
|
|||
try {
|
||||
s.getInputStream.read match {
|
||||
case -1 | 0 => readThreadAlive.set(false)
|
||||
case 2 => // STX: start of text
|
||||
case 2 => // STX: start of text
|
||||
gotInputBack = true
|
||||
case 5 => // ENQ: enquiry
|
||||
term.enterRawMode(); startInputThread()
|
||||
case 3 if gotInputBack => // ETX: end of text
|
||||
readThreadAlive.set(false)
|
||||
case i if gotInputBack => stdinBytes.offer(i)
|
||||
case 10 => // CR
|
||||
case 10 => // CR
|
||||
buffer.append(10.toByte)
|
||||
printStream.write(buffer.toArray[Byte])
|
||||
buffer.clear()
|
||||
|
|
@ -610,7 +610,7 @@ class NetworkClient(
|
|||
}
|
||||
def completeExec(execId: String, exitCode: Int) = {
|
||||
pendingResults.remove(execId) match {
|
||||
case null => ()
|
||||
case null => ()
|
||||
case (q, startTime, name) =>
|
||||
val now = System.currentTimeMillis
|
||||
val message = NetworkClient.elapsedString(startTime, now)
|
||||
|
|
@ -635,7 +635,7 @@ class NetworkClient(
|
|||
private val onCompletionResponse: PartialFunction[JsonRpcResponseMessage, Unit] = {
|
||||
case msg if pendingCompletions.containsKey(msg.id) =>
|
||||
pendingCompletions.remove(msg.id) match {
|
||||
case null => ()
|
||||
case null => ()
|
||||
case completions =>
|
||||
completions(msg.result match {
|
||||
case Some(o: JObject) =>
|
||||
|
|
@ -730,7 +730,7 @@ class NetworkClient(
|
|||
}
|
||||
case (`Shutdown`, Some(_)) => Vector.empty
|
||||
case (msg, _) if msg.startsWith("build/") => Vector.empty
|
||||
case ("sbt/exec", Some(json)) =>
|
||||
case ("sbt/exec", Some(json)) =>
|
||||
import sbt.protocol.codec.JsonProtocol.given
|
||||
Converter.fromJson[ExecStatusEvent](json) match {
|
||||
case Success(event) if event.status == "Queued" =>
|
||||
|
|
@ -796,7 +796,7 @@ class NetworkClient(
|
|||
private def clientSideRun(runInfo: RunInfo): Try[Unit] = {
|
||||
runInfo.windowTitle.foreach(setWindowTitle)
|
||||
def nativeRun(info: NativeRunInfo): Try[Unit] = {
|
||||
import java.lang.{ ProcessBuilder as JProcessBuilder }
|
||||
import java.lang.ProcessBuilder as JProcessBuilder
|
||||
val option = ForkOptions(
|
||||
javaHome = None,
|
||||
outputStrategy = None, // TODO: Handle buffered output etc
|
||||
|
|
@ -987,7 +987,7 @@ class NetworkClient(
|
|||
val (rawPrefix, prefix, rawSuffix, suffix) = if (quoteCount > 0) {
|
||||
query.lastIndexOf('"') match {
|
||||
case -1 => (query, query, None, None) // shouldn't happen
|
||||
case i =>
|
||||
case i =>
|
||||
val rawPrefix = query.substring(0, i)
|
||||
val prefix = rawPrefix.replace("\"", "").replace("\\;", ";")
|
||||
val rawSuffix = query.substring(i).replace("\\;", ";")
|
||||
|
|
@ -1083,7 +1083,7 @@ class NetworkClient(
|
|||
}
|
||||
} catch {
|
||||
case e: SocketException if command.toString.contains("exit") => running.set(false)
|
||||
case e: IOException =>
|
||||
case e: IOException =>
|
||||
errorStream.println(s"Caught exception writing command to server: $e")
|
||||
running.set(false)
|
||||
}
|
||||
|
|
@ -1119,7 +1119,7 @@ class NetworkClient(
|
|||
if (mainThread != null && mainThread != Thread.currentThread) mainThread.interrupt
|
||||
connectionHolder.get match {
|
||||
case null =>
|
||||
case c =>
|
||||
case c =>
|
||||
try sendExecCommand("exit")
|
||||
finally c.close()
|
||||
}
|
||||
|
|
@ -1319,7 +1319,7 @@ object NetworkClient {
|
|||
case "--sbt-launch-jar" if i + 1 < sanitized.length =>
|
||||
i += 1
|
||||
launchJar = Option(sanitized(i).replace("%20", " "))
|
||||
case "-bsp" | "--bsp" | "bsp" => bsp = true
|
||||
case "-bsp" | "--bsp" | "bsp" => bsp = true
|
||||
case "-no-server" | "--no-server" =>
|
||||
System.setProperty("sbt.server.autostart", "false")
|
||||
case a if a.startsWith("--autostart=") =>
|
||||
|
|
@ -1332,7 +1332,7 @@ object NetworkClient {
|
|||
case a if launcherEqPrefixes.exists(p => a.startsWith(p)) => ()
|
||||
case a if a.startsWith("-J") => ()
|
||||
case a if !a.startsWith("-") => commandArgs += a
|
||||
case a @ SysProp(key, value) =>
|
||||
case a @ SysProp(key, value) =>
|
||||
System.setProperty(key, value)
|
||||
sbtArguments += a
|
||||
case a => sbtArguments += a
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ private[sbt] object Server {
|
|||
addServerError(new ServerSocket(port, 50, InetAddress.getByName(host)))
|
||||
}
|
||||
} match {
|
||||
case Failure(e) => p.failure(e)
|
||||
case Failure(e) => p.failure(e)
|
||||
case Success(serverSocket) =>
|
||||
serverSocket.setSoTimeout(5000)
|
||||
serverSocketHolder.getAndSet(serverSocket) match {
|
||||
|
|
@ -132,7 +132,7 @@ private[sbt] object Server {
|
|||
def tryClient(f: => Socket): Unit = {
|
||||
if (portfile.exists) {
|
||||
Try { f } match {
|
||||
case Failure(_) => ()
|
||||
case Failure(_) => ()
|
||||
case Success(socket) =>
|
||||
socket.close()
|
||||
throw new AlreadyRunningException()
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import sjsonnew.JsonFormat
|
|||
import sbt.internal.protocol.*
|
||||
import sbt.util.Logger
|
||||
import sbt.protocol.{ CompletionParams as CP, SettingQuery as Q }
|
||||
import sbt.internal.langserver.{ CancelRequestParams as CRP }
|
||||
import sbt.internal.langserver.CancelRequestParams as CRP
|
||||
|
||||
/**
|
||||
* ServerHandler allows plugins to extend sbt server.
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import sbt.internal.CommandChannel
|
|||
import sbt.internal.util.ConsoleAppender.{ ClearPromptLine, ClearScreenAfterCursor, DeleteLine }
|
||||
import sbt.internal.util.Terminal.hasConsole
|
||||
import sbt.internal.util.*
|
||||
import sbt.internal.util.complete.{ Parser }
|
||||
import sbt.internal.util.complete.Parser
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ private[sbt] object UITask {
|
|||
case Some(NoShellPrompt) | None =>
|
||||
s.get(colorShellPrompt) match {
|
||||
case Some(pf) => pf(terminal.isColorEnabled, s)
|
||||
case None =>
|
||||
case None =>
|
||||
def color(s: String): String = if (terminal.isColorEnabled) s"$s" else ""
|
||||
s"${color(DeleteLine)}> ${color(ClearScreenAfterCursor)}"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ private[sbt] class UserThread(val channel: CommandChannel) extends AutoCloseable
|
|||
}
|
||||
}
|
||||
uiThread.getAndSet((task, thread)) match {
|
||||
case null => thread.start()
|
||||
case null => thread.start()
|
||||
case (prevTask, prevThread) if prevTask.getClass != task.getClass =>
|
||||
prevTask.close()
|
||||
prevThread.joinFor(1.second)
|
||||
|
|
@ -56,7 +56,7 @@ private[sbt] class UserThread(val channel: CommandChannel) extends AutoCloseable
|
|||
uiThread.get match {
|
||||
case null => submit()
|
||||
case (prevTask, _) if prevTask.getClass == task.getClass =>
|
||||
case (t, thread) =>
|
||||
case (t, thread) =>
|
||||
stopThreadImpl()
|
||||
submit()
|
||||
}
|
||||
|
|
@ -66,7 +66,7 @@ private[sbt] class UserThread(val channel: CommandChannel) extends AutoCloseable
|
|||
|
||||
private[sbt] def stopThreadImpl(): Unit = uiThread.synchronized {
|
||||
uiThread.getAndSet(null) match {
|
||||
case null =>
|
||||
case null =>
|
||||
case (t, thread) =>
|
||||
t.close()
|
||||
thread.joinFor(1.second)
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ object Def extends BuildSyntax with Init with InitializeImplicits:
|
|||
project: Reference,
|
||||
trailingSlash: Boolean
|
||||
): String = {
|
||||
import Reference.{ display as displayRef }
|
||||
import Reference.display as displayRef
|
||||
@tailrec def loop(ref: Reference): String = ref match {
|
||||
case ProjectRef(b, p) => if (b == current.build) loop(LocalProject(p)) else displayRef(ref)
|
||||
case BuildRef(b) => if (b == current.build) loop(ThisBuild) else displayRef(ref)
|
||||
|
|
@ -256,10 +256,9 @@ object Def extends BuildSyntax with Init with InitializeImplicits:
|
|||
def toIParser[A1](p: Initialize[InputTask[A1]]): Initialize[State => Parser[Task[A1]]] =
|
||||
p(_.parser)
|
||||
|
||||
import std.SettingMacro.{
|
||||
// settingDynMacroImpl,
|
||||
settingMacroImpl
|
||||
}
|
||||
import std.SettingMacro.
|
||||
// settingDynMacroImpl,
|
||||
settingMacroImpl
|
||||
import std.*
|
||||
|
||||
import language.experimental.macros
|
||||
|
|
@ -442,7 +441,7 @@ object Def extends BuildSyntax with Init with InitializeImplicits:
|
|||
Def.stateKey.zipWith(in)((sTask, it) =>
|
||||
sTask map { s =>
|
||||
Parser.parse(arg, it.parser(s)) match
|
||||
case Right(a) => Def.value[Task[A1]](a)
|
||||
case Right(a) => Def.value[Task[A1]](a)
|
||||
case Left(msg) =>
|
||||
val indented = msg.linesIterator.map(" " + _).mkString("\n")
|
||||
sys.error(s"Invalid programmatic input:\n$indented")
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ final class InputTask[A1] private (val parser: State => Parser[Task[A1]]):
|
|||
def fullInput(in: String): InputTask[A1] =
|
||||
InputTask[A1](s =>
|
||||
Parser.parse(in, parser(s)) match {
|
||||
case Right(v) => Parser.success(v)
|
||||
case Right(v) => Parser.success(v)
|
||||
case Left(msg) =>
|
||||
val indented = msg.linesIterator.map(" " + _).mkString("\n")
|
||||
Parser.failure(s"Invalid programmatic input:\n$indented")
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ object Plugins extends PluginsFunctions {
|
|||
clauses,
|
||||
(flattenConvert(requestedPlugins) ++ convertAll(alwaysEnabled)).toSet
|
||||
) match {
|
||||
case Left(problem) => throw AutoPluginException(problem)
|
||||
case Left(problem) => throw AutoPluginException(problem)
|
||||
case Right(results) =>
|
||||
log.debug(s" :: deduced result: ${results}")
|
||||
val selectedAtoms: List[Atom] = results.ordered
|
||||
|
|
@ -346,7 +346,7 @@ ${listConflicts(conflicting)}""")
|
|||
|
||||
private[sbt] def overrideWith(current: Plugins, update: Plugins): Plugins = {
|
||||
val opposite: Set[Basic] = flatten(update).map {
|
||||
case Exclude(p) => p: Basic
|
||||
case Exclude(p) => p: Basic
|
||||
case p: AutoPlugin =>
|
||||
Exclude(p): Basic
|
||||
}.toSet
|
||||
|
|
@ -356,7 +356,7 @@ ${listConflicts(conflicting)}""")
|
|||
private[sbt] def remove(a: Plugins, del: Set[Basic]): Plugins = a match {
|
||||
case b: Basic => if (del(b)) Empty else b
|
||||
case Empty => Empty
|
||||
case And(ns) =>
|
||||
case And(ns) =>
|
||||
val removed = ns.filterNot(del)
|
||||
if (removed.isEmpty) Empty else And(removed)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
package sbt
|
||||
|
||||
import scala.concurrent.{ Promise as XPromise }
|
||||
import scala.concurrent.Promise as XPromise
|
||||
|
||||
final class PromiseWrap[A]:
|
||||
private[sbt] val underlying: XPromise[A] = XPromise()
|
||||
|
|
|
|||
|
|
@ -370,13 +370,13 @@ object Scope:
|
|||
}
|
||||
|
||||
scope.project match {
|
||||
case Zero | This => globalProjectDelegates(scope)
|
||||
case Zero | This => globalProjectDelegates(scope)
|
||||
case Select(proj) =>
|
||||
val resolvedProj = resolve(proj)
|
||||
val projAxes: Seq[ScopeAxis[ResolvedReference]] =
|
||||
resolvedProj match {
|
||||
case pr: ProjectRef => index.project(pr)
|
||||
case br: BuildRef =>
|
||||
case br: BuildRef =>
|
||||
List(Select(br): ScopeAxis[ResolvedReference], Zero: ScopeAxis[ResolvedReference])
|
||||
}
|
||||
expandDelegateScopes(resolvedProj)(projAxes)
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ object InputTaskMacro:
|
|||
.transform { (replacement: Term) =>
|
||||
inputBuf.append((name, TypeRepr.of[a](using tpe), qual, replacement))
|
||||
oldTree
|
||||
}
|
||||
}
|
||||
def genCreateFree(body: Term) =
|
||||
val init = expandTask[A1](true, body)
|
||||
'{
|
||||
|
|
@ -177,7 +177,7 @@ object InputTaskMacro:
|
|||
}
|
||||
val body = convert1.transformWrappers(expr.asTerm, record, Symbol.spliceOwner)
|
||||
inputBuf.toList match
|
||||
case Nil => genCreateFree(body)
|
||||
case Nil => genCreateFree(body)
|
||||
case (_, tpe, _, paramTree) :: Nil =>
|
||||
tpe.asType match
|
||||
case '[a] => genCreateDyn[a](paramTree, body)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class InitializeConvert[C <: Quotes & scala.Singleton](override val qctx: C, val
|
|||
|
||||
override def convert[A: Type](nme: String, in: Term): Converted =
|
||||
nme match
|
||||
case InputWrapper.WrapInitName => Converted.success(in)
|
||||
case InputWrapper.WrapInitName => Converted.success(in)
|
||||
case InputWrapper.WrapTaskName | InputWrapper.WrapInitTaskName =>
|
||||
Converted.Failure(in.pos, "A setting cannot depend on a task")
|
||||
case InputWrapper.WrapPreviousName =>
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ object TaskMacro:
|
|||
val cached = ContextUtil.isTaskCacheByDefault && !isUncacheApplied && cl.nonEmpty
|
||||
t match
|
||||
case '{ if ($cond) then $thenp else $elsep } => taskIfImpl[A1](t, cached)
|
||||
case _ =>
|
||||
case _ =>
|
||||
val convert1 = new FullConvert(qctx, 0)
|
||||
if cached then
|
||||
convert1.contMapN[A1, F, Id](
|
||||
|
|
@ -92,7 +92,7 @@ object TaskMacro:
|
|||
): Expr[Initialize[Task[A1]]] =
|
||||
t match
|
||||
case '{ if ($cond) then $thenp else $elsep } => taskIfImpl[A1](t, cached)
|
||||
case _ =>
|
||||
case _ =>
|
||||
val convert1 = new FullConvert(qctx, 0)
|
||||
if cached then
|
||||
convert1.contMapN[A1, F, Id](
|
||||
|
|
|
|||
|
|
@ -89,8 +89,7 @@ object Assign {
|
|||
|
||||
val dyn: Def.Initialize[Task[Int]] = Def.taskDyn {
|
||||
val a = ak.value
|
||||
if a < 1 then Def.task { 1 }
|
||||
else Def.task { 0 }
|
||||
if a < 1 then Def.task { 1 } else Def.task { 0 }
|
||||
}
|
||||
|
||||
import DefaultParsers.*
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ object Cross {
|
|||
versionArg.split("=", 2) match {
|
||||
case Array(home) if new File(home).exists() =>
|
||||
ScalaHomeVersion(new File(home), None, force)
|
||||
case Array(v) => NamedScalaVersion(v, force)
|
||||
case Array(v) => NamedScalaVersion(v, force)
|
||||
case Array(v, home) =>
|
||||
ScalaHomeVersion(new File(home), Some(v).filterNot(_.isEmpty), force)
|
||||
}
|
||||
|
|
@ -216,8 +216,8 @@ object Cross {
|
|||
.sortBy(_._1)
|
||||
commandsByVersion.flatMap { (v, commands) =>
|
||||
commands match {
|
||||
case Seq(c) => Seq(s"$SwitchCommand $verbose $v $c")
|
||||
case Seq() => Nil // should be unreachable
|
||||
case Seq(c) => Seq(s"$SwitchCommand $verbose $v $c")
|
||||
case Seq() => Nil // should be unreachable
|
||||
case multi if fullArgs.isEmpty =>
|
||||
Seq(s"$SwitchCommand $verbose $v all ${multi.mkString(" ")}")
|
||||
case multi => Seq(s"$SwitchCommand $verbose $v") ++ multi
|
||||
|
|
@ -353,7 +353,7 @@ object Cross {
|
|||
scalaVersions.filter(v => selector.matches(VersionNumber(v))) match {
|
||||
case Nil => (project, None, scalaVersions)
|
||||
case Seq(version) => (project, Some(version), scalaVersions)
|
||||
case multiple =>
|
||||
case multiple =>
|
||||
sys.error(
|
||||
s"Multiple crossScalaVersions matched query '$version': ${multiple.mkString(", ")}"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import java.nio.file.{ Files, Path as NioPath }
|
|||
import java.util.{ Optional, UUID }
|
||||
import java.util.concurrent.TimeUnit
|
||||
import lmcoursier.CoursierDependencyResolution
|
||||
import lmcoursier.definitions.{ Configuration as CConfiguration }
|
||||
import lmcoursier.definitions.Configuration as CConfiguration
|
||||
import org.scalasbt.ipcsocket.Win32SecurityLevel
|
||||
import sbt.Def.{ Initialize, ScopedKey, Setting, SettingsDefinition, parsed }
|
||||
import sbt.Keys.*
|
||||
|
|
@ -2013,7 +2013,7 @@ object Defaults extends BuildCommon with DefExtra {
|
|||
try
|
||||
ITerminal.get.inputStream.read match {
|
||||
case -1 | -2 => None
|
||||
case b =>
|
||||
case b =>
|
||||
val res = b.toChar.toString
|
||||
println(res)
|
||||
Some(res)
|
||||
|
|
@ -2632,7 +2632,7 @@ object Defaults extends BuildCommon with DefExtra {
|
|||
val uri = thisProjectRef.value.build
|
||||
val log = streams.value.log
|
||||
RetrieveUnit(uri) match {
|
||||
case None => ()
|
||||
case None => ()
|
||||
case Some(vcs) =>
|
||||
val strategy = repositoryUpdateStrategy.value
|
||||
val lb = Project.extract(state.value).get(Keys.loadedBuild)
|
||||
|
|
@ -3161,7 +3161,7 @@ object Classpaths {
|
|||
) match {
|
||||
case (Some(delegated), Seq(), _) => delegated
|
||||
case (_, rs, Some(ars)) => ars ++ rs
|
||||
case (_, rs, _) =>
|
||||
case (_, rs, _) =>
|
||||
Resolver.combineDefaultResolvers(rs.toVector, mavenCentral = true)
|
||||
}
|
||||
),
|
||||
|
|
@ -3192,7 +3192,7 @@ object Classpaths {
|
|||
else Vector.empty
|
||||
bootResolvers.value match {
|
||||
case Some(repos) if overrideBuildResolvers.value => proj +: repos
|
||||
case _ =>
|
||||
case _ =>
|
||||
val base = if (sbtPlugin.value) sbtResolvers.value ++ rs ++ pr else rs ++ pr
|
||||
(proj +: base).distinct
|
||||
}
|
||||
|
|
@ -3948,7 +3948,7 @@ object Classpaths {
|
|||
val currentBuildClock = DependencyLockFile.computeBuildClock(deps, resolverNames)
|
||||
DependencyLockManager.validate(lockFile, currentBuildClock, log) match
|
||||
case Some(_) => ()
|
||||
case None =>
|
||||
case None =>
|
||||
throw new MessageOnlyException(
|
||||
s"Dependency lock file is stale: ${lockFile.getAbsolutePath}. Run 'dependencyLock' to update it."
|
||||
)
|
||||
|
|
@ -4068,7 +4068,7 @@ object Classpaths {
|
|||
val isRoot = er.contains(rs)
|
||||
val shouldForce = isRoot || {
|
||||
fup match
|
||||
case None => false
|
||||
case None => false
|
||||
case Some(period) =>
|
||||
val fullUpdateOutput = cacheDirectory / "output"
|
||||
val now = System.currentTimeMillis
|
||||
|
|
@ -4727,7 +4727,7 @@ object Classpaths {
|
|||
case Predefined.ScalaToolsSnapshots => Resolver.ScalaToolsSnapshots
|
||||
case Predefined.SonatypeOSSReleases => Resolver.sonatypeRepo("releases")
|
||||
case Predefined.SonatypeOSSSnapshots => Resolver.sonatypeRepo("snapshots")
|
||||
case unknown =>
|
||||
case unknown =>
|
||||
sys.error(
|
||||
"Unknown predefined resolver '" + unknown + "'. This resolver may only be supported in newer sbt versions."
|
||||
)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
package sbt
|
||||
|
||||
import java.nio.file.{ Path as NioPath }
|
||||
import java.nio.file.Path as NioPath
|
||||
import java.io.File
|
||||
import java.net.URI
|
||||
import lmcoursier.definitions.{ CacheLogger, ModuleMatchers, Reconciliation }
|
||||
|
|
|
|||
|
|
@ -777,7 +777,7 @@ object BuiltinCommands {
|
|||
|
||||
def last: Command = Command(LastCommand, lastBrief, lastDetailed)(aggregatedKeyValueParser) {
|
||||
case (s, Some(sks)) => lastImpl(s, sks, None)
|
||||
case (s, None) =>
|
||||
case (s, None) =>
|
||||
for (logFile <- lastLogFile(s)) yield Output.last(logFile, printLast)
|
||||
keepLastLog(s)
|
||||
}
|
||||
|
|
@ -1292,7 +1292,9 @@ object BuiltinCommands {
|
|||
if (!suppress) {
|
||||
Banner(version).foreach(banner => state.log.info(banner))
|
||||
}
|
||||
} catch { case _: IOException => /* Don't let errors in this command prevent startup */ }
|
||||
} catch {
|
||||
case _: IOException => /* Don't let errors in this command prevent startup */
|
||||
}
|
||||
state.put(bannerHasBeenShown, true)
|
||||
} else state
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ private[sbt] object MainLoop:
|
|||
def getOrSet[T](state: State, key: AttributeKey[T], value: Extracted => T): State = {
|
||||
state.get(key) match {
|
||||
case Some(_) => state
|
||||
case _ =>
|
||||
case _ =>
|
||||
if (state.get(Keys.stateBuildStructure).isDefined) {
|
||||
val extracted = Project.extract(state)
|
||||
state.put(key, value(extracted))
|
||||
|
|
@ -376,12 +376,12 @@ private[sbt] object MainLoop:
|
|||
case State.Continue => ExitCode.Success
|
||||
case State.ClearGlobalLog => ExitCode.Success
|
||||
case State.KeepLastLog => ExitCode.Success
|
||||
case ret: State.Return =>
|
||||
case ret: State.Return =>
|
||||
ret.result match
|
||||
case exit: xsbti.Exit => ExitCode(exit.code().toLong)
|
||||
case _: xsbti.Continue => ExitCode.Success
|
||||
case _: xsbti.Reboot => ExitCode.Success
|
||||
case x =>
|
||||
case x =>
|
||||
val clazz = if (x eq null) "" else " (class: " + x.getClass + ")"
|
||||
state.log.debug(s"Unknown main result: $x$clazz")
|
||||
ExitCode.Unknown
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
package sbt
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.{ Path as NioPath }
|
||||
import java.nio.file.Path as NioPath
|
||||
import java.net.URI
|
||||
// import Project._
|
||||
import Keys.{
|
||||
|
|
@ -638,7 +638,8 @@ trait ProjectExtra extends Scoped.Syntax:
|
|||
case LoadAction.Current =>
|
||||
val base = s.configuration.baseDirectory
|
||||
projectReturn(s) match
|
||||
case Nil => (setProjectReturn(s, base :: Nil), base); case x :: _ => (s, x)
|
||||
case Nil => (setProjectReturn(s, base :: Nil), base);
|
||||
case x :: _ => (s, x)
|
||||
|
||||
case LoadAction.Plugins =>
|
||||
val (newBase, oldStack) =
|
||||
|
|
|
|||
|
|
@ -185,8 +185,8 @@ object Resolvers {
|
|||
|
||||
private[sbt] def shouldUpdate(dir: File, strategy: RepositoryUpdateStrategy): Boolean =
|
||||
strategy match {
|
||||
case RepositoryUpdateStrategy.Manual => false
|
||||
case RepositoryUpdateStrategy.Always => true
|
||||
case RepositoryUpdateStrategy.Manual => false
|
||||
case RepositoryUpdateStrategy.Always => true
|
||||
case RepositoryUpdateStrategy.Every(interval) =>
|
||||
val marker = new File(dir, LastUpdatedFileName)
|
||||
if (!marker.exists()) true
|
||||
|
|
@ -253,7 +253,7 @@ object Resolvers {
|
|||
result: Set[URI]
|
||||
): Set[URI] =
|
||||
queue match {
|
||||
case Nil => result
|
||||
case Nil => result
|
||||
case ref :: rest =>
|
||||
if (visited.contains(ref)) go(rest, visited, result)
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -170,13 +170,13 @@ object ScopeFilter {
|
|||
|
||||
private def referenceOrderingKey(reference: Reference): String =
|
||||
reference match
|
||||
case ThisBuild => "0"
|
||||
case ThisProject => "1"
|
||||
case LocalAggregate => "2"
|
||||
case LocalRootProject => "3"
|
||||
case LocalProject(id) => s"4:$id"
|
||||
case BuildRef(build) => s"5:${uriOrderingKey(build)}"
|
||||
case RootProject(build) => s"6:${uriOrderingKey(build)}"
|
||||
case ThisBuild => "0"
|
||||
case ThisProject => "1"
|
||||
case LocalAggregate => "2"
|
||||
case LocalRootProject => "3"
|
||||
case LocalProject(id) => s"4:$id"
|
||||
case BuildRef(build) => s"5:${uriOrderingKey(build)}"
|
||||
case RootProject(build) => s"6:${uriOrderingKey(build)}"
|
||||
case ProjectRef(build, project) =>
|
||||
s"7:${uriOrderingKey(build)}:$project"
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ object ScopeFilter {
|
|||
|
||||
private def attributeValueOrderingKey(value: Any): String =
|
||||
value match
|
||||
case null => "null"
|
||||
case null => "null"
|
||||
case m: collection.Map[?, ?] =>
|
||||
m.iterator
|
||||
.map((k, v) => s"${attributeValueOrderingKey(k)}->${attributeValueOrderingKey(v)}")
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ object SessionVar {
|
|||
): (State, Option[T]) =
|
||||
get(key, state) match {
|
||||
case s: Some[T] => (state, s)
|
||||
case None =>
|
||||
case None =>
|
||||
read(key, state)(using f) match {
|
||||
case s @ Some(t) =>
|
||||
val newState =
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ private[sbt] object TemplateCommandUtil {
|
|||
}
|
||||
} else {
|
||||
fortifyArgs(templateDescriptions.toList) match {
|
||||
case Nil => terminate
|
||||
case Nil => terminate
|
||||
case arg :: Nil if arg.endsWith(".local") =>
|
||||
extracted.runInputTask(Keys.templateRunLocal, " " + arg, s0)
|
||||
reload
|
||||
|
|
@ -92,7 +92,7 @@ private[sbt] object TemplateCommandUtil {
|
|||
hit
|
||||
} match {
|
||||
case Some(_) => // do nothing
|
||||
case None =>
|
||||
case None =>
|
||||
val error = "Template not found for: " + arguments.mkString(" ")
|
||||
throw new IllegalArgumentException(error)
|
||||
}
|
||||
|
|
@ -228,8 +228,8 @@ private[sbt] object TemplateCommandUtil {
|
|||
ans
|
||||
}
|
||||
ans0 match {
|
||||
case '\r' | '\n' => printThenReturn(focusValue)
|
||||
case 'q' | 'Q' | -1 => printThenReturn("")
|
||||
case '\r' | '\n' => printThenReturn(focusValue)
|
||||
case 'q' | 'Q' | -1 => printThenReturn("")
|
||||
case 'j' | 'J' | ITerminal.VK_DOWN =>
|
||||
clearMenu(mappingList)
|
||||
askTemplate(mappingList, math.min(focus + 1, mappingList.size - 1))
|
||||
|
|
@ -285,7 +285,7 @@ private[sbt] object TemplateCommandUtil {
|
|||
case ScalaToolkitSlug :: Nil => scalaToolkitTemplate()
|
||||
case TypelevelToolkitSlug :: Nil => typelevelToolkitTemplate()
|
||||
case SbtCrossPlatformSlug :: Nil => sbtCrossPlatformTemplate()
|
||||
case _ =>
|
||||
case _ =>
|
||||
val error = "Local template not found for: " + arguments.mkString(" ")
|
||||
throw new IllegalArgumentException(error)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ object CoursierInputsTasks {
|
|||
val creds = sbt.Keys.allCredentials.value
|
||||
.flatMap {
|
||||
case dc: IvyCredentials.DirectCredentials => List(dc)
|
||||
case fc: IvyCredentials.FileCredentials =>
|
||||
case fc: IvyCredentials.FileCredentials =>
|
||||
sbt.librarymanagement.CredentialUtils.loadCredentials(fc.path) match {
|
||||
case Left(err) =>
|
||||
log.warn(s"$err, ignoring it")
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import lmcoursier.*
|
|||
import lmcoursier.syntax.*
|
||||
import lmcoursier.credentials.Credentials
|
||||
import Keys.*
|
||||
import sbt.librarymanagement.{ Credentials as IvyCredentials }
|
||||
import sbt.librarymanagement.Credentials as IvyCredentials
|
||||
import sbt.internal.util.Util
|
||||
import sbt.librarymanagement.*
|
||||
import sbt.util.Logger
|
||||
|
|
@ -60,7 +60,7 @@ object LMCoursier {
|
|||
.orElse(sys.env.get("COURSIER_CACHE").map(absoluteFile))
|
||||
.orElse(sys.props.get("coursier.cache").map(absoluteFile)) match {
|
||||
case Some(dir) => dir
|
||||
case _ =>
|
||||
case _ =>
|
||||
if Util.isWindows then windowsCacheDirectory
|
||||
else CoursierDependencyResolution.defaultCacheLocation
|
||||
}
|
||||
|
|
@ -281,7 +281,7 @@ object LMCoursier {
|
|||
sbt.librarymanagement.CredentialUtils.loadCredentials(fc.path)
|
||||
}) match {
|
||||
case Left(err) => st.log.warn(err)
|
||||
case Right(d) =>
|
||||
case Right(d) =>
|
||||
credentialRegistry.put((d.host, d.realm), d)
|
||||
()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ private[sbt] object APIMappings {
|
|||
): Option[(HashedVirtualFileRef, URI)] =
|
||||
entry.get(Keys.entryApiURL) match
|
||||
case Some(u) => Some((entry.data, URI(u)))
|
||||
case None =>
|
||||
case None =>
|
||||
entry.get(Keys.moduleIDStr).flatMap { str =>
|
||||
val mid = Classpaths.moduleIdJsonKeyFormat.read(str)
|
||||
extractFromID(entry.data, mid, log)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue