diff --git a/compile/persist/FileBasedStore.scala b/compile/persist/FileBasedStore.scala index 1b25432a6..c58f791db 100644 --- a/compile/persist/FileBasedStore.scala +++ b/compile/persist/FileBasedStore.scala @@ -4,7 +4,7 @@ package sbt package inc - import java.io.{File, InputStream, IOException} + import java.io.{File, IOException} import sbinary._ import Operations.{read, write} import DefaultProtocol._ @@ -14,19 +14,13 @@ object FileBasedStore { def apply(file: File)(implicit analysisF: Format[Analysis], setupF: Format[CompileSetup]): AnalysisStore = new AnalysisStore { def set(analysis: Analysis, setup: CompileSetup): Unit = - Using.fileOutputStream()(file) { fout => - Using.gzipOutputStream(fout) { outg => - Using.bufferedOutputStream(outg) { out => + IO.gzipFileOut(file) { out => write[(Analysis, CompileSetup)](out, (analysis, setup) ) - }}} + } def get(): Option[(Analysis, CompileSetup)] = try { Some(getUncaught()) } catch { case io: IOException => None } def getUncaught(): (Analysis, CompileSetup) = - Using.fileInputStream(file) { fin => - Using.gzipInputStream(fin) { ing => - Using.bufferedInputStream(ing) { in => - read[(Analysis, CompileSetup)]( in ) - }}} + IO.gzipFileIn(file)( in => read[(Analysis, CompileSetup)](in) ) } } \ No newline at end of file diff --git a/main/ClasspathProject.scala b/main/ClasspathProject.scala index 0c0877bb6..ff91262ad 100644 --- a/main/ClasspathProject.scala +++ b/main/ClasspathProject.scala @@ -183,7 +183,7 @@ object ClasspathProject analyzed(i.config.classesDirectory, analysis) } - def makeProducts(compile: Task[Analysis], inputs: Task[Compile.Inputs], name: String, prefix: String) = + def makeProducts(compile: Task[Analysis], inputs: Task[Compile.Inputs], name: String, prefix: String): Task[Seq[Attributed[File]]] = { def mkName(postfix: String) = name + "/" + prefix + postfix analyzed(compile, inputs) named(mkName("analyzed")) map { _ :: Nil } named(mkName("products")) @@ -265,7 +265,7 @@ object ClasspathProject def missingMapping(from: String, to: String, conf: String) = error("No configuration mapping defined from '" + from + "' to '" + to + "' for '" + conf + "'") def missingConfiguration(in: String, conf: String) = - error("Configuration '" + conf + "' not defined in '" + in) + error("Configuration '" + conf + "' not defined in '" + in + "'") def allConfigs(dep: Project, conf: String): Seq[String] = dep match { case cp: ClasspathProject => Dag.topologicalSort(configuration(cp, conf))(_.extendsConfigs).map(_.name) diff --git a/main/CommandSupport.scala b/main/CommandSupport.scala index 776889266..4d38ff780 100644 --- a/main/CommandSupport.scala +++ b/main/CommandSupport.scala @@ -93,7 +93,7 @@ ProjectCommand + def DefaultsDetailed = "Registers default built-in commands" def ReloadCommand = "reload" - def ReloadBrief = (ReloadCommand, "Reloads the session and continues to execute the remaining commands.") + def ReloadBrief = (ReloadCommand, "Reloads the session and then executes the remaining commands.") def ReloadDetailed = ReloadCommand + """ This command is equivalent to exiting, restarting, and running the @@ -160,7 +160,6 @@ DiscoverSyntax + """ CompileSyntax + """ Incrementally compiles Scala and Java sources. - Java source support is limited at this time. are explicit paths separated by the platform path separator. diff --git a/main/Console.scala b/main/Console.scala index 7f509286d..ffdde21e1 100644 --- a/main/Console.scala +++ b/main/Console.scala @@ -56,15 +56,15 @@ final class Scaladoc(maximumErrors: Int, compiler: AnalyzingCompiler) { log.info(actionStartMessage(label)) if(sources.isEmpty) - log.info(actionNothingToDoMessage) + log.info(ActionNothingToDoMessage) else { IO.createDirectory(outputDirectory) compiler.doc(sources, classpath, outputDirectory, options, maximumErrors, log) - log.info(actionSuccessfulMessage) + log.info(ActionSuccessfulMessage) } } def actionStartMessage(label: String) = "Generating API documentation for " + label + " sources..." - val actionNothingToDoMessage = "No sources specified." - val actionSuccessfulMessage = "API documentation generation successful." + val ActionNothingToDoMessage = "No sources specified." + val ActionSuccessfulMessage = "API documentation generation successful." } \ No newline at end of file diff --git a/util/io/IO.scala b/util/io/IO.scala index 4c7ea9dd4..6b6350237 100644 --- a/util/io/IO.scala +++ b/util/io/IO.scala @@ -569,4 +569,14 @@ object IO delete(a) } } + + def gzipFileOut[T](file: File)(f: OutputStream => T): T = + Using.fileOutputStream()(file) { fout => + Using.gzipOutputStream(fout) { outg => + Using.bufferedOutputStream(outg)(f) }} + + def gzipFileIn[T](file: File)(f: InputStream => T): T = + Using.fileInputStream(file) { fin => + Using.gzipInputStream(fin) { ing => + Using.bufferedInputStream(ing)(f) }} }