Remove some deprecations and redundant code

This commit is contained in:
Indrajit Raychaudhuri 2011-08-05 13:16:49 +05:30
parent 8f519a21c0
commit bb75b74eb6
6 changed files with 6 additions and 15 deletions

View File

@ -37,7 +37,7 @@ object Credentials
if(path.exists)
{
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
{

View File

@ -126,7 +126,7 @@ object EvaluateConfigurations
}
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 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)

View File

@ -128,7 +128,7 @@ object LaunchProguard
private def jlineFilter = "(!META-INF/**)"
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) =
{
val name = file.getName

View File

@ -12,16 +12,7 @@ object Status
commands += stampVersion
)
def stampVersion = Command.command("stamp-version") { 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)
Project.extract(state).append((version in ThisBuild ~= stamp) :: Nil, state)
}
def stamp(v: String): String =
if(v endsWith Snapshot)

View File

@ -24,7 +24,7 @@ final class ScriptedTests(resourceBaseDirectory: File, bufferLog: Boolean, sbtVe
import Path._
import GlobFilter._
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 n = nme.getName
println("Running " + g + " / " + n)

View File

@ -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)
def doInit {}
def startGroup(name: String) { succeeded removeKey name }
def startGroup(name: String) { succeeded remove name }
def testEvent(event: TestEvent) {}
def endGroup(name: String, t: Throwable) {}
def endGroup(name: String, result: Result.Value)