Skip to content

Commit 7bbda03

Browse files
Merge pull request #13 from alexarchambault/develop
Checking stuff
2 parents eb423ac + df6a769 commit 7bbda03

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

build.sc

+3-3
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class ScalaJsCliNativeImage(val scalaJsVersion0: String) extends ScalaModule wit
148148
System.err.println(s"Testing ${path.relativeTo(os.pwd)}")
149149
val cwd = T.dest / "workdir"
150150
os.makeDir.all(cwd)
151-
os.proc(bash, os.pwd / "scripts" / "test-cli.sh", path)
151+
os.proc(bash, os.pwd / "scripts" / "test-cli.sh", path, scalaJsVersion)
152152
.call(cwd = cwd, stdin = os.Inherit, stdout = os.Inherit)
153153
}
154154
}
@@ -339,7 +339,7 @@ object ci extends Module {
339339
if (version.endsWith("-SNAPSHOT")) ("launchers", true)
340340
else ("v" + version, false)
341341

342-
Upload.upload("scala-cli", "scala-js-cli-native-image", ghToken, tag, dryRun = false, overwrite = overwriteAssets)(launchers: _*)
342+
Upload.upload("scala-cli", "scala-js-cli", ghToken, tag, dryRun = false, overwrite = overwriteAssets)(launchers: _*)
343343
}
344344

345345
def testCli() = {
@@ -353,7 +353,7 @@ object ci extends Module {
353353
System.err.println(s"Testing Scala.JS $scalaJsVer")
354354
val cwd = workDir / scalaJsVer
355355
os.makeDir.all(cwd)
356-
os.proc(bash, os.pwd / "scripts" / "test-cli.sh", launcher.path)
356+
os.proc(bash, os.pwd / "scripts" / "test-cli.sh", launcher.path, scalaJsVer)
357357
.call(cwd = cwd, stdin = os.Inherit, stdout = os.Inherit)
358358
}
359359
}

scripts/test-cli.sh

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
set -ev
33

44
launcher="$1"
5+
scalaJsVersion="$2"
56

6-
if [ "$launcher" == "" ]; then
7-
echo "Usage: $0 launcher" 1>&2
7+
if [ "$launcher" == "" -o "$scalaJsVersion" == "" ]; then
8+
echo "Usage: $0 launcher scala-js-version" 1>&2
89
exit 1
910
fi
1011

11-
echo "Using launcher $launcher"
12+
echo "Using launcher $launcher, Scala.JS $scalaJsVersion"
1213

1314
fail() {
1415
echo "$1" >&2
@@ -29,11 +30,11 @@ object Foo {
2930
EOF
3031

3132
cs launch scalac:2.13.6 -- \
32-
-classpath "$(cs fetch --intransitive org.scala-js::scalajs-library:1.9.0)" \
33-
-Xplugin:"$(cs fetch --intransitive org.scala-js:scalajs-compiler_2.13.6:1.9.0)" \
33+
-classpath "$(cs fetch --intransitive org.scala-js::scalajs-library:$scalaJsVersion)" \
34+
-Xplugin:"$(cs fetch --intransitive org.scala-js:scalajs-compiler_2.13.6:$scalaJsVersion)" \
3435
-d bin foo.scala
3536

36-
"$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
37+
"$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
3738
grep -Fxq "Warning: using a single file as output (--output) is deprecated since Scala.js 1.3.0. Use --outputDir instead." test_stderr.txt \
3839
|| fail "expected warning. Got: $(cat test_stderr.txt)"
3940
test -s test.js || fail "scalajsld: empty output"
@@ -47,7 +48,7 @@ EOF
4748
diff got-legacy.run want-legacy.run
4849

4950
mkdir test-output
50-
"$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
51+
"$launcher" --stdlib "$(cs fetch --intransitive org.scala-js::scalajs-library:$scalaJsVersion)" -s --outputDir test-output --moduleSplitStyle SmallestModules --moduleKind CommonJSModule -mm Foo.main bin
5152
test "$(ls test-output/*.js| wc -w)" -gt "1" || fail "scalajsld: produced single js output file"
5253

5354
node test-output/main.js > got.run

0 commit comments

Comments
 (0)