summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-10-07 22:57:22 +0200
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-10-07 22:57:22 +0200
commitc038732f1b302dd128b32512aab4cf0826752599 (patch)
treea459a05997b1b6375b84434f3dbe3ab1ae3609fb /src
parent75886dc44366470fb3221aaf4de35e9de9e71a1d (diff)
parent5f29a264469b6ae161d9a98fe76d3f6466d82b12 (diff)
downloadscala-c038732f1b302dd128b32512aab4cf0826752599.tar.gz
scala-c038732f1b302dd128b32512aab4cf0826752599.tar.bz2
scala-c038732f1b302dd128b32512aab4cf0826752599.zip
Merge pull request #4032 from dturner-tw/dturner/scaldoc-exit-code
Make Scaladoc actually exit with non-zero exit code in case of errors, as its docs say it does
Diffstat (limited to 'src')
-rw-r--r--src/scaladoc/scala/tools/nsc/ScalaDoc.scala20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/scaladoc/scala/tools/nsc/ScalaDoc.scala b/src/scaladoc/scala/tools/nsc/ScalaDoc.scala
index 52a0c20a11..32a6ba0ce3 100644
--- a/src/scaladoc/scala/tools/nsc/ScalaDoc.scala
+++ b/src/scaladoc/scala/tools/nsc/ScalaDoc.scala
@@ -18,14 +18,10 @@ class ScalaDoc {
val versionMsg = "Scaladoc %s -- %s".format(Properties.versionString, Properties.copyrightString)
def process(args: Array[String]): Boolean = {
- var reporter: ConsoleReporter = null
+ var reporter: ScalaDocReporter = null
val docSettings = new doc.Settings(msg => reporter.error(FakePos("scaladoc"), msg + "\n scaladoc -help gives more information"),
msg => reporter.printMessage(msg))
- reporter = new ConsoleReporter(docSettings) {
- // need to do this so that the Global instance doesn't trash all the
- // symbols just because there was an error
- override def hasErrors = false
- }
+ reporter = new ScalaDocReporter(docSettings)
val command = new ScalaDoc.Command(args.toList, docSettings)
def hasFiles = command.files.nonEmpty || docSettings.uncompilableFiles.nonEmpty
@@ -50,12 +46,18 @@ class ScalaDoc {
}
finally reporter.printSummary()
- // not much point in returning !reporter.hasErrors when it has
- // been overridden with constant false.
- true
+ !reporter.reallyHasErrors
}
}
+class ScalaDocReporter(settings: Settings) extends ConsoleReporter(settings) {
+
+ // need to do sometimes lie so that the Global instance doesn't
+ // trash all the symbols just because there was an error
+ override def hasErrors = false
+ def reallyHasErrors = super.hasErrors
+}
+
object ScalaDoc extends ScalaDoc {
class Command(arguments: List[String], settings: doc.Settings) extends CompilerCommand(arguments, settings) {
override def cmdName = "scaladoc"