Skip to content

Commit c7d4f9c

Browse files
committed
Upgrades.
* Scala 2.12.5 -> 2.12.6 * sbt-crossproject 0.3.0 -> 0.5.0 (for Scala.js 1.0.0-M5 support) * Scala.js 0.6.23 -> 0.6.24 * Add Scala.js 1.0.0-M5 Support for Scala.js 1.0.0-M5 required to add some `.toInt`s to the result of methods on `js.Date`, since they became `Double`s upstream.
1 parent 064d56a commit c7d4f9c

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,23 @@ script:
99
scala:
1010
- 2.10.7
1111
- 2.11.12
12-
- 2.12.5
12+
- 2.12.6
1313
- 2.13.0-M3
1414
- 2.13.0-M4
1515
jdk:
1616
- oraclejdk8
1717
env:
18-
- SCALAJS_VERSION=0.6.23
18+
- SCALAJS_VERSION=0.6.24
1919
- SCALAJS_VERSION=1.0.0-M3
20+
- SCALAJS_VERSION=1.0.0-M5
2021
matrix:
2122
exclude:
2223
- scala: 2.10.7
2324
env: SCALAJS_VERSION=1.0.0-M3
2425
- scala: 2.13.0-M4
2526
env: SCALAJS_VERSION=1.0.0-M3
27+
- scala: 2.10.7
28+
env: SCALAJS_VERSION=1.0.0-M5
2629

2730
cache:
2831
directories:

build.sbt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import sbtcrossproject.crossProject
22

3-
crossScalaVersions in ThisBuild := Seq("2.12.5", "2.11.12", "2.10.7", "2.13.0-M3", "2.13.0-M4")
3+
crossScalaVersions in ThisBuild := {
4+
val allVersions = Seq("2.12.6", "2.11.12", "2.10.7", "2.13.0-M3", "2.13.0-M4")
5+
if (scalaJSVersion.startsWith("0.6."))
6+
allVersions
7+
else if (scalaJSVersion == "1.0.0-M3")
8+
allVersions.filter(v => !v.startsWith("2.10.") && v != "2.13.0-M4")
9+
else
10+
allVersions.filter(!_.startsWith("2.10."))
11+
}
412
scalaVersion in ThisBuild := (crossScalaVersions in ThisBuild).value.head
513

614
val commonSettings: Seq[Setting[_]] = Seq(

project/build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
val scalaJSVersion =
2-
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.23")
2+
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.24")
33

44
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
5-
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.3.0")
5+
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.5.0")
66

77
addSbtPlugin("org.scalastyle" % "scalastyle-sbt-plugin" % "0.8.0")

src/main/scala/java/time/LocalDate.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ object LocalDate {
391391

392392
def now(): LocalDate = {
393393
val d = new js.Date()
394-
of(d.getFullYear, d.getMonth + 1, d.getDate)
394+
of(d.getFullYear.toInt, d.getMonth.toInt + 1, d.getDate.toInt)
395395
}
396396

397397
// Not implemented

src/main/scala/java/time/LocalTime.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,9 @@ object LocalTime {
323323

324324
def now(): LocalTime = {
325325
val date = new js.Date()
326-
val nano = date.getMilliseconds * 1000000
327-
new LocalTime(date.getHours, date.getMinutes, date.getSeconds, nano)
326+
val nano = date.getMilliseconds.toInt * 1000000
327+
new LocalTime(date.getHours.toInt, date.getMinutes.toInt,
328+
date.getSeconds.toInt, nano)
328329
}
329330

330331
// Not implemented

src/main/scala/java/time/chrono/Chronology.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ trait Chronology extends Comparable[Chronology] {
2626

2727
def dateNow(): ChronoLocalDate = {
2828
val d = new js.Date()
29-
date(d.getFullYear, d.getMonth, d.getDate)
29+
date(d.getFullYear.toInt, d.getMonth.toInt, d.getDate.toInt)
3030
}
3131

3232
// Not implemented

0 commit comments

Comments
 (0)