From 093821b48eff6076cc4123e8db5fcc6eb74f84d3 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Wed, 9 Oct 2019 23:05:54 -0400 Subject: Upgrade to Scala 2.13 --- build.sc | 20 ++++++++++---------- shared/ApiProtocol.scala | 18 +++++++++++++++--- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/build.sc b/build.sc index 7b2b875..62cfe3c 100644 --- a/build.sc +++ b/build.sc @@ -9,23 +9,23 @@ trait Shared extends ScalaModule with ScalafmtModule{ ) def ivyDeps = Agg( - ivy"xyz.driver::spray-json-derivation::0.4.3", - ivy"com.lihaoyi::scalatags::0.6.7" + ivy"io.crashbox::spray-json::1.3.5-6", + ivy"com.lihaoyi::scalatags::0.7.0" ) } object server extends ScalaModule with Shared { - def scalaVersion = "2.12.9" + def scalaVersion = "2.13.1" def ivyDeps = T { super.ivyDeps() ++ Agg( - ivy"com.typesafe.akka::akka-stream:2.5.11", - ivy"com.typesafe.akka::akka-http:10.1.0", - ivy"com.typesafe.akka::akka-http-spray-json:10.1.0", - ivy"com.typesafe.slick::slick:3.2.3", + ivy"com.typesafe.akka::akka-stream:2.5.25", + ivy"com.typesafe.akka::akka-http:10.1.10", + ivy"com.typesafe.akka::akka-http-spray-json:10.1.10", + ivy"com.typesafe.slick::slick:3.3.2", ivy"org.slf4j:slf4j-nop:1.6.4", - ivy"org.xerial:sqlite-jdbc:3.21.0.1" + ivy"org.xerial:sqlite-jdbc:3.28.0" ) } @@ -38,12 +38,12 @@ object server extends ScalaModule with Shared { } object ui extends ScalaJSModule with Shared { - def scalaVersion = "2.12.10" + def scalaVersion = "2.13.1" def scalaJSVersion = "0.6.29" def ivyDeps = T { super.ivyDeps() ++ Agg( - ivy"org.scala-js::scalajs-dom::0.9.5", + ivy"org.scala-js::scalajs-dom::0.9.7", ivy"org.scala-js::scalajs-java-time::0.2.5" ) } diff --git a/shared/ApiProtocol.scala b/shared/ApiProtocol.scala index 5d0e00a..eb6da0b 100644 --- a/shared/ApiProtocol.scala +++ b/shared/ApiProtocol.scala @@ -1,12 +1,24 @@ package triad import java.time.Instant -import spray.json.{DerivedJsonProtocol, JsNumber, JsValue, JsonFormat} +import spray.json.{ + DefaultJsonProtocol, + JsNumber, + JsValue, + JsonFormat, + RootJsonFormat +} -object ApiProtocol extends DerivedJsonProtocol { +object ApiProtocol extends DefaultJsonProtocol { implicit val timestampFormat: JsonFormat[Instant] = new JsonFormat[Instant] { def read(js: JsValue) = Instant.ofEpochMilli(js.convertTo[Long]) def write(i: Instant) = JsNumber(i.toEpochMilli) } - implicit val messageFormat = jsonFormat[Message] + + implicit val messageFormat: RootJsonFormat[Message] = jsonFormat( + Message.apply _, + "content", + "author", + "timestamp" + ) } -- cgit v1.2.3