Skip to content

Commit

Permalink
Merge pull request #196 from ahjohannessen/wip-control-grpc-version-a…
Browse files Browse the repository at this point in the history
…nd-use-shaded-netty

deps/grpc: avoid transient grpc via scalapb + shaded netty
  • Loading branch information
ahjohannessen authored Oct 17, 2020
2 parents b72a1d9 + cda55c2 commit 0fb0c64
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
5 changes: 3 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ lazy val core = project
.settings(commonSettings)
.settings(
name := "sec-core",
libraryDependencies ++= compileM(cats, scodecBits, circe, scalaPb, grpcApi),
libraryDependencies ++=
compileM(cats, scodecBits, circe, scalaPb, grpcApi, grpcStub, grpcProtobuf, grpcCore),
Compile / PB.protoSources := Seq((LocalRootProject / baseDirectory).value / "protobuf"),
Compile / PB.targets := Seq(scalapb.gen(flatPackage = true, grpc = false) -> (sourceManaged in Compile).value)
)
Expand Down Expand Up @@ -54,7 +55,7 @@ lazy val `fs2-netty` = project
.in(file("fs2-netty"))
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(name := "sec-fs2-client", libraryDependencies ++= compileM(grpcNetty, tcnative))
.settings(name := "sec-fs2-client", libraryDependencies ++= compileM(grpcNetty))
.dependsOn(`fs2-core`)

//==== Tests ===========================================================================================================
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ slug: /
To use @libName@ in an existing [sbt](https://www.scala-sbt.org) project with Scala 2.13 or a later version,
add the following to your `build.sbt` file.
```scala
libraryDependencies += "io.github.ahjohannessen" % "sec-fs2" % "@libVersion@"
libraryDependencies += "io.github.ahjohannessen" %% "sec-fs2" % "@libVersion@"
```

### How to learn
Expand Down
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ you configure ESDB for production usage.

Create a new project with @libName@ as dependency:
```scala
libraryDependencies += "io.github.ahjohannessen" % "sec-fs2" % "@libVersion@"
libraryDependencies += "io.github.ahjohannessen" %% "sec-fs2" % "@libVersion@"
```

### Verify Your Setup
Expand Down
8 changes: 4 additions & 4 deletions fs2-netty/src/main/scala/sec/api/netty.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ package api
import java.nio.file.Path
import cats.effect._
import cats.syntax.all._
import io.grpc.netty.NettyChannelBuilder
import io.grpc.netty.NettyChannelBuilder.{forAddress, forTarget}
import io.grpc.netty.GrpcSslContexts.forClient
import io.netty.handler.ssl.SslContext
import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder
import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder.{forAddress, forTarget}
import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts.forClient
import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext

object netty {

Expand Down
29 changes: 15 additions & 14 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ object Dependencies {
val scodecBits = "1.1.20"
val circe = "0.13.0"
val scalaPb = scalapb.compiler.Version.scalapbVersion
val grpc = org.lyranthe.fs2_grpc.buildinfo.BuildInfo.grpcVersion
val tcnative = "2.0.30.Final"
val grpc = "1.32.2"
val disciplineSpecs2 = "1.1.0"
val specs2 = "4.10.5"
val catsEffectSpecs2 = "0.4.1"
Expand All @@ -23,18 +22,20 @@ object Dependencies {

// Compile

val cats = "org.typelevel" %% "cats-core" % versions.catsCore
val catsEffect = "org.typelevel" %% "cats-effect" % versions.catsEffect
val fs2 = "co.fs2" %% "fs2-core" % versions.fs2
val log4cats = "io.chrisdavenport" %% "log4cats-core" % versions.log4cats
val log4catsNoop = "io.chrisdavenport" %% "log4cats-noop" % versions.log4cats
val scodecBits = "org.scodec" %% "scodec-bits" % versions.scodecBits
val circe = "io.circe" %% "circe-core" % versions.circe
val circeParser = "io.circe" %% "circe-parser" % versions.circe
val scalaPb = "com.thesamet.scalapb" %% "scalapb-runtime" % versions.scalaPb
val grpcApi = "io.grpc" % "grpc-api" % versions.grpc
val grpcNetty = "io.grpc" % "grpc-netty" % versions.grpc
val tcnative = "io.netty" % "netty-tcnative-boringssl-static" % versions.tcnative
val cats = "org.typelevel" %% "cats-core" % versions.catsCore
val catsEffect = "org.typelevel" %% "cats-effect" % versions.catsEffect
val fs2 = "co.fs2" %% "fs2-core" % versions.fs2
val log4cats = "io.chrisdavenport" %% "log4cats-core" % versions.log4cats
val log4catsNoop = "io.chrisdavenport" %% "log4cats-noop" % versions.log4cats
val scodecBits = "org.scodec" %% "scodec-bits" % versions.scodecBits
val circe = "io.circe" %% "circe-core" % versions.circe
val circeParser = "io.circe" %% "circe-parser" % versions.circe
val scalaPb = "com.thesamet.scalapb" %% "scalapb-runtime" % versions.scalaPb
val grpcApi = "io.grpc" % "grpc-api" % versions.grpc
val grpcStub = "io.grpc" % "grpc-stub" % versions.grpc
val grpcCore = "io.grpc" % "grpc-core" % versions.grpc
val grpcProtobuf = "io.grpc" % "grpc-protobuf" % versions.grpc
val grpcNetty = "io.grpc" % "grpc-netty-shaded" % versions.grpc

// Testing

Expand Down

0 comments on commit 0fb0c64

Please sign in to comment.