aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jakob@inpher.io>2019-10-09 23:05:54 -0400
committerJakob Odersky <jakob@inpher.io>2019-10-09 23:05:54 -0400
commit093821b48eff6076cc4123e8db5fcc6eb74f84d3 (patch)
treed94d49f2e4ff26808c84ea0a1f42847a8cde5a67
parentf67c8d59a26132a8d7c80b3e15bddc35ba0091d9 (diff)
downloadscala-triad-093821b48eff6076cc4123e8db5fcc6eb74f84d3.tar.gz
scala-triad-093821b48eff6076cc4123e8db5fcc6eb74f84d3.tar.bz2
scala-triad-093821b48eff6076cc4123e8db5fcc6eb74f84d3.zip
Upgrade to Scala 2.13
-rw-r--r--build.sc20
-rw-r--r--shared/ApiProtocol.scala18
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"
+ )
}