Skip to content

Commit c51f539

Browse files
authored
Merge pull request com-lihaoyi#83 from sjrd/scalajs-1.0.0-RC2
Add support for Scala.js 1.0.0-RC2
2 parents dfd7388 + 9681777 commit c51f539

File tree

4 files changed

+30
-10
lines changed

4 files changed

+30
-10
lines changed

build.sc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ trait SourcecodeTestModule extends ScalaModule {
6464
}
6565

6666
object sourcecode extends Module {
67-
object jvm extends Cross[JvmSourcecodeModule]("2.11.12", "2.12.8", "2.13.0", "0.21.0-RC1")
67+
object jvm extends Cross[JvmSourcecodeModule]("2.11.12", "2.12.10", "2.13.1", "0.21.0-RC1")
6868
class JvmSourcecodeModule(val crossScalaVersion: String)
6969
extends SourcecodeMainModule with ScalaModule with SourcecodeModule {
7070

@@ -85,7 +85,8 @@ object sourcecode extends Module {
8585
}
8686

8787
object js extends Cross[JsSourcecodeModule](
88-
("2.11.12", "0.6.28"), ("2.12.8", "0.6.28"), ("2.13.0", "0.6.28")/*, ("2.12.8", "1.0.0-M8"), ("2.13.0", "1.0.0-M8")*/
88+
("2.11.12", "0.6.28"), ("2.12.10", "0.6.28"), ("2.13.1", "0.6.28"),
89+
("2.11.12", "1.0.0-RC2"), ("2.12.10", "1.0.0-RC2"), ("2.13.1", "1.0.0-RC2")
8990
)
9091
class JsSourcecodeModule(val crossScalaVersion: String, crossJSVersion: String)
9192
extends SourcecodeMainModule with ScalaJSModule with SourcecodeModule {

mill

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This is a wrapper script, that automatically download mill from GitHub release pages
44
# You can give the required mill version with MILL_VERSION env variable
55
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
6-
DEFAULT_MILL_VERSION=0.5.0
6+
DEFAULT_MILL_VERSION=0.5.7
77

88
set -e
99

@@ -17,13 +17,24 @@ if [ -z "$MILL_VERSION" ] ; then
1717
fi
1818
fi
1919

20-
MILL_DOWNLOAD_PATH="$HOME/.mill/download"
21-
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/$MILL_VERSION"
20+
if [ "x${XDG_CACHE_HOME}" != "x" ] ; then
21+
MILL_DOWNLOAD_PATH="${XDG_CACHE_HOME}/mill/download"
22+
else
23+
MILL_DOWNLOAD_PATH="${HOME}/.cache/mill/download"
24+
fi
25+
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/${MILL_VERSION}"
26+
27+
version_remainder="$MILL_VERSION"
28+
MILL_MAJOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
29+
MILL_MINOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
2230

2331
if [ ! -x "$MILL_EXEC_PATH" ] ; then
2432
mkdir -p $MILL_DOWNLOAD_PATH
33+
if [ "$MILL_MAJOR_VERSION" -gt 0 ] || [ "$MILL_MINOR_VERSION" -ge 5 ] ; then
34+
ASSEMBLY="-assembly"
35+
fi
2536
DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download
26-
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION-assembly"
37+
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION${ASSEMBLY}"
2738
curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL"
2839
chmod +x "$DOWNLOAD_FILE"
2940
mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"

sourcecode/test/src/sourcecode/Apply.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ object Apply {
2424
assert(line == 23)
2525

2626
lazy val myLazy = {
27-
trait Bar{
27+
/* Bar used to be a trait, but that ran into the upstream bug
28+
* https://github.com/scala-js/scala-js/issues/3918 in Scala.js 1.0.0-RC2
29+
* and Scala 2.12+. We use an abstract class as a workaround.
30+
*/
31+
abstract class Bar{
2832
val name = sourcecode.Name()
2933
assert(name == "name")
3034

@@ -38,7 +42,7 @@ object Apply {
3842
assert(fileName == "Apply.scala")
3943

4044
val line = sourcecode.Line()
41-
assert(line == 40)
45+
assert(line == 44)
4246

4347
val enclosing = sourcecode.Enclosing()
4448
assert(

sourcecode/test/src/sourcecode/Implicits.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ object Implicits {
2424
assert(line.value == 23)
2525

2626
lazy val myLazy = {
27-
trait Bar{
27+
/* Bar used to be a trait, but that ran into the upstream bug
28+
* https://github.com/scala-js/scala-js/issues/3918 in Scala.js 1.0.0-RC2
29+
* and Scala 2.12+. We use an abstract class as a workaround.
30+
*/
31+
abstract class Bar{
2832
val name = implicitly[sourcecode.Name]
2933
assert(name.value == "name")
3034

@@ -41,7 +45,7 @@ object Implicits {
4145
assert(fileName.value == "Implicits.scala")
4246

4347
val line = implicitly[sourcecode.Line]
44-
assert(line.value == 43)
48+
assert(line.value == 47)
4549

4650
val enclosing = implicitly[sourcecode.Enclosing]
4751
assert(

0 commit comments

Comments
 (0)