diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-10-29 12:21:34 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2015-10-29 12:21:34 +0100 |
commit | 68cc0b7b97a7e439b01f732a94c11a119faade7c (patch) | |
tree | a78c259605a0e2322784061eb168a8a5d8109603 | |
parent | c1facd5c40fa7208d7549e6727e6e7498d4d3f34 (diff) | |
parent | d0c8d9d9df5d51269ee4f4577ba996d1a58b8e4d (diff) | |
download | dotty-68cc0b7b97a7e439b01f732a94c11a119faade7c.tar.gz dotty-68cc0b7b97a7e439b01f732a94c11a119faade7c.tar.bz2 dotty-68cc0b7b97a7e439b01f732a94c11a119faade7c.zip |
Merge pull request #883 from dotty-staging/add/Main-process
Make it easier to call the compiler using reflection
-rw-r--r-- | src/dotty/tools/dotc/Driver.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/Driver.scala b/src/dotty/tools/dotc/Driver.scala index 24effb59d..3b382da58 100644 --- a/src/dotty/tools/dotc/Driver.scala +++ b/src/dotty/tools/dotc/Driver.scala @@ -44,8 +44,14 @@ abstract class Driver extends DotClass { doCompile(newCompiler(), fileNames)(ctx) } + // We overload `process` instead of using a default argument so that we + // can easily call this method using reflection from `RawCompiler` in sbt. + def process(args: Array[String]): Reporter = { + process(args, initCtx) + } + def main(args: Array[String]): Unit = - sys.exit(if (process(args, initCtx).hasErrors) 1 else 0) + sys.exit(if (process(args).hasErrors) 1 else 0) } class FatalError(msg: String) extends Exception |