Skip to content

Commit bd06fad

Browse files
committed
update java.class.path with wildcard-expanded classpath, for called script
1 parent 8efca1d commit bd06fad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/src/dotty/tools/scripting/Main.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ object Main:
3333
val (compilerArgs, scriptFile, scriptArgs, saveJar, invokeFlag) = distinguishArgs(args)
3434
val driver = ScriptingDriver(compilerArgs, scriptFile, scriptArgs)
3535
try driver.compileAndRun { (outDir:Path, classpathEntries:Seq[Path], mainClass: String) =>
36+
// write expanded classpath to java.class.path property, so called script can see it
37+
sys.props("java.class.path") = classpathEntries.map(_.toString).mkString(pathsep)
3638
if saveJar then
3739
// write a standalone jar to the script parent directory
3840
writeJarfile(outDir, scriptFile, scriptArgs, classpathEntries, mainClass)

0 commit comments

Comments
 (0)