Skip to content

Commit 1973a2e

Browse files
authored
Merge pull request #219 from bijancn/updates-rebase
Update to Scala 2.13, SBT 1.3 and bump some libraries (Issue #216)
2 parents 733c3f4 + d2a8429 commit 1973a2e

8 files changed

Lines changed: 44 additions & 37 deletions

File tree

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ language: scala
33

44
scala:
55
- 2.11.12
6-
- 2.12.8
6+
- 2.12.9
7+
- 2.13.0
78

89
jdk:
910
- openjdk8

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lazy val fetch = crossProject(JSPlatform, JVMPlatform)
2121
lazy val fetchJVM = fetch.jvm
2222
lazy val fetchJS = fetch.js
2323

24-
lazy val debug = crossProject(JSPlatform, JVMPlatform)
24+
lazy val debug = crossProject(JSPlatform, JVMPlatform)
2525
.in(file("debug"))
2626
.settings(name := "fetch-debug")
2727
.dependsOn(fetch)

docs/src/main/tut/docs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ object Users extends Data[UserId, User] {
147147
latency[F](s"One User $id") >> CF.pure(userDatabase.get(id))
148148
149149
override def batch(ids: NonEmptyList[UserId]): F[Map[UserId, User]] =
150-
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet))
150+
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet).toMap)
151151
}
152152
}
153153
```
@@ -384,7 +384,7 @@ object Posts extends Data[PostId, Post] {
384384
latency[F](s"One Post $id") >> CF.pure(postDatabase.get(id))
385385
386386
override def batch(ids: NonEmptyList[PostId]): F[Map[PostId, Post]] =
387-
latency[F](s"Batch Posts $ids") >> CF.pure(postDatabase.filterKeys(ids.toList.toSet))
387+
latency[F](s"Batch Posts $ids") >> CF.pure(postDatabase.filterKeys(ids.toList.toSet).toMap)
388388
}
389389
}
390390
@@ -622,7 +622,7 @@ object BatchedUsers extends Data[UserId, User]{
622622
latency[F](s"One User $id") >> CF.pure(userDatabase.get(id))
623623
624624
override def batch(ids: NonEmptyList[UserId]): F[Map[UserId, User]] =
625-
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet))
625+
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet).toMap)
626626
}
627627
}
628628
@@ -660,7 +660,7 @@ object SequentialUsers extends Data[UserId, User]{
660660
latency[F](s"One User $id") >> CF.pure(userDatabase.get(id))
661661
662662
override def batch(ids: NonEmptyList[UserId]): F[Map[UserId, User]] =
663-
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet))
663+
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet).toMap)
664664
}
665665
}
666666

examples/src/test/scala/DoobieExample.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ object DatabaseExample {
7676
for {
7777
(conn, trans) <- (connectionPool[F](1), transactionPool[F]).tupled
7878
tx <- H2Transactor
79-
.newH2Transactor[F]("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "", conn, trans)
79+
.newH2Transactor[F](
80+
"jdbc:h2:mem:test;DB_CLOSE_DELAY=-1",
81+
"sa",
82+
"",
83+
conn,
84+
Blocker.liftExecutionContext(trans))
8085
} yield tx
8186

8287
def transactor[F[_]: Async: ContextShift]: Resource[F, Transactor[F]] =

project/ProjectPlugin.scala

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ object ProjectPlugin extends AutoPlugin {
2020

2121
lazy val commonCrossDependencies =
2222
Seq(
23-
libraryDependencies ++=
24-
Seq("org.typelevel" %% "cats-effect" % "2.0.0",
25-
%%("scalatest") % "test"))
23+
libraryDependencies ++=
24+
Seq(
25+
"org.typelevel" %% "cats-effect" % "2.0.0",
26+
"org.scalatest" %% "scalatest" % "3.0.8" % "test"
27+
)
28+
)
2629

2730
lazy val micrositeSettings: Seq[Def.Setting[_]] = Seq(
2831
micrositeName := "Fetch",
@@ -75,16 +78,17 @@ object ProjectPlugin extends AutoPlugin {
7578
tutNameFilter := """README.md""".r
7679
)
7780

78-
lazy val examplesSettings = Seq(libraryDependencies ++= Seq(
79-
%%("circe-generic"),
80-
%%("doobie-core"),
81-
%%("doobie-h2"),
82-
"org.tpolecat" %% "atto-core" % "0.7.0",
83-
"org.http4s" %% "http4s-blaze-client" % "0.21.0-M4",
84-
"org.http4s" %% "http4s-circe" % "0.21.0-M4",
85-
"redis.clients" % "jedis" % "2.9.0",
86-
"io.monix" %% "monix" % "3.0.0"
87-
)) ++ commonCrossDependencies
81+
lazy val examplesSettings = Seq(
82+
libraryDependencies ++= Seq(
83+
"io.circe" %% "circe-generic" % "0.12.0-RC2",
84+
"org.tpolecat" %% s"doobie-core" % "0.8.0-RC1",
85+
"org.tpolecat" %% s"doobie-h2" % "0.8.0-RC1",
86+
"org.tpolecat" %% "atto-core" % "0.7.0",
87+
"org.http4s" %% "http4s-blaze-client" % "0.21.0-M4",
88+
"org.http4s" %% "http4s-circe" % "0.21.0-M4",
89+
"redis.clients" % "jedis" % "2.9.0",
90+
"io.monix" %% "monix" % "3.0.0"
91+
)) ++ commonCrossDependencies
8892
}
8993

9094
lazy val commandAliases: Seq[Def.Setting[_]] =
@@ -93,13 +97,8 @@ object ProjectPlugin extends AutoPlugin {
9397
addCommandAlias("validateCoverage", ";coverage;validate;coverageReport;coverageOff") ++
9498
addCommandAlias(
9599
"validateJVM",
96-
List(
97-
"fetchJVM/compile",
98-
"fetchJVM/test",
99-
"project root").asCmd) ++
100-
addCommandAlias(
101-
"validateJS",
102-
List("fetchJS/compile", "fetchJS/test", "project root").asCmd)
100+
List("fetchJVM/compile", "fetchJVM/test", "project root").asCmd) ++
101+
addCommandAlias("validateJS", List("fetchJS/compile", "fetchJS/test", "project root").asCmd)
103102

104103
override def projectSettings: Seq[Def.Setting[_]] =
105104
commandAliases ++
@@ -125,22 +124,24 @@ object ProjectPlugin extends AutoPlugin {
125124
),
126125
orgUpdateDocFilesSetting += baseDirectory.value / "tut",
127126
scalaOrganization := "org.scala-lang",
128-
scalaVersion := "2.12.8",
129-
crossScalaVersions := List("2.11.12", "2.12.8"),
127+
scalaVersion := "2.13.0",
128+
crossScalaVersions := List("2.11.12", "2.12.9", "2.13.0"),
130129
resolvers += Resolver.sonatypeRepo("snapshots"),
131130
resolvers += Resolver.sonatypeRepo("releases"),
132-
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.7"),
133-
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.2.4"),
131+
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3"),
132+
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1"),
134133
scalacOptions := Seq(
135134
"-unchecked",
136135
"-deprecation",
137136
"-feature",
138137
"-Ywarn-dead-code",
139138
"-language:higherKinds",
140139
"-language:existentials",
141-
"-language:postfixOps",
142-
"-Ypartial-unification"
143-
),
140+
"-language:postfixOps"
141+
) ++ (CrossVersion.partialVersion(scalaVersion.value) match {
142+
case Some((2, 13)) => Seq()
143+
case _ => Seq("-Ypartial-unification")
144+
}),
144145
ScoverageKeys.coverageFailOnMinimum := false
145146
) ++ shellPromptSettings
146147

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.2.3
1+
sbt.version=1.3.0

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ resolvers += Resolver.sonatypeRepo("releases")
22
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.12.0-M2")
33
addSbtPlugin("com.47deg" % "sbt-microsites" % "0.9.4")
44
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
5-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.26")
5+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28")

version.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version in ThisBuild := "1.2.1-SNAPSHOT"
1+
version in ThisBuild := "1.2.1-SNAPSHOT"

0 commit comments

Comments
 (0)