more flexible scalac logging

the custom scalac Reporter now delegates to an instance of
  an sbt interface called xsbti.Reporter
handling compilation logging is now mainly done on the sbt-side of the
  compiler interface
the xsbti.Reporter interface provides access to richer information
  about errors and warnings, including source file, line, and offset
xsbti.Reporter can be implemented by users to get access to
  detailed information without needing to parse the logging output
the CompileFailed exception that is thrown when compilation fails now
  includes an array of the problems, providing detailed
  error and warning information that can, for example, be consumed
  by doing a mapFailure on 'compile' and using 'Compile.allProblems'
This commit is contained in:
Mark Harrah
2010-10-23 16:34:22 -04:00
parent 5ed8f3c042
commit a76d75bca6
17 changed files with 405 additions and 138 deletions
@@ -0,0 +1,20 @@
/* sbt -- Simple Build Tool
* Copyright 2008, 2009, 2010 Mark Harrah
*/
package xsbti;
public interface Reporter
{
/** Resets logging, including any accumulated errors, warnings, messages, and counts.*/
public void reset();
/** Returns true if this logger has seen any errors since the last call to reset.*/
public boolean hasErrors();
/** Returns true if this logger has seen any warnings since the last call to reset.*/
public boolean hasWarnings();
/** Logs a summary of logging since the last reset.*/
public void printSummary();
/** Returns a list of warnings and errors since the last reset.*/
public Problem[] problems();
/** Logs a message.*/
public void log(Position pos, String msg, Severity sev);
}