Dotty Documentation


abstract class Driver
extends DotClass

Run the Dotty compiler.

Extending this class lets you customize many aspect of the compilation process, but in most cases you only need to call [[process]] on the existing object [[Main]].

[-] Constructors

Driver ( )

[-] Members

[+] protected def doCompile ( compiler: Compiler , fileNames: List [ String ] ) ( implicit ctx: Context ) : Reporter
[+] protected def emptyReporter : Reporter
[+] protected def initCtx : Context
[+] def main ( args: Array [ String ] ) : Unit
[+] protected def newCompiler ( implicit ctx: Context ) : Compiler
[+] final def process ( args: Array [ String ] , simple: SimpleReporter , callback: CompilerCallback ) : ReporterResult

Entry point to the compiler that can be conveniently used with Java reflection.

This entry point can easily be used without depending on the dotty package, you only need to depend on dotty-interfaces and call this method using reflection. This allows you to write code that will work against multiple versions of dotty without recompilation.

The trade-off is that you can only pass a SimpleReporter to this method and not a normal Reporter which is more powerful.

Usage example: [[]]

[+] final def process ( args: Array [ String ] , reporter: Reporter , callback: CompilerCallback ) : Reporter

Principal entry point to the compiler.

Usage example: [[]] in method runCompiler

[+] final def process ( args: Array [ String ] ) : Reporter

Entry point to the compiler with no optional arguments.

This overload is provided for compatibility reasons: the RawCompiler of sbt expects this method to exist and calls it using reflection. Keeping it means that we can change the other overloads without worrying about breaking compatibility with sbt.

[+] def process ( args: Array [ String ] , rootCtx: Context ) : Reporter

Entry point to the compiler using a custom Context.

In most cases, you do not need a custom Context and should instead use one of the other overloads of process. However, the other overloads cannot be overriden, instead you should override this one which they call internally.

Usage example: [[]] in method runCompilerWithContext

[+] def setup ( args: Array [ String ] , rootCtx: Context ) : ( List [ String ], Context )
[+] protected def sourcesRequired : Boolean