@@ -4,12 +4,11 @@ package dottydoc
4
4
import dotty .tools .dottydoc .util .syntax ._
5
5
import core .ContextDottydoc
6
6
import dotc .core .Contexts ._
7
+ import dotc .reporting .Reporter
7
8
import dotc .{ Compiler , Driver }
8
- import model .Package
9
9
import dotc .config ._
10
10
import dotc .core .Comments .ContextDoc
11
11
import staticsite .Site
12
- import dotc .printing .Highlighting ._
13
12
14
13
/** `DocDriver` implements the main entry point to the Dotty documentation
15
14
* tool. It's methods are used by the external scala and java APIs.
@@ -33,16 +32,12 @@ class DocDriver extends Driver {
33
32
34
33
override def newCompiler (implicit ctx : Context ): Compiler = new DocCompiler
35
34
36
- def compiledDocs (args : Array [String ]): collection.Map [String , Package ] = {
37
- val (fileNames, ctx) = setup(args, initCtx.fresh)
38
- doCompile(newCompiler(ctx), fileNames)(ctx)
35
+ override def process (args : Array [String ], rootCtx : Context ): Reporter = {
36
+ val (filesToDocument, ictx) = setup(args, initCtx.fresh)
39
37
40
- ctx.docbase.packages
41
- }
38
+ implicit val ctx : Context = ictx
39
+ val reporter = doCompile(newCompiler, filesToDocument)
42
40
43
- override def main (args : Array [String ]): Unit = {
44
- implicit val (filesToDocument, ctx) = setup(args, initCtx.fresh)
45
- val reporter = doCompile(newCompiler(ctx), filesToDocument)(ctx)
46
41
val siteRoot = new java.io.File (ctx.settings.siteRoot.value)
47
42
val projectName = ctx.settings.projectName.value
48
43
val projectVersion = ctx.settings.projectVersion.value
@@ -60,7 +55,8 @@ class DocDriver extends Driver {
60
55
.generateBlog()
61
56
62
57
ctx.docbase.printSummary()
63
- System .exit(if (reporter.hasErrors) 1 else 0 )
64
58
}
59
+
60
+ reporter
65
61
}
66
62
}
0 commit comments