diff --git a/compile/interface/CompilerInterface.scala b/compile/interface/CompilerInterface.scala index e73936f6a..04ce28417 100644 --- a/compile/interface/CompilerInterface.scala +++ b/compile/interface/CompilerInterface.scala @@ -5,15 +5,15 @@ package xsbt import xsbti.{AnalysisCallback,Logger} import scala.tools.nsc.{Phase, SubComponent} +import Log.debug class CompilerInterface { def run(args: Array[String], callback: AnalysisCallback, maximumErrors: Int, log: Logger) { - def debug(msg: => String) = log.debug(Message(msg)) import scala.tools.nsc.{CompilerCommand, Global, Settings} - debug("Interfacing (CompilerInterface) with Scala compiler " + scala.tools.nsc.Properties.versionString) + debug(log, "Interfacing (CompilerInterface) with Scala compiler " + scala.tools.nsc.Properties.versionString) val reporter = new LoggerReporter(maximumErrors, log) val settings = new Settings(reporter.error) @@ -76,13 +76,13 @@ class CompilerInterface if(!reporter.hasErrors) { val run = new compiler.Run - debug(args.mkString("Calling Scala compiler with arguments (CompilerInterface):\n\t", "\n\t", "")) + debug(log, args.mkString("Calling Scala compiler with arguments (CompilerInterface):\n\t", "\n\t", "")) run compile command.files } reporter.printSummary() if(reporter.hasErrors) { - debug("Compilation failed (CompilerInterface)") + debug(log, "Compilation failed (CompilerInterface)") throw new InterfaceCompileFailed(args, "Compilation failed") } } diff --git a/compile/interface/Log.scala b/compile/interface/Log.scala new file mode 100644 index 000000000..275eefe4d --- /dev/null +++ b/compile/interface/Log.scala @@ -0,0 +1,9 @@ +/* sbt -- Simple Build Tool + * Copyright 2008, 2009 Mark Harrah + */ +package xsbt + +object Log +{ + def debug(log: xsbti.Logger, msg: => String) = log.debug(Message(msg)) +} \ No newline at end of file diff --git a/compile/interface/RunInterface.scala b/compile/interface/RunInterface.scala index 674941aa3..4f6f39bc6 100644 --- a/compile/interface/RunInterface.scala +++ b/compile/interface/RunInterface.scala @@ -12,8 +12,8 @@ class RunInterface { def run(classpathURLs: Array[URL], mainClass: String, options: Array[String], log: Logger) { - log.info(Message("Running " + mainClass + " ...")) - log.debug(Message(" Classpath:" + classpathURLs.mkString("\n\t", "\n\t",""))) + log.info(Message("Running " + mainClass + " " + options.mkString(" "))) + log.debug(Message(" Classpath:\n\t" + classpathURLs.mkString("\n\t"))) try { ObjectRunner.run(classpathURLs.toList, mainClass, options.toList) } catch { case e: java.lang.reflect.InvocationTargetException => throw e.getCause } } diff --git a/compile/interface/ScaladocInterface.scala b/compile/interface/ScaladocInterface.scala index 04a8ed33f..1b5d5e0f6 100644 --- a/compile/interface/ScaladocInterface.scala +++ b/compile/interface/ScaladocInterface.scala @@ -5,6 +5,7 @@ package xsbt import xsbti.Logger import scala.tools.nsc.SubComponent +import Log.debug class ScaladocInterface { @@ -20,10 +21,11 @@ private class Runner(args: Array[String], maximumErrors: Int, log: Logger) import forScope._ def run() { + debug(log, "Calling Scaladoc with arguments:\n\t" + args.mkString("\n\t")) if(!reporter.hasErrors) { - import doc._ // 2.8 has doc.Processor - val processor = new Processor(reporter, docSettings) + import doc._ // 2.8 trunk and Beta1-RC4 have doc.DocFactory. For other Scala versions, the next line creates forScope.DocFactory + val processor = new DocFactory(reporter, docSettings) processor.document(command.files) } reporter.printSummary() @@ -32,12 +34,12 @@ private class Runner(args: Array[String], maximumErrors: Int, log: Logger) object forScope { - class Processor(reporter: LoggerReporter, docSettings: doc.Settings) // 2.7 compatibility + class DocFactory(reporter: LoggerReporter, docSettings: doc.Settings) // 2.7 compatibility { object compiler extends Global(command.settings, reporter) { override def onlyPresentation = true - class DefaultDocDriver // 2.8 compatibility + class DefaultDocDriver // 2.8 source compatibility { assert(false) def process(units: Iterator[CompilationUnit]) = error("for 2.8 compatibility only")