Skip to content

Commit e2cf945

Browse files
committed
Simplify compiler classpath for dotr
1 parent 000f26f commit e2cf945

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

compiler/src/dotty/tools/dotc/quoted/QuoteDriver.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,8 @@ class QuoteDriver extends Driver {
5050

5151
override def initCtx: Context = {
5252
val ictx = super.initCtx.fresh
53-
val compilerClasspath = System.getProperty("dotty.tools.dotc.classpath")
54-
assert(compilerClasspath ne null, "System property `dotty.tools.dotc.classpath` is not set.")
5553
val classpath = System.getProperty("java.class.path")
56-
val scalaLib = classpath.split(":").filter(_.contains("scala-library")).mkString(":")
57-
ictx.settings.classpath.update(compilerClasspath + ":" + scalaLib)(ictx)
54+
ictx.settings.classpath.update(classpath)(ictx)
5855
ictx
5956
}
6057

compiler/test/dotty/tools/vulpix/ChildJVMMain.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ public class ChildJVMMain {
1212
static final String MessageEnd = "##THIS IS THE END FOR ME, GOODBYE##";
1313

1414
private static void runMain(String dir) throws Exception {
15-
System.setProperty("dotty.tools.dotc.classpath", dir);
15+
String jcp = System.getProperty("java.class.path");
16+
System.setProperty("java.class.path", jcp == null ? dir : dir + ":" + jcp);
17+
1618
ArrayList<URL> cp = new ArrayList<>();
1719
for (String path : dir.split(":"))
1820
cp.add(new File(path).toURI().toURL());

dist/bin/dotr

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ fi
3030
source "$PROG_HOME/bin/common"
3131

3232
declare -a residual_args
33-
declare -a system_properties
3433
run_repl=false
3534
with_compiler=false
3635
CLASS_PATH=""
@@ -77,7 +76,6 @@ else
7776
fi
7877
if [ $with_compiler == true ]; then
7978
cp_arg+="$PSEP$DOTTY_COMP$PSEP$DOTTY_INTF$PSEP$SCALA_ASM"
80-
system_properties+=("-Ddotty.tools.dotc.classpath=$DOTTY_COMP$PSEP$DOTTY_LIB$PSEP$DOTTY_INTF$PSEP$SCALA_ASM")
8179
fi
82-
eval exec "\"$JAVACMD\"" "$DEBUG" "-classpath \"$cp_arg\"" "${system_properties[@]}" "${residual_args[@]}"
80+
eval exec "\"$JAVACMD\"" "$DEBUG" "-classpath \"$cp_arg\"" "${residual_args[@]}"
8381
fi

project/Build.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,7 @@ object Build {
596596
val asm = findLib("scala-asm")
597597
val dottyCompiler = packageAll.value("dotty-compiler")
598598
val dottyInterfaces = packageAll.value("dotty-interfaces")
599-
val deps = s"$dottyCompiler:$dottyInterfaces:$asm"
600-
val args2 = s"-Ddotty.tools.dotc.classpath=$deps:$dottyLib" :: insertClasspathInArgs(args1, deps)
601-
run(args2)
599+
run(insertClasspathInArgs(args1, s"$dottyCompiler:$dottyInterfaces:$asm"))
602600
} else run(args)
603601
},
604602
run := dotc.evaluated,

0 commit comments

Comments
 (0)