diff --git a/build.sc b/build.sc index 3055814..d6e733f 100644 --- a/build.sc +++ b/build.sc @@ -148,7 +148,7 @@ class ScalaJsCliNativeImage(val scalaJsVersion0: String) extends ScalaModule wit System.err.println(s"Testing ${path.relativeTo(os.pwd)}") val cwd = T.dest / "workdir" os.makeDir.all(cwd) - os.proc(bash, os.pwd / "scripts" / "test-cli.sh", path) + os.proc(bash, os.pwd / "scripts" / "test-cli.sh", path, scalaJsVersion) .call(cwd = cwd, stdin = os.Inherit, stdout = os.Inherit) } } @@ -339,7 +339,7 @@ object ci extends Module { if (version.endsWith("-SNAPSHOT")) ("launchers", true) else ("v" + version, false) - Upload.upload("scala-cli", "scala-js-cli-native-image", ghToken, tag, dryRun = false, overwrite = overwriteAssets)(launchers: _*) + Upload.upload("scala-cli", "scala-js-cli", ghToken, tag, dryRun = false, overwrite = overwriteAssets)(launchers: _*) } def testCli() = { @@ -353,7 +353,7 @@ object ci extends Module { System.err.println(s"Testing Scala.JS $scalaJsVer") val cwd = workDir / scalaJsVer os.makeDir.all(cwd) - os.proc(bash, os.pwd / "scripts" / "test-cli.sh", launcher.path) + os.proc(bash, os.pwd / "scripts" / "test-cli.sh", launcher.path, scalaJsVer) .call(cwd = cwd, stdin = os.Inherit, stdout = os.Inherit) } } diff --git a/scripts/test-cli.sh b/scripts/test-cli.sh index 086bb0a..efac67d 100755 --- a/scripts/test-cli.sh +++ b/scripts/test-cli.sh @@ -2,13 +2,14 @@ set -ev launcher="$1" +scalaJsVersion="$2" -if [ "$launcher" == "" ]; then - echo "Usage: $0 launcher" 1>&2 +if [ "$launcher" == "" -o "$scalaJsVersion" == "" ]; then + echo "Usage: $0 launcher scala-js-version" 1>&2 exit 1 fi -echo "Using launcher $launcher" +echo "Using launcher $launcher, Scala.JS $scalaJsVersion" fail() { echo "$1" >&2 @@ -29,11 +30,11 @@ object Foo { EOF cs launch scalac:2.13.6 -- \ - -classpath "$(cs fetch --intransitive org.scala-js::scalajs-library:1.9.0)" \ - -Xplugin:"$(cs fetch --intransitive org.scala-js:scalajs-compiler_2.13.6:1.9.0)" \ + -classpath "$(cs fetch --intransitive org.scala-js::scalajs-library:$scalaJsVersion)" \ + -Xplugin:"$(cs fetch --intransitive org.scala-js:scalajs-compiler_2.13.6:$scalaJsVersion)" \ -d bin foo.scala -"$launcher" --stdlib "$(cs fetch --intransitive org.scala-js::scalajs-library:1.9.0)" -s -o test.js -mm Foo.main bin 2> test_stderr.txt || cat test_stderr.txt +"$launcher" --stdlib "$(cs fetch --intransitive org.scala-js::scalajs-library:$scalaJsVersion)" -s -o test.js -mm Foo.main bin 2> test_stderr.txt || cat test_stderr.txt grep -Fxq "Warning: using a single file as output (--output) is deprecated since Scala.js 1.3.0. Use --outputDir instead." test_stderr.txt \ || fail "expected warning. Got: $(cat test_stderr.txt)" test -s test.js || fail "scalajsld: empty output" @@ -47,7 +48,7 @@ EOF diff got-legacy.run want-legacy.run mkdir test-output -"$launcher" --stdlib "$(cs fetch --intransitive org.scala-js::scalajs-library:1.9.0)" -s --outputDir test-output --moduleSplitStyle SmallestModules --moduleKind CommonJSModule -mm Foo.main bin +"$launcher" --stdlib "$(cs fetch --intransitive org.scala-js::scalajs-library:$scalaJsVersion)" -s --outputDir test-output --moduleSplitStyle SmallestModules --moduleKind CommonJSModule -mm Foo.main bin test "$(ls test-output/*.js| wc -w)" -gt "1" || fail "scalajsld: produced single js output file" node test-output/main.js > got.run