2
2
set -ev
3
3
4
4
launcher=" $1 "
5
+ scalaJsVersion=" $2 "
5
6
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
8
9
exit 1
9
10
fi
10
11
11
- echo " Using launcher $launcher "
12
+ echo " Using launcher $launcher , Scala.JS $scalaJsVersion "
12
13
13
14
fail () {
14
15
echo " $1 " >&2
@@ -29,11 +30,11 @@ object Foo {
29
30
EOF
30
31
31
32
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 ) " \
34
35
-d bin foo.scala
35
36
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
37
38
grep -Fxq " Warning: using a single file as output (--output) is deprecated since Scala.js 1.3.0. Use --outputDir instead." test_stderr.txt \
38
39
|| fail " expected warning. Got: $( cat test_stderr.txt) "
39
40
test -s test.js || fail " scalajsld: empty output"
47
48
diff got-legacy.run want-legacy.run
48
49
49
50
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
51
52
test " $( ls test-output/* .js| wc -w) " -gt " 1" || fail " scalajsld: produced single js output file"
52
53
53
54
node test-output/main.js > got.run
0 commit comments