Skip to content

Commit 3601214

Browse files
authored
Merge pull request #3026 from dotty-staging/fix-3024
Fix #3024: repl alias in sbt and `dist/bin/dotr` not working
2 parents 770a2f7 + 8534d69 commit 3601214

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

dist/bin/dotc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ bootcp=true
3232

3333
CompilerMain=dotty.tools.dotc.Main
3434
FromTasty=dotty.tools.dotc.FromTasty
35-
ReplMain=dotty.tools.dotc.repl.Main
35+
ReplMain=dotty.tools.repl.Main
3636

3737
PROG_NAME=$CompilerMain
3838

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)