diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8a2c1728496d..4fd39854ba86 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -181,7 +181,7 @@ jobs: uses: actions/checkout@v2 - name: Test - run: sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test" + run: sbt ";dist/pack ;scala3-bootstrapped/compile ;scala3-bootstrapped/test" shell: cmd - name: Scala.js Test diff --git a/compiler/test-resources/scripting/classpathReport.sc b/compiler/test-resources/scripting/classpathReport.sc index 2a240d2fc3a0..a9eacbbba1f7 100755 --- a/compiler/test-resources/scripting/classpathReport.sc +++ b/compiler/test-resources/scripting/classpathReport.sc @@ -1,4 +1,4 @@ -#!/usr/bin/env -S bin/scala -classpath 'dist/target/pack/lib/*' +#!bin/scala -classpath 'dist/target/pack/lib/*' import java.nio.file.Paths diff --git a/compiler/test-resources/scripting/unglobClasspath.sc b/compiler/test-resources/scripting/unglobClasspath.sc index d05ff78435b3..796697cdedf2 100755 --- a/compiler/test-resources/scripting/unglobClasspath.sc +++ b/compiler/test-resources/scripting/unglobClasspath.sc @@ -1,4 +1,4 @@ -#!/usr/bin/env -S bin/scala -classpath 'dist/target/pack/lib/*' +#!bin/scala -classpath 'dist/target/pack/lib/*' // won't compile unless the hashbang line sets classpath import org.jline.terminal.Terminal diff --git a/compiler/test/dotty/tools/scripting/ClasspathTests.scala b/compiler/test/dotty/tools/scripting/ClasspathTests.scala index d755789543a3..0760f6a7401f 100755 --- a/compiler/test/dotty/tools/scripting/ClasspathTests.scala +++ b/compiler/test/dotty/tools/scripting/ClasspathTests.scala @@ -88,7 +88,7 @@ class ClasspathTests: //////////////// end of tests //////////////// -lazy val cwd = Paths.get(".").toAbsolutePath +lazy val cwd = Paths.get(".").toAbsolutePath.normalize lazy val wildcardEntry = "dist/target/pack/lib/*" def listJars(dir: String) = diff --git a/dist/bin/scala b/dist/bin/scala index 8a87d6d0d8a0..b3116b2706b3 100755 --- a/dist/bin/scala +++ b/dist/bin/scala @@ -45,6 +45,16 @@ while [[ $# -gt 0 ]]; do addScala "$1" shift ;; + -classpath*) + if [ "$1" != "${1##* }" ]; then + # hashbang-combined args "-classpath 'lib/*'" + A=$1 ; shift # consume $1 before adding its substrings back + set -- $A "$@" # split $1 on whitespace and put it back + else + addScala "$1" + shift + fi + ;; *) addScala "$1" shift