diff --git a/compile/interface/CompilerInterface.scala b/compile/interface/CompilerInterface.scala index cfb191c9c..26a2bc784 100644 --- a/compile/interface/CompilerInterface.scala +++ b/compile/interface/CompilerInterface.scala @@ -60,29 +60,36 @@ class CompilerInterface } class ScaladocInterface { - def run(args: Array[String], maximumErrors: Int, log: Logger) + def run(args: Array[String], maximumErrors: Int, log: Logger) + { + import scala.tools.nsc.{doc, CompilerCommand, Global} + val reporter = new LoggerReporter(maximumErrors, log) + val docSettings: doc.Settings = new doc.Settings(reporter.error) + val command = new CompilerCommand(args.toList, docSettings, error, false) + trait Compat27 { def computeInternalPhases(): Unit = () } + val phasesSet = scala.collection.mutable.Set[scala.tools.nsc.SubComponent]() // for 2.7 source compatibility + object compiler extends Global(command.settings, reporter) with Compat27 { - import scala.tools.nsc.{doc, CompilerCommand, Global} - val reporter = new LoggerReporter(maximumErrors, log) - val docSettings: doc.Settings = new doc.Settings(reporter.error) - val command = new CompilerCommand(args.toList, docSettings, error, false) - object compiler extends Global(command.settings, reporter) - { - override val onlyPresentation = true + override def onlyPresentation = true + override def computeInternalPhases() { + phasesSet += syntaxAnalyzer + phasesSet += analyzer.namerFactory + phasesSet += analyzer.typerFactory } - if(!reporter.hasErrors) - { - val run = new compiler.Run - run compile command.files - val generator = new doc.DefaultDocDriver - { - lazy val global: compiler.type = compiler - lazy val settings = docSettings - } - generator.process(run.units) - } - reporter.printSummary() - if(reporter.hasErrors) throw new InterfaceCompileFailed(args, "Scaladoc generation failed") } + if(!reporter.hasErrors) + { + val run = new compiler.Run + run compile command.files + val generator = new doc.DefaultDocDriver + { + lazy val global: compiler.type = compiler + lazy val settings = docSettings + } + generator.process(run.units) + } + reporter.printSummary() + if(reporter.hasErrors) throw new InterfaceCompileFailed(args, "Scaladoc generation failed") + } } class InterfaceCompileFailed(val arguments: Array[String], override val toString: String) extends xsbti.CompileFailed \ No newline at end of file