Skip to content

Commit

Permalink
Merge pull request #219 from bijancn/updates-rebase
Browse files Browse the repository at this point in the history
Update to Scala 2.13, SBT 1.3 and bump some libraries (Issue #216)
  • Loading branch information
purrgrammer authored Sep 19, 2019
2 parents 733c3f4 + d2a8429 commit 1973a2e
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 37 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ language: scala

scala:
- 2.11.12
- 2.12.8
- 2.12.9
- 2.13.0

jdk:
- openjdk8
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lazy val fetch = crossProject(JSPlatform, JVMPlatform)
lazy val fetchJVM = fetch.jvm
lazy val fetchJS = fetch.js

lazy val debug = crossProject(JSPlatform, JVMPlatform)
lazy val debug = crossProject(JSPlatform, JVMPlatform)
.in(file("debug"))
.settings(name := "fetch-debug")
.dependsOn(fetch)
Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/tut/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ object Users extends Data[UserId, User] {
latency[F](s"One User $id") >> CF.pure(userDatabase.get(id))
override def batch(ids: NonEmptyList[UserId]): F[Map[UserId, User]] =
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet))
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet).toMap)
}
}
```
Expand Down Expand Up @@ -384,7 +384,7 @@ object Posts extends Data[PostId, Post] {
latency[F](s"One Post $id") >> CF.pure(postDatabase.get(id))
override def batch(ids: NonEmptyList[PostId]): F[Map[PostId, Post]] =
latency[F](s"Batch Posts $ids") >> CF.pure(postDatabase.filterKeys(ids.toList.toSet))
latency[F](s"Batch Posts $ids") >> CF.pure(postDatabase.filterKeys(ids.toList.toSet).toMap)
}
}
Expand Down Expand Up @@ -622,7 +622,7 @@ object BatchedUsers extends Data[UserId, User]{
latency[F](s"One User $id") >> CF.pure(userDatabase.get(id))
override def batch(ids: NonEmptyList[UserId]): F[Map[UserId, User]] =
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet))
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet).toMap)
}
}
Expand Down Expand Up @@ -660,7 +660,7 @@ object SequentialUsers extends Data[UserId, User]{
latency[F](s"One User $id") >> CF.pure(userDatabase.get(id))
override def batch(ids: NonEmptyList[UserId]): F[Map[UserId, User]] =
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet))
latency[F](s"Batch Users $ids") >> CF.pure(userDatabase.filterKeys(ids.toList.toSet).toMap)
}
}
Expand Down
7 changes: 6 additions & 1 deletion examples/src/test/scala/DoobieExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ object DatabaseExample {
for {
(conn, trans) <- (connectionPool[F](1), transactionPool[F]).tupled
tx <- H2Transactor
.newH2Transactor[F]("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "", conn, trans)
.newH2Transactor[F](
"jdbc:h2:mem:test;DB_CLOSE_DELAY=-1",
"sa",
"",
conn,
Blocker.liftExecutionContext(trans))
} yield tx

def transactor[F[_]: Async: ContextShift]: Resource[F, Transactor[F]] =
Expand Down
55 changes: 28 additions & 27 deletions project/ProjectPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ object ProjectPlugin extends AutoPlugin {

lazy val commonCrossDependencies =
Seq(
libraryDependencies ++=
Seq("org.typelevel" %% "cats-effect" % "2.0.0",
%%("scalatest") % "test"))
libraryDependencies ++=
Seq(
"org.typelevel" %% "cats-effect" % "2.0.0",
"org.scalatest" %% "scalatest" % "3.0.8" % "test"
)
)

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

lazy val examplesSettings = Seq(libraryDependencies ++= Seq(
%%("circe-generic"),
%%("doobie-core"),
%%("doobie-h2"),
"org.tpolecat" %% "atto-core" % "0.7.0",
"org.http4s" %% "http4s-blaze-client" % "0.21.0-M4",
"org.http4s" %% "http4s-circe" % "0.21.0-M4",
"redis.clients" % "jedis" % "2.9.0",
"io.monix" %% "monix" % "3.0.0"
)) ++ commonCrossDependencies
lazy val examplesSettings = Seq(
libraryDependencies ++= Seq(
"io.circe" %% "circe-generic" % "0.12.0-RC2",
"org.tpolecat" %% s"doobie-core" % "0.8.0-RC1",
"org.tpolecat" %% s"doobie-h2" % "0.8.0-RC1",
"org.tpolecat" %% "atto-core" % "0.7.0",
"org.http4s" %% "http4s-blaze-client" % "0.21.0-M4",
"org.http4s" %% "http4s-circe" % "0.21.0-M4",
"redis.clients" % "jedis" % "2.9.0",
"io.monix" %% "monix" % "3.0.0"
)) ++ commonCrossDependencies
}

lazy val commandAliases: Seq[Def.Setting[_]] =
Expand All @@ -93,13 +97,8 @@ object ProjectPlugin extends AutoPlugin {
addCommandAlias("validateCoverage", ";coverage;validate;coverageReport;coverageOff") ++
addCommandAlias(
"validateJVM",
List(
"fetchJVM/compile",
"fetchJVM/test",
"project root").asCmd) ++
addCommandAlias(
"validateJS",
List("fetchJS/compile", "fetchJS/test", "project root").asCmd)
List("fetchJVM/compile", "fetchJVM/test", "project root").asCmd) ++
addCommandAlias("validateJS", List("fetchJS/compile", "fetchJS/test", "project root").asCmd)

override def projectSettings: Seq[Def.Setting[_]] =
commandAliases ++
Expand All @@ -125,22 +124,24 @@ object ProjectPlugin extends AutoPlugin {
),
orgUpdateDocFilesSetting += baseDirectory.value / "tut",
scalaOrganization := "org.scala-lang",
scalaVersion := "2.12.8",
crossScalaVersions := List("2.11.12", "2.12.8"),
scalaVersion := "2.13.0",
crossScalaVersions := List("2.11.12", "2.12.9", "2.13.0"),
resolvers += Resolver.sonatypeRepo("snapshots"),
resolvers += Resolver.sonatypeRepo("releases"),
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.7"),
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.2.4"),
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3"),
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1"),
scalacOptions := Seq(
"-unchecked",
"-deprecation",
"-feature",
"-Ywarn-dead-code",
"-language:higherKinds",
"-language:existentials",
"-language:postfixOps",
"-Ypartial-unification"
),
"-language:postfixOps"
) ++ (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Seq()
case _ => Seq("-Ypartial-unification")
}),
ScoverageKeys.coverageFailOnMinimum := false
) ++ shellPromptSettings

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.2.3
sbt.version=1.3.0
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ resolvers += Resolver.sonatypeRepo("releases")
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.12.0-M2")
addSbtPlugin("com.47deg" % "sbt-microsites" % "0.9.4")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.26")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28")
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.2.1-SNAPSHOT"
version in ThisBuild := "1.2.1-SNAPSHOT"

0 comments on commit 1973a2e

Please sign in to comment.