Skip to content

Commit

Permalink
Merge pull request #90 from xuwei-k/update-grpc
Browse files Browse the repository at this point in the history
update grpc 0.13.1
  • Loading branch information
thesamet committed Mar 9, 2016
2 parents 36cbc9c + ccc86e7 commit 21e189d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 95 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ lazy val runtime = crossProject.crossType(CrossType.Full).in(file("scalapb-runti
lazy val runtimeJVM = runtime.jvm
lazy val runtimeJS = runtime.js

val grpcVersion = "0.9.0"
val grpcVersion = "0.13.1"

lazy val grpcRuntime = project.in(file("scalapb-runtime-grpc"))
.dependsOn(runtimeJVM)
Expand Down Expand Up @@ -127,7 +127,7 @@ lazy val proptest = project.in(file("proptest"))
libraryDependencies ++= Seq(
"com.github.os72" % "protoc-jar" % "3.0.0-b1",
"com.google.protobuf" % "protobuf-java" % "3.0.0-beta-2",
"io.grpc" % "grpc-all" % "0.9.0" % "test",
"io.grpc" % "grpc-all" % grpcVersion % "test",
"com.trueaccord.lenses" %% "lenses" % "0.4.1",
"org.scalacheck" %% "scalacheck" % "1.12.4" % "test",
"org.scalatest" %% "scalatest" % (if (scalaVersion.value.startsWith("2.12")) "2.2.5-M2" else "2.2.5") % "test"
Expand Down
2 changes: 1 addition & 1 deletion e2e/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PB.runProtoc in PB.protobufConfig := { args0 =>
com.github.os72.protocjar.Protoc.runProtoc("-v300" +: args.toArray)
}

val grpcVersion = "0.9.0"
val grpcVersion = "0.13.1"

val grpcArtifactId = "protoc-gen-grpc-java"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
package com.trueaccord.scalapb.grpc

import java.io.InputStream
import java.io.{ByteArrayInputStream, InputStream}

import com.trueaccord.scalapb.grpc.ProtoInputStream.NotStarted
import com.trueaccord.scalapb.{GeneratedMessage, GeneratedMessageCompanion, Message}

class Marshaller[T <: GeneratedMessage with Message[T]](companion: GeneratedMessageCompanion[T]) extends io.grpc.MethodDescriptor.Marshaller[T] {
override def stream(t: T): InputStream = ProtoInputStream.newInstance(t)
override def stream(t: T): InputStream = new ByteArrayInputStream(t.toByteArray)

override def parse(inputStream: InputStream): T = inputStream match {
/* Optimization for in-memory transport. */
case ProtoInputStream(NotStarted(m: T @unchecked)) if m.companion == companion =>
m
case is => companion.parseFrom(is)
}
override def parse(inputStream: InputStream): T =
companion.parseFrom(inputStream)
}

This file was deleted.

0 comments on commit 21e189d

Please sign in to comment.