mirror of https://github.com/sbt/sbt.git
Fix compilation warnings
This commit is contained in:
parent
67b9ab0a68
commit
3b111fa1eb
|
|
@ -455,7 +455,7 @@ class TermDisplay(
|
|||
|
||||
/**
|
||||
*
|
||||
* @return: whether any message was printed by this `TermDisplay`
|
||||
* @return whether any message was printed by this `TermDisplay`
|
||||
*/
|
||||
def stopDidPrintSomething(): Boolean = {
|
||||
scheduler.shutdown()
|
||||
|
|
|
|||
|
|
@ -163,6 +163,9 @@ class Helper(
|
|||
}
|
||||
|
||||
|
||||
val loggerFallbackMode =
|
||||
!progress && TermDisplay.defaultFallbackMode
|
||||
|
||||
val (scaladexRawDependencies, otherRawDependencies) =
|
||||
rawDependencies.partition(s => s.contains("/") || !s.contains(":"))
|
||||
|
||||
|
|
@ -364,9 +367,6 @@ class Helper(
|
|||
mapDependencies = if (typelevel) Some(Typelevel.swap(_)) else None
|
||||
)
|
||||
|
||||
val loggerFallbackMode =
|
||||
!progress && TermDisplay.defaultFallbackMode
|
||||
|
||||
val logger =
|
||||
if (verbosityLevel >= 0)
|
||||
Some(new TermDisplay(
|
||||
|
|
@ -465,7 +465,7 @@ class Helper(
|
|||
iterationCounter,
|
||||
0
|
||||
)
|
||||
).run
|
||||
).unsafePerformSync
|
||||
|
||||
Console.err.println(s"Overhead: ${resolutionCounter.value - iterationCounter.value} ms")
|
||||
|
||||
|
|
@ -491,7 +491,7 @@ class Helper(
|
|||
val res0 = startRes
|
||||
.process
|
||||
.run(fetch0, maxIterations)
|
||||
.run
|
||||
.unsafePerformSync
|
||||
val end = System.currentTimeMillis()
|
||||
|
||||
Console.err.println(s"Resolution ${index + 1} / ${-benchmark}: ${end - start} ms")
|
||||
|
|
@ -515,7 +515,7 @@ class Helper(
|
|||
startRes
|
||||
.process
|
||||
.run(fetch0, maxIterations)
|
||||
.run
|
||||
.unsafePerformSync
|
||||
|
||||
logger.foreach(_.stop())
|
||||
|
||||
|
|
@ -674,7 +674,7 @@ class Helper(
|
|||
|
||||
val task = Task.gatherUnordered(tasks)
|
||||
|
||||
val results = task.run
|
||||
val results = task.unsafePerformSync
|
||||
val errors = results.collect{case (artifact, -\/(err)) => artifact -> err }
|
||||
val files0 = results.collect{case (artifact, \/-(f)) => f }
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import argonaut._, Argonaut._, ArgonautShapeless._
|
|||
import coursier.core.{ Artifact, Attributes }
|
||||
import coursier.{ Fetch, Module }
|
||||
|
||||
import scala.language.higherKinds
|
||||
import scalaz.{ -\/, EitherT, Monad, Nondeterminism, \/, \/- }
|
||||
import scalaz.Scalaz.ToEitherOps
|
||||
import scalaz.Scalaz.ToEitherOpsFromEither
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ object ResolutionError {
|
|||
final case class UnknownDownloadException(ex: Throwable) extends ResolutionError
|
||||
final case class Conflicts(description: String) extends ResolutionError
|
||||
|
||||
final case class MetadataDownloadErrors(errors: Seq[(Dependency, Seq[String])]) extends ResolutionError {
|
||||
final case class MetadataDownloadErrors(errors: Seq[((Module, String), Seq[String])]) extends ResolutionError {
|
||||
def description(): String = {
|
||||
|
||||
def grouped(errs: Seq[String]) =
|
||||
|
|
@ -64,8 +64,8 @@ object ResolutionError {
|
|||
|
||||
lines += s"Encountered ${errors.length} error(s) in dependency resolution:"
|
||||
|
||||
for ((dep, errs) <- errors) {
|
||||
lines += s" ${dep.module}:${dep.version}:"
|
||||
for (((mod, ver), errs) <- errors) {
|
||||
lines += s" $mod:$ver:"
|
||||
|
||||
for ((type0, errs0) <- grouped(errs))
|
||||
if (type0.isEmpty)
|
||||
|
|
|
|||
|
|
@ -677,7 +677,7 @@ object Tasks {
|
|||
startRes
|
||||
.process
|
||||
.run(fetch, maxIterations)
|
||||
.attemptRun
|
||||
.unsafePerformSyncAttempt
|
||||
.leftMap(ex =>
|
||||
ResolutionError.UnknownException(ex)
|
||||
.throwException()
|
||||
|
|
@ -704,17 +704,17 @@ object Tasks {
|
|||
).throwException()
|
||||
}
|
||||
|
||||
if (res.errors.nonEmpty) {
|
||||
if (res.metadataErrors.nonEmpty) {
|
||||
val internalRepositoriesLen = internalRepositories.length
|
||||
val errors =
|
||||
if (repositories.length > internalRepositoriesLen)
|
||||
// drop internal repository errors
|
||||
res.errors.map {
|
||||
res.metadataErrors.map {
|
||||
case (dep, errs) =>
|
||||
dep -> errs.drop(internalRepositoriesLen)
|
||||
}
|
||||
else
|
||||
res.errors
|
||||
res.metadataErrors
|
||||
|
||||
ResolutionError.MetadataDownloadErrors(errors)
|
||||
.throwException()
|
||||
|
|
@ -823,7 +823,7 @@ object Tasks {
|
|||
|
||||
artifactsLogger.init(if (printOptionalMessage) log.info(artifactInitialMessage))
|
||||
|
||||
Task.gatherUnordered(artifactFileOrErrorTasks).attemptRun match {
|
||||
Task.gatherUnordered(artifactFileOrErrorTasks).unsafePerformSyncAttempt match {
|
||||
case -\/(ex) =>
|
||||
ResolutionError.UnknownDownloadException(ex)
|
||||
.throwException()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package coursier.sbtlauncher
|
|||
|
||||
import java.io.File
|
||||
|
||||
import scala.language.existentials
|
||||
|
||||
final case class AppProvider(
|
||||
scalaProvider: xsbti.ScalaProvider,
|
||||
id: xsbti.ApplicationID,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import coursier.ivy.IvyRepository
|
|||
import coursier.maven.MavenSource
|
||||
|
||||
import scala.annotation.tailrec
|
||||
import scala.language.reflectiveCalls
|
||||
import scalaz.{-\/, \/-}
|
||||
import scalaz.concurrent.Task
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ object ChecksumTests extends TestSuite {
|
|||
sumType,
|
||||
cache,
|
||||
Strategy.DefaultExecutorService
|
||||
).run.run
|
||||
).run.unsafePerformSync
|
||||
|
||||
def artifact(url: String) = Artifact(
|
||||
url,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ package object compatibility {
|
|||
implicit val executionContext = scala.concurrent.ExecutionContext.global
|
||||
|
||||
implicit class TaskExtensions[T](val underlying: Task[T]) extends AnyVal {
|
||||
def runF: Future[T] = Future.successful(underlying.run)
|
||||
def runF: Future[T] = Future.successful(underlying.unsafePerformSync)
|
||||
}
|
||||
|
||||
def textResource(path: String)(implicit ec: ExecutionContext): Future[String] = Future {
|
||||
|
|
|
|||
Loading…
Reference in New Issue