@@ -4,12 +4,11 @@ package dottydoc
44import dotty .tools .dottydoc .util .syntax ._
55import core .ContextDottydoc
66import dotc .core .Contexts ._
7+ import dotc .reporting .Reporter
78import dotc .{ Compiler , Driver }
8- import model .Package
99import dotc .config ._
1010import dotc .core .Comments .ContextDoc
1111import staticsite .Site
12- import dotc .printing .Highlighting ._
1312
1413/** `DocDriver` implements the main entry point to the Dotty documentation
1514 * tool. It's methods are used by the external scala and java APIs.
@@ -33,16 +32,12 @@ class DocDriver extends Driver {
3332
3433 override def newCompiler (implicit ctx : Context ): Compiler = new DocCompiler
3534
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)
3937
40- ctx.docbase.packages
41- }
38+ implicit val ctx : Context = ictx
39+ val reporter = doCompile(newCompiler, filesToDocument)
4240
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)
4641 val siteRoot = new java.io.File (ctx.settings.siteRoot.value)
4742 val projectName = ctx.settings.projectName.value
4843 val projectVersion = ctx.settings.projectVersion.value
@@ -60,7 +55,8 @@ class DocDriver extends Driver {
6055 .generateBlog()
6156
6257 ctx.docbase.printSummary()
63- System .exit(if (reporter.hasErrors) 1 else 0 )
6458 }
59+
60+ reporter
6561 }
6662}
0 commit comments