mirror of https://github.com/sbt/sbt.git
Remove some compile warnings
This commit is contained in:
parent
d6f0924689
commit
92cc7c4cb1
|
|
@ -21,7 +21,6 @@ import sbt.util.{ Logger, ShowLines }
|
|||
import sbt.internal.util.{ SourcePosition, LinePosition, RangePosition, LineRange }
|
||||
import sbt.librarymanagement._
|
||||
import sbt.internal.librarymanagement.syntax._
|
||||
import sbt.internal.librarymanagement._
|
||||
|
||||
final class DeliverConfiguration(val deliverIvyPattern: String, val status: String, val configurations: Option[Vector[Configuration]], val logging: UpdateLogging)
|
||||
final class PublishConfiguration(val ivyFile: Option[File], val resolverName: String, val artifacts: Map[Artifact, File], val checksums: Vector[String], val logging: UpdateLogging,
|
||||
|
|
|
|||
|
|
@ -123,13 +123,13 @@ private[sbt] class CachedResolutionResolveCache(fileToStore: File => CacheStore)
|
|||
}
|
||||
def extractOverrides(md0: ModuleDescriptor): Vector[IvyOverride] =
|
||||
{
|
||||
import scala.collection.JavaConversions._
|
||||
(md0.getAllDependencyDescriptorMediators.getAllRules).toSeq.toVector sortBy {
|
||||
import scala.collection.JavaConverters._
|
||||
md0.getAllDependencyDescriptorMediators.getAllRules.asScala.toSeq.toVector sortBy {
|
||||
case (k, v) =>
|
||||
k.toString
|
||||
} collect {
|
||||
case (k: MapMatcher, v: OverrideDependencyDescriptorMediator) =>
|
||||
val attr: Map[Any, Any] = k.getAttributes.toMap
|
||||
val attr: Map[Any, Any] = k.getAttributes.asScala.toMap
|
||||
val module = IvyModuleId.newInstance(attr(IvyPatternHelper.ORGANISATION_KEY).toString, attr(IvyPatternHelper.MODULE_KEY).toString)
|
||||
val pm = k.getPatternMatcher
|
||||
IvyOverride(module, pm, v)
|
||||
|
|
|
|||
|
|
@ -58,12 +58,12 @@ object Credentials {
|
|||
private[this] val UserKeys = List("user", "user.name", "username")
|
||||
private[this] val PasswordKeys = List("password", "pwd", "pass", "passwd")
|
||||
|
||||
import collection.JavaConversions._
|
||||
import collection.JavaConverters._
|
||||
private[this] def read(from: File): Map[String, String] =
|
||||
{
|
||||
val properties = new java.util.Properties
|
||||
IO.load(properties, from)
|
||||
properties.map { case (k, v) => (k.toString, v.toString.trim) }.toMap
|
||||
properties.asScala.map { case (k, v) => (k.toString, v.toString.trim) }.toMap
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package sbt
|
|||
package librarymanagement
|
||||
|
||||
import java.io.File
|
||||
import scala.util.Try
|
||||
import sbt.internal.librarymanagement._
|
||||
import sbt.util.Logger
|
||||
import sbt.io.Hash
|
||||
|
|
@ -61,7 +60,7 @@ class DefaultLibraryManagement(ivyConfiguration: IvyConfiguration, log: Logger)
|
|||
log.debug(s"Attempting to fetch ${dependenciesNames(module)}. This operation may fail.")
|
||||
IvyActions.updateEither(module, updateConfiguration, UnresolvedWarningConfiguration(), LogicalClock.unknown, None, log) match {
|
||||
case Left(unresolvedWarning) =>
|
||||
log.debug("Couldn't retrieve module ${dependenciesNames(module)}.")
|
||||
log.debug(s"Couldn't retrieve module ${dependenciesNames(module)}.")
|
||||
None
|
||||
|
||||
case Right(updateReport) =>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import java.io.File
|
|||
import sbt.internal._, librarymanagement._, util.UnitSpec
|
||||
import scala.json.ast.unsafe._
|
||||
import sjsonnew._, support.scalajson.unsafe._
|
||||
import org.scalatest.Assertion
|
||||
|
||||
import LibraryManagementCodec._
|
||||
|
||||
|
|
@ -61,11 +62,13 @@ class DMSerializationSpec extends UnitSpec {
|
|||
lazy val moduleReportExample =
|
||||
ModuleReport(ModuleID("org", "name", "1.0"), Vector.empty, Vector.empty)
|
||||
|
||||
def roundtrip[A: JsonReader: JsonWriter](a: A): Unit =
|
||||
def roundtrip[A: JsonReader: JsonWriter](a: A): Assertion =
|
||||
roundtripBuilder(a) { _ shouldBe _ }
|
||||
def roundtripStr[A: JsonReader: JsonWriter](a: A): Unit =
|
||||
|
||||
def roundtripStr[A: JsonReader: JsonWriter](a: A): Assertion =
|
||||
roundtripBuilder(a) { _.toString shouldBe _.toString }
|
||||
def roundtripBuilder[A: JsonReader: JsonWriter](a: A)(f: (A, A) => Unit): Unit =
|
||||
|
||||
def roundtripBuilder[A: JsonReader: JsonWriter](a: A)(f: (A, A) => Assertion): Assertion =
|
||||
{
|
||||
val json = isoString to (Converter toJsonUnsafe a)
|
||||
println(json)
|
||||
|
|
|
|||
Loading…
Reference in New Issue