This commit is contained in:
Mark Harrah 2013-02-04 17:30:31 -05:00
parent 8cb7e23011
commit c0b1bb51e6
8 changed files with 15 additions and 14 deletions

View File

@ -77,11 +77,11 @@ object Tracked
trait Tracked
{
/** Cleans outputs and clears the cache.*/
def clean: Unit
def clean(): Unit
}
class Timestamp(val cacheFile: File, useStartTime: Boolean) extends Tracked
{
def clean = delete(cacheFile)
def clean() = delete(cacheFile)
/** Reads the previous timestamp, evaluates the provided function,
* and then updates the timestamp if the function completes normally.*/
def apply[T](f: Long => T): T =
@ -99,7 +99,7 @@ class Timestamp(val cacheFile: File, useStartTime: Boolean) extends Tracked
class Changed[O](val cacheFile: File)(implicit equiv: Equiv[O], format: Format[O]) extends Tracked
{
def clean = delete(cacheFile)
def clean() = delete(cacheFile)
def apply[O2](ifChanged: O => O2, ifUnchanged: O => O2): O => O2 = value =>
{
if(uptodate(value))
@ -136,7 +136,7 @@ object Difference
}
class Difference(val cache: File, val style: FilesInfo.Style, val defineClean: Boolean, val filesAreOutputs: Boolean) extends Tracked
{
def clean =
def clean() =
{
if(defineClean) delete(raw(cachedFilesInfo)) else ()
clearCache()

View File

@ -20,7 +20,7 @@ final class Console(compiler: AnalyzingCompiler)
def apply(classpath: Seq[File], options: Seq[String], initialCommands: String, cleanupCommands: String)(loader: Option[ClassLoader], bindings: Seq[(String, Any)])(implicit log: Logger): Option[String] =
{
def console0 = compiler.console(classpath, options, initialCommands, cleanupCommands, log)(loader, bindings)
def console0() = compiler.console(classpath, options, initialCommands, cleanupCommands, log)(loader, bindings)
JLine.withJLine( Run.executeTrapExit(console0, log) )
}
}

View File

@ -23,7 +23,8 @@ object Sbt extends Build
resolvers += Resolver.typesafeIvyRepo("releases"),
concurrentRestrictions in Global += Util.testExclusiveRestriction,
testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial")
javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"),
scalacOptions += "-Xlint"
)
lazy val myProvided = config("provided") intransitive;

View File

@ -46,10 +46,10 @@ class Run(instance: ScalaInstance, trapExit: Boolean, nativeTmp: File) extends S
{
log.info("Running " + mainClass + " " + options.mkString(" "))
def execute =
def execute() =
try { run0(mainClass, classpath, options, log) }
catch { case e: java.lang.reflect.InvocationTargetException => throw e.getCause }
def directExecute = try { execute; None } catch { case e: Exception => log.trace(e); Some(e.toString) }
def directExecute() = try { execute; None } catch { case e: Exception => log.trace(e); Some(e.toString) }
if(trapExit) Run.executeTrapExit( execute, log ) else directExecute
}

View File

@ -29,7 +29,7 @@ object TrapExit
* the threads that were created by 'execute'.*/
val originalThreads = allThreads
val code = new ExitCode
def executeMain =
def executeMain() =
try { execute }
catch
{
@ -235,7 +235,7 @@ private final class TrapExitSecurityManager(delegateManager: SecurityManager, gr
private final class TrapExitSecurityException(val exitCode: Int) extends SecurityException
{
private var accessAllowed = false
def allowAccess
def allowAccess()
{
accessAllowed = true
}

View File

@ -130,7 +130,7 @@ object Parser extends ParserMain
if(!bad.isEmpty) error("Invalid example completions: " + bad.mkString("'", "', '", "'"))
}
def tuple[A,B](a: Option[A], b: Option[B]): Option[(A,B)] =
(a,b) match { case (Some(av), Some(bv)) => Some(av, bv); case _ => None }
(a,b) match { case (Some(av), Some(bv)) => Some((av, bv)); case _ => None }
def mapParser[A,B](a: Parser[A], f: A => B): Parser[B] =
a.ifValid {

View File

@ -49,7 +49,7 @@ object CrossVersionUtil
private[${{cross.package0}}] val PartialVersion = """(\d+)\.(\d+)(?:\..+)?""".r
private[${{cross.package0}}] def partialVersion(s: String): Option[(Int,Int)] =
s match {
case PartialVersion(major, minor) => Some(major.toInt, minor.toInt)
case PartialVersion(major, minor) => Some((major.toInt, minor.toInt))
case _ => None
}
def binaryScalaVersion(full: String): String = binaryVersionWithApi(full, TransitionScalaVersion)(scalaApiVersion)

View File

@ -28,7 +28,7 @@ private object Future
def apply[T](f: => T): () => T =
{
val result = new SyncVar[Either[Throwable, T]]
def run: Unit =
def run(): Unit =
try { result.set(Right(f)) }
catch { case e: Exception => result.set(Left(e)) }
Spawn(run)
@ -100,7 +100,7 @@ object BasicIO
{
val continueCount = 1//if(in.isInstanceOf[PipedInputStream]) 1 else 0
val buffer = new Array[Byte](BufferSize)
def read
def read()
{
val byteCount = in.read(buffer)
if(byteCount >= continueCount)