@@ -18,14 +18,10 @@ class ScalaDoc {
18
18
val versionMsg = " Scaladoc %s -- %s" .format(Properties .versionString, Properties .copyrightString)
19
19
20
20
def process (args : Array [String ]): Boolean = {
21
- var reporter : ConsoleReporter = null
21
+ var reporter : ScalaDocReporter = null
22
22
val docSettings = new doc.Settings (msg => reporter.error(FakePos (" scaladoc" ), msg + " \n scaladoc -help gives more information" ),
23
23
msg => reporter.printMessage(msg))
24
- reporter = new ConsoleReporter (docSettings) {
25
- // need to do this so that the Global instance doesn't trash all the
26
- // symbols just because there was an error
27
- override def hasErrors = false
28
- }
24
+ reporter = new ScalaDocReporter (docSettings)
29
25
val command = new ScalaDoc .Command (args.toList, docSettings)
30
26
def hasFiles = command.files.nonEmpty || docSettings.uncompilableFiles.nonEmpty
31
27
@@ -50,12 +46,18 @@ class ScalaDoc {
50
46
}
51
47
finally reporter.printSummary()
52
48
53
- // not much point in returning !reporter.hasErrors when it has
54
- // been overridden with constant false.
55
- true
49
+ ! reporter.reallyHasErrors
56
50
}
57
51
}
58
52
53
+ class ScalaDocReporter (settings : Settings ) extends ConsoleReporter (settings) {
54
+
55
+ // need to do sometimes lie so that the Global instance doesn't
56
+ // trash all the symbols just because there was an error
57
+ override def hasErrors = false
58
+ def reallyHasErrors = super .hasErrors
59
+ }
60
+
59
61
object ScalaDoc extends ScalaDoc {
60
62
class Command (arguments : List [String ], settings : doc.Settings ) extends CompilerCommand (arguments, settings) {
61
63
override def cmdName = " scaladoc"
0 commit comments