Skip to content

Commit 0155804

Browse files
Merge pull request #3498 from dotty-staging/fix-#3436
Fix #3496: Insert classpath before other arguments
2 parents b95e71a + 6a7c491 commit 0155804

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ object Build {
635635
def insertClasspathInArgs(args: List[String], cp: String): List[String] = {
636636
val (beforeCp, fromCp) = args.span(_ != "-classpath")
637637
val classpath = fromCp.drop(1).headOption.fold(cp)(_ + ":" + cp)
638-
beforeCp ::: "-classpath" :: classpath :: fromCp.drop(2)
638+
"-classpath" :: classpath :: beforeCp ::: fromCp.drop(2)
639639
}
640640

641641
lazy val nonBootstrapedDottyCompilerSettings = commonDottyCompilerSettings ++ Seq(

project/scripts/sbtTests

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
echo "testing sbt dotc and dotr"
88
mkdir out/scriptedtest0
99
./project/scripts/sbt ";dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest0 ;dotr -classpath out/scriptedtest0 dotrtest.Test" > sbtdotr1.out
10+
cat sbtdotr1.out
1011
if grep -e "dotr test ok" sbtdotr1.out; then
1112
echo "output ok"
1213
else
@@ -18,8 +19,18 @@ echo "testing sbt dotc -tasty and dotr -classpath"
1819
mkdir out/scriptedtest1
1920
mkdir out/scriptedtest2
2021
./project/scripts/sbt ";dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest1/; dotc -tasty -classpath out/scriptedtest1/ -d out/scriptedtest2/ dotrtest.Test; dotr -classpath out/scriptedtest2/ dotrtest.Test" > sbtdotr2.out
22+
cat sbtdotr2.out
2123
if grep -e "dotr test ok" sbtdotr2.out; then
2224
echo "output ok"
2325
else
2426
exit -1
2527
fi
28+
echo "testing sbt dotr with no -classpath"
29+
30+
./project/scripts/sbt ";dotc tests/pos/sbtDotrTest.scala; dotr dotrtest.Test" > sbtdotp1.out
31+
cat sbtdotp1.out
32+
if grep -e "dotr test ok" sbtdotp1.out; then
33+
echo "output ok"
34+
else
35+
exit -1
36+
fi

0 commit comments

Comments
 (0)