mirror of https://github.com/sbt/sbt.git
* move Environment classes to util/env module
* move TrapExit, SelectMainClass to run module * rearrange some compilation-related code * Jetty-related code moved to web module
This commit is contained in:
parent
68da4c8ae5
commit
d4965daf2a
|
|
@ -365,41 +365,4 @@ object ModuleConfiguration
|
|||
{
|
||||
def apply(org: String, resolver: Resolver): ModuleConfiguration = apply(org, "*", "*", resolver)
|
||||
def apply(org: String, name: String, resolver: Resolver): ModuleConfiguration = ModuleConfiguration(org, name, "*", resolver)
|
||||
}
|
||||
/*
|
||||
object Credentials
|
||||
{
|
||||
/** Add the provided credentials to Ivy's credentials cache.*/
|
||||
def add(realm: String, host: String, userName: String, passwd: String): Unit =
|
||||
CredentialsStore.INSTANCE.addCredentials(realm, host, userName, passwd)
|
||||
/** Load credentials from the given file into Ivy's credentials cache.*/
|
||||
def apply(file: String, log: Logger): Unit = apply(Path.fromFile(file), log)
|
||||
/** Load credentials from the given file into Ivy's credentials cache.*/
|
||||
def apply(file: File, log: Logger): Unit = apply(Path.fromFile(file), log)
|
||||
/** Load credentials from the given file into Ivy's credentials cache.*/
|
||||
def apply(path: Path, log: Logger)
|
||||
{
|
||||
val msg =
|
||||
if(path.exists)
|
||||
{
|
||||
val properties = new scala.collection.mutable.HashMap[String, String]
|
||||
def get(keys: List[String]) = keys.flatMap(properties.get).firstOption.toRight(keys.head + " not specified in credentials file: " + path)
|
||||
|
||||
impl.MapUtilities.read(properties, path, log) orElse
|
||||
{
|
||||
List.separate( List(RealmKeys, HostKeys, UserKeys, PasswordKeys).map(get) ) match
|
||||
{
|
||||
case (Nil, List(realm, host, user, pass)) => add(realm, host, user, pass); None
|
||||
case (errors, _) => Some(errors.mkString("\n"))
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
Some("Credentials file " + path + " does not exist")
|
||||
msg.foreach(x => log.warn(x))
|
||||
}
|
||||
private[this] val RealmKeys = List("realm")
|
||||
private[this] val HostKeys = List("host", "hostname")
|
||||
private[this] val UserKeys = List("user", "user.name", "username")
|
||||
private[this] val PasswordKeys = List("password", "pwd", "pass", "passwd")
|
||||
}*/
|
||||
}
|
||||
Loading…
Reference in New Issue