Skip to content

Commit 459652c

Browse files
committed
Change definition of repl in Build.scala
1 parent f89e618 commit 459652c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

project/Build.scala

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,6 @@ object Build {
391391
)
392392
}.evaluated,
393393

394-
repl := run.evaluated,
395-
396394
javaOptions ++= (javaOptions in `dotty-compiler`).value,
397395
fork in run := true,
398396
fork in Test := true,
@@ -581,6 +579,20 @@ object Build {
581579
}.evaluated,
582580
dotc := run.evaluated,
583581

582+
repl := Def.inputTaskDyn {
583+
val dottyLib = packageAll.value("dotty-library")
584+
val args: Seq[String] = spaceDelimited("<arg>").parsed
585+
586+
val fullArgs = args.span(_ != "-classpath") match {
587+
case (beforeCp, Nil) => beforeCp ++ ("-classpath" :: dottyLib :: Nil)
588+
case (beforeCp, rest) => beforeCp ++ rest
589+
}
590+
591+
(runMain in Compile).toTask(
592+
s" dotty.tools.repl.Main " + fullArgs.mkString(" ")
593+
)
594+
}.evaluated,
595+
584596
// enable verbose exception messages for JUnit
585597
testOptions in Test += Tests.Argument(
586598
TestFrameworks.JUnit, "-a", "-v",

0 commit comments

Comments
 (0)