mirror of https://github.com/sbt/sbt.git
taking care of deprecations removed in Scala master
This commit is contained in:
parent
f95c45f76e
commit
c6a3b352c4
|
|
@ -33,13 +33,14 @@ object Credentials
|
|||
case Right(dc) => dc
|
||||
}
|
||||
}
|
||||
|
||||
def loadCredentials(path: File): Either[String, DirectCredentials] =
|
||||
if(path.exists)
|
||||
{
|
||||
val properties = read(path)
|
||||
def get(keys: List[String]) = keys.flatMap(properties.get).headOption.toRight(keys.head + " not specified in credentials file: " + path)
|
||||
|
||||
List.separate( List(RealmKeys, HostKeys, UserKeys, PasswordKeys).map(get) ) match
|
||||
IvyUtil.separate( List(RealmKeys, HostKeys, UserKeys, PasswordKeys).map(get) ) match
|
||||
{
|
||||
case (Nil, List(realm, host, user, pass)) => Right( new DirectCredentials(realm, host, user, pass) )
|
||||
case (errors, _) => Left(errors.mkString("\n"))
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ private object IvySbt
|
|||
private[sbt] def javaMap(m: Map[String,String], unqualify: Boolean = false) =
|
||||
{
|
||||
val map = if(unqualify) m map { case (k, v) => (k.stripPrefix("e:"), v) } else m
|
||||
if(map.isEmpty) null else scala.collection.JavaConversions.asJavaMap(map)
|
||||
if(map.isEmpty) null else scala.collection.JavaConversions.mapAsJavaMap(map)
|
||||
}
|
||||
|
||||
private object javaMap
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
package sbt
|
||||
|
||||
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))
|
||||
}
|
||||
|
|
@ -237,7 +237,7 @@ class MakePom(val log: Logger)
|
|||
def exclusions(dependency: DependencyDescriptor): NodeSeq =
|
||||
{
|
||||
val excl = dependency.getExcludeRules(dependency.getModuleConfigurations)
|
||||
val (warns, excls) = List.separate(excl.map(makeExclusion))
|
||||
val (warns, excls) = IvyUtil.separate(excl.map(makeExclusion))
|
||||
if(!warns.isEmpty) log.warn(warns.mkString(IO.Newline))
|
||||
if(!excls.isEmpty) <exclusions>{excls}</exclusions>
|
||||
else NodeSeq.Empty
|
||||
|
|
|
|||
Loading…
Reference in New Issue