mirror of https://github.com/sbt/sbt.git
Remove some deprecations and redundant code
This commit is contained in:
parent
8f519a21c0
commit
bb75b74eb6
|
|
@ -37,7 +37,7 @@ object Credentials
|
||||||
if(path.exists)
|
if(path.exists)
|
||||||
{
|
{
|
||||||
val properties = read(path)
|
val properties = read(path)
|
||||||
def get(keys: List[String]) = keys.flatMap(properties.get).firstOption.toRight(keys.head + " not specified in credentials file: " + 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
|
List.separate( List(RealmKeys, HostKeys, UserKeys, PasswordKeys).map(get) ) match
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ object EvaluateConfigurations
|
||||||
}
|
}
|
||||||
loader => result.getValue(loader).asInstanceOf[Project.SettingsDefinition].settings
|
loader => result.getValue(loader).asInstanceOf[Project.SettingsDefinition].settings
|
||||||
}
|
}
|
||||||
private[this] def isSpace = (c: Char) => Character isSpace c
|
private[this] def isSpace = (c: Char) => Character isWhitespace c
|
||||||
private[this] def fstS(f: String => Boolean): ((String,Int)) => Boolean = { case (s,i) => f(s) }
|
private[this] def fstS(f: String => Boolean): ((String,Int)) => Boolean = { case (s,i) => f(s) }
|
||||||
private[this] def firstNonSpaceIs(lit: String) = (_: String).view.dropWhile(isSpace).startsWith(lit)
|
private[this] def firstNonSpaceIs(lit: String) = (_: String).view.dropWhile(isSpace).startsWith(lit)
|
||||||
private[this] def or[A](a: A => Boolean, b: A => Boolean): A => Boolean = in => a(in) || b(in)
|
private[this] def or[A](a: A => Boolean, b: A => Boolean): A => Boolean = in => a(in) || b(in)
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ object LaunchProguard
|
||||||
private def jlineFilter = "(!META-INF/**)"
|
private def jlineFilter = "(!META-INF/**)"
|
||||||
private def generalFilter = "(!META-INF/**,!*.properties)"
|
private def generalFilter = "(!META-INF/**,!*.properties)"
|
||||||
|
|
||||||
private def withJar[T](files: Seq[File], name: String) = mkpath(files.firstOption getOrElse error(name + " not present") )
|
private def withJar[T](files: Seq[File], name: String) = mkpath(files.headOption getOrElse error(name + " not present") )
|
||||||
private def isJarX(x: String)(file: File) =
|
private def isJarX(x: String)(file: File) =
|
||||||
{
|
{
|
||||||
val name = file.getName
|
val name = file.getName
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,7 @@ object Status
|
||||||
commands += stampVersion
|
commands += stampVersion
|
||||||
)
|
)
|
||||||
def stampVersion = Command.command("stamp-version") { state =>
|
def stampVersion = Command.command("stamp-version") { state =>
|
||||||
append((version in ThisBuild ~= stamp) :: Nil, state)
|
Project.extract(state).append((version in ThisBuild ~= stamp) :: Nil, state)
|
||||||
}
|
|
||||||
// TODO: replace with extracted.append from 0.10.1
|
|
||||||
def append(settings: Seq[Setting[_]], state: State): State =
|
|
||||||
{
|
|
||||||
val extracted = Project.extract(state)
|
|
||||||
import extracted._
|
|
||||||
val append = Load.transformSettings(Load.projectScope(currentRef), currentRef.build, rootProject, settings)
|
|
||||||
val newStructure = Load.reapply(session.original ++ append, structure)
|
|
||||||
Project.setProject(session, newStructure, state)
|
|
||||||
}
|
}
|
||||||
def stamp(v: String): String =
|
def stamp(v: String): String =
|
||||||
if(v endsWith Snapshot)
|
if(v endsWith Snapshot)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ final class ScriptedTests(resourceBaseDirectory: File, bufferLog: Boolean, sbtVe
|
||||||
import Path._
|
import Path._
|
||||||
import GlobFilter._
|
import GlobFilter._
|
||||||
var failed = false
|
var failed = false
|
||||||
for(groupDir <- (resourceBaseDirectory * group).getFiles; nme <- (groupDir * name).getFiles ) {
|
for(groupDir <- (resourceBaseDirectory * group).get; nme <- (groupDir * name).get ) {
|
||||||
val g = groupDir.getName
|
val g = groupDir.getName
|
||||||
val n = nme.getName
|
val n = nme.getName
|
||||||
println("Running " + g + " / " + n)
|
println("Running " + g + " / " + n)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ private[sbt] class TestStatusReporter(path: Path, log: Logger) extends TestsList
|
||||||
private lazy val succeeded: Map[String, Long] = TestStatus.read(path, log)
|
private lazy val succeeded: Map[String, Long] = TestStatus.read(path, log)
|
||||||
|
|
||||||
def doInit {}
|
def doInit {}
|
||||||
def startGroup(name: String) { succeeded removeKey name }
|
def startGroup(name: String) { succeeded remove name }
|
||||||
def testEvent(event: TestEvent) {}
|
def testEvent(event: TestEvent) {}
|
||||||
def endGroup(name: String, t: Throwable) {}
|
def endGroup(name: String, t: Throwable) {}
|
||||||
def endGroup(name: String, result: Result.Value)
|
def endGroup(name: String, result: Result.Value)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue