Skip to content

Commit b8d7569

Browse files
xuwei-kbtlines
authored andcommitted
scalapb 0.7.0 (#23)
1 parent 5f964e8 commit b8d7569

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

build.sbt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import com.trueaccord.scalapb.compiler.Version.{grpcJavaVersion, scalapbVersion}
1+
import scalapb.compiler.Version.{grpcJavaVersion, scalapbVersion}
22

33
organization in ThisBuild := "beyondthelines"
44
version in ThisBuild := "0.0.8"
@@ -12,9 +12,9 @@ lazy val runtime = (project in file("runtime"))
1212
crossScalaVersions := Seq("2.12.4", "2.11.11"),
1313
name := "GrpcGatewayRuntime",
1414
libraryDependencies ++= Seq(
15-
"com.trueaccord.scalapb" %% "compilerplugin" % scalapbVersion,
16-
"com.trueaccord.scalapb" %% "scalapb-runtime-grpc" % scalapbVersion,
17-
"com.trueaccord.scalapb" %% "scalapb-json4s" % "0.3.3",
15+
"com.thesamet.scalapb" %% "compilerplugin" % scalapbVersion,
16+
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapbVersion,
17+
"com.thesamet.scalapb" %% "scalapb-json4s" % "0.7.0",
1818
"io.grpc" % "grpc-netty" % grpcJavaVersion,
1919
"org.webjars" % "swagger-ui" % "3.5.0",
2020
"com.google.api.grpc" % "googleapis-common-protos" % "0.0.3" % "protobuf"
@@ -35,8 +35,8 @@ lazy val generator = (project in file("generator"))
3535
crossScalaVersions := Seq("2.12.4", "2.10.6"),
3636
name := "GrpcGatewayGenerator",
3737
libraryDependencies ++= Seq(
38-
"com.trueaccord.scalapb" %% "compilerplugin" % scalapbVersion,
39-
"com.trueaccord.scalapb" %% "scalapb-runtime-grpc" % scalapbVersion,
38+
"com.thesamet.scalapb" %% "compilerplugin" % scalapbVersion,
39+
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapbVersion,
4040
"com.google.api.grpc" % "googleapis-common-protos" % "0.0.3" % "protobuf"
4141
),
4242
PB.protoSources in Compile += target.value / "protobuf_external",

generator/src/main/scala/grpcgateway/generators/GatewayGenerator.scala

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import com.google.protobuf.Descriptors.FieldDescriptor.JavaType
66
import com.google.protobuf.Descriptors._
77
import com.google.protobuf.ExtensionRegistry
88
import com.google.protobuf.compiler.PluginProtos.{CodeGeneratorRequest, CodeGeneratorResponse}
9-
import com.trueaccord.scalapb.compiler.FunctionalPrinter.PrinterEndo
10-
import com.trueaccord.scalapb.compiler.{DescriptorPimps, FunctionalPrinter}
9+
import scalapb.compiler.FunctionalPrinter.PrinterEndo
10+
import scalapb.compiler.{DescriptorPimps, FunctionalPrinter}
1111

1212
import scala.collection.JavaConverters._
13-
import scalapbshade.v0_6_7.com.trueaccord.scalapb.Scalapb
13+
import scalapb.options.compiler.Scalapb
1414

1515
object GatewayGenerator extends protocbridge.ProtocCodeGenerator with DescriptorPimps {
1616

17-
override val params = com.trueaccord.scalapb.compiler.GeneratorParams()
17+
override val params = scalapb.compiler.GeneratorParams()
1818

1919
override def run(requestBytes: Array[Byte]): Array[Byte] = {
2020
val registry = ExtensionRegistry.newInstance()
@@ -48,8 +48,8 @@ object GatewayGenerator extends protocbridge.ProtocCodeGenerator with Descriptor
4848
.add(s"package ${fileDesc.scalaPackageName}")
4949
.newline
5050
.add(
51-
"import _root_.com.trueaccord.scalapb.GeneratedMessage",
52-
"import _root_.com.trueaccord.scalapb.json.JsonFormat",
51+
"import _root_.scalapb.GeneratedMessage",
52+
"import _root_.scalapb.json4s.JsonFormat",
5353
"import _root_.grpcgateway.handlers._",
5454
"import _root_.io.grpc._",
5555
"import _root_.io.netty.handler.codec.http.{HttpMethod, QueryStringDecoder}"
@@ -58,7 +58,7 @@ object GatewayGenerator extends protocbridge.ProtocCodeGenerator with Descriptor
5858
.add(
5959
"import scala.collection.JavaConverters._",
6060
"import scala.concurrent.{ExecutionContext, Future}",
61-
"import com.trueaccord.scalapb.json.JsonFormatException",
61+
"import scalapb.json4s.JsonFormatException",
6262
"import scala.util._"
6363
)
6464
.newline

generator/src/main/scala/grpcgateway/generators/SwaggerGenerator.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import com.google.protobuf.Descriptors.FieldDescriptor.JavaType
66
import com.google.protobuf.Descriptors.{Descriptor, FieldDescriptor, FileDescriptor, MethodDescriptor}
77
import com.google.protobuf.ExtensionRegistry
88
import com.google.protobuf.compiler.PluginProtos.{CodeGeneratorRequest, CodeGeneratorResponse}
9-
import com.trueaccord.scalapb.compiler.FunctionalPrinter.PrinterEndo
10-
import com.trueaccord.scalapb.compiler.{DescriptorPimps, FunctionalPrinter}
9+
import scalapb.compiler.FunctionalPrinter.PrinterEndo
10+
import scalapb.compiler.{DescriptorPimps, FunctionalPrinter}
1111

1212
import scala.collection.JavaConverters._
1313
import scala.collection.mutable
14-
import scalapbshade.v0_6_7.com.trueaccord.scalapb.Scalapb
14+
import scalapb.options.compiler.Scalapb
1515

1616
object SwaggerGenerator extends protocbridge.ProtocCodeGenerator with DescriptorPimps {
1717

18-
override val params = com.trueaccord.scalapb.compiler.GeneratorParams()
18+
override val params = scalapb.compiler.GeneratorParams()
1919

2020
override def run(requestBytes: Array[Byte]): Array[Byte] = {
2121
val registry = ExtensionRegistry.newInstance()

project/protoc.sbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.13")
1+
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.15")
22

33
libraryDependencies ++= Seq(
4-
"com.trueaccord.scalapb" %% "compilerplugin" % "0.6.7"
4+
"com.thesamet.scalapb" %% "compilerplugin" % "0.7.0"
55
)

runtime/src/main/scala/grpcgateway/handlers/GrpcGatewayHandler.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package grpcgateway.handlers
22

33
import java.nio.charset.StandardCharsets
44

5-
import com.trueaccord.scalapb.GeneratedMessage
6-
import com.trueaccord.scalapb.json.JsonFormat
5+
import scalapb.GeneratedMessage
6+
import scalapb.json4s.JsonFormat
77
import io.grpc.ManagedChannel
88
import io.netty.channel.ChannelHandler.Sharable
99
import io.netty.channel.{ ChannelFutureListener, ChannelHandlerContext, ChannelInboundHandlerAdapter }

runtime/src/main/scala/grpcgateway/handlers/package.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package grpcgateway
22

33
import java.nio.charset.StandardCharsets
44

5-
import com.trueaccord.scalapb.json.JsonFormatException
5+
import scalapb.json4s.JsonFormatException
66
import io.grpc.Status.Code
77
import io.netty.buffer.Unpooled
88
import io.netty.handler.codec.http._

0 commit comments

Comments
 (0)