diff --git a/README.md b/README.md index ff8e3e15..29ab6cf6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ fs2-redis ========= [![Build Status](https://travis-ci.org/gvolpe/fs2-redis.svg?branch=master)](https://travis-ci.org/gvolpe/fs2-redis) -[![codecov](https://codecov.io/gh/gvolpe/fs2-redis/branch/master/graph/badge.svg)](https://codecov.io/gh/gvolpe/fs2-redis) +[![Maven Central](https://img.shields.io/maven-central/v/com.github.gvolpe/fs2-redis_2.12.svg)](http://search.maven.org/#search%7Cga%7C1%7Cfs2-redis) Stream-based client built on top of [Fs2](https://functional-streams-for-scala.github.io/fs2/) and the async java client [Lettuce](https://lettuce.io/). diff --git a/build.sbt b/build.sbt index 32c08153..6d4c6f34 100644 --- a/build.sbt +++ b/build.sbt @@ -7,9 +7,9 @@ name := """fs2-redis-root""" organization in ThisBuild := "com.github.gvolpe" -version in ThisBuild := "0.1-SNAPSHOT" +version in ThisBuild := "0.1.0" -crossScalaVersions in ThisBuild := Seq("2.12.6") +crossScalaVersions in ThisBuild := Seq("2.12.4") sonatypeProfileName := "com.github.gvolpe" @@ -23,12 +23,13 @@ val commonSettings = Seq( startYear := Some(2018), licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")), homepage := Some(url("https://github.com/gvolpe/fs2-redis")), - addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.5" cross CrossVersion.binary), libraryDependencies ++= Seq( + compilerPlugin(Libraries.kindProjector cross CrossVersion.binary), + compilerPlugin(Libraries.betterMonadicFor), Libraries.redisClient, Libraries.catsEffect, Libraries.fs2Core, - Libraries.slf4j, + Libraries.scribe, Libraries.scalaTest, Libraries.scalaCheck ), @@ -44,7 +45,6 @@ val commonSettings = Seq( "-language:higherKinds" ), scalafmtOnCompile := true, - //coverageExcludedPackages := "com\\.github\\.gvolpe\\.fs2rabbit\\.examples.*;com\\.github\\.gvolpe\\.fs2rabbit\\.util.*;.*QueueName*;.*RoutingKey*;.*ExchangeName*;.*DeliveryTag*;.*AMQPClientStream*;.*ConnectionStream*;", publishTo := { val sonatype = "https://oss.sonatype.org/" if (isSnapshot.value) @@ -65,14 +65,6 @@ val commonSettings = Seq( ) -val CoreDependencies: Seq[ModuleID] = Seq( - Libraries.logback % "test" -) - -val ExamplesDependencies: Seq[ModuleID] = Seq( - Libraries.logback % "runtime" -) - lazy val noPublish = Seq( publish := {}, publishLocal := {}, @@ -86,13 +78,11 @@ lazy val `fs2-redis-root` = project.in(file(".")) lazy val `fs2-redis` = project.in(file("core")) .settings(commonSettings: _*) - .settings(libraryDependencies ++= CoreDependencies) .settings(parallelExecution in Test := false) .enablePlugins(AutomateHeaderPlugin) lazy val examples = project.in(file("examples")) .settings(commonSettings: _*) - .settings(libraryDependencies ++= ExamplesDependencies) .settings(noPublish) .enablePlugins(AutomateHeaderPlugin) .dependsOn(`fs2-redis`) @@ -131,4 +121,4 @@ lazy val microsite = project.in(file("site")) .dependsOn(`fs2-redis`, `examples`) // CI build -addCommandAlias("buildFs2Redis", ";clean;+coverage;+test;+coverageReport;+coverageAggregate;tut") +addCommandAlias("buildFs2Redis", ";clean;+test;tut") diff --git a/core/src/main/scala/com/github/gvolpe/fs2redis/util/Log.scala b/core/src/main/scala/com/github/gvolpe/fs2redis/util/Log.scala index b37f6cee..b6033fbb 100644 --- a/core/src/main/scala/com/github/gvolpe/fs2redis/util/Log.scala +++ b/core/src/main/scala/com/github/gvolpe/fs2redis/util/Log.scala @@ -17,8 +17,6 @@ package com.github.gvolpe.fs2redis.util import cats.effect.Sync -import cats.syntax.flatMap._ -import org.slf4j.LoggerFactory trait Log[F[_]] { def info(value: String): F[Unit] @@ -26,11 +24,11 @@ trait Log[F[_]] { } object Log { - private[fs2redis] def logger[F[_]: Sync] = Sync[F].delay { LoggerFactory.getLogger(this.getClass) } + def apply[F[_]: Sync](implicit ev: Log[F]): Log[F] = ev implicit def syncLogInstance[F[_]](implicit F: Sync[F]): Log[F] = new Log[F] { - override def error(error: Throwable): F[Unit] = logger[F].flatMap(l => F.delay(l.error(error.getMessage, error))) - override def info(value: String): F[Unit] = logger[F].flatMap(l => F.delay(l.info(value))) + override def error(error: Throwable): F[Unit] = F.delay(scribe.error(error.getMessage, error)) + override def info(value: String): F[Unit] = F.delay(scribe.info(value)) } } diff --git a/examples/src/main/resources/logback.xml b/examples/src/main/resources/logback.xml deleted file mode 100644 index e747db63..00000000 --- a/examples/src/main/resources/logback.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - \ No newline at end of file diff --git a/project/Dependencies.scala b/project/Dependencies.scala index fccae584..2033abbf 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -6,9 +6,10 @@ object Dependencies { val catsEffect = "1.0.0-RC2" val fs2 = "1.0.0-M1" val lettuce = "5.1.0.M1" + val scribe = "2.3.0" - val slf4j = "1.7.25" - val logback = "1.1.3" + val betterMonadicFor = "0.2.4" + val kindProjector = "0.9.7" val scalaTest = "3.0.1" val scalaCheck = "1.13.4" @@ -18,9 +19,11 @@ object Dependencies { lazy val redisClient = "io.lettuce" % "lettuce-core" % Versions.lettuce lazy val catsEffect = "org.typelevel" %% "cats-effect" % Versions.catsEffect lazy val fs2Core = "co.fs2" %% "fs2-core" % Versions.fs2 + lazy val scribe = "com.outr" %% "scribe" % Versions.scribe - lazy val slf4j = "org.slf4j" % "slf4j-api" % Versions.slf4j - lazy val logback = "ch.qos.logback" % "logback-classic" % Versions.logback + // Compiler plugins + lazy val betterMonadicFor = "com.olegpy" %% "better-monadic-for" % Versions.betterMonadicFor + lazy val kindProjector = "org.spire-math" %% "kind-projector" % Versions.kindProjector // Scala test libraries lazy val scalaTest = "org.scalatest" %% "scalatest" % Versions.scalaTest % "test" diff --git a/project/build.properties b/project/build.properties index 64cf32f7..d6e35076 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.1.4 +sbt.version=1.1.6 diff --git a/project/plugins.sbt b/project/plugins.sbt index 3836f3cf..a08c13f6 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,10 +1,6 @@ resolvers += Classpaths.sbtPluginReleases resolvers += "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/" -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") - -addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.2") - addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") @@ -13,6 +9,6 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "4.0.0") addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.15") -addSbtPlugin("com.47deg" % "sbt-microsites" % "0.7.16") +addSbtPlugin("com.47deg" % "sbt-microsites" % "0.7.20") addSbtPlugin("com.scalapenos" % "sbt-prompt" % "1.0.2")