Skip to content

Commit 68cc0b7

Browse files
committed
Merge pull request #883 from dotty-staging/add/Main-process
Make it easier to call the compiler using reflection
2 parents c1facd5 + d0c8d9d commit 68cc0b7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/dotty/tools/dotc/Driver.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ abstract class Driver extends DotClass {
4444
doCompile(newCompiler(), fileNames)(ctx)
4545
}
4646

47+
// We overload `process` instead of using a default argument so that we
48+
// can easily call this method using reflection from `RawCompiler` in sbt.
49+
def process(args: Array[String]): Reporter = {
50+
process(args, initCtx)
51+
}
52+
4753
def main(args: Array[String]): Unit =
48-
sys.exit(if (process(args, initCtx).hasErrors) 1 else 0)
54+
sys.exit(if (process(args).hasErrors) 1 else 0)
4955
}
5056

5157
class FatalError(msg: String) extends Exception

0 commit comments

Comments
 (0)