Skip to content

Commit

Permalink
Update google-common-protos/cloud-pubusb with workaround
Browse files Browse the repository at this point in the history
This re-adds google-common-protos and cloud pubsub with a workaround
for googleapis/java-common-protos#210

See scalapb/ScalaPB#1122
  • Loading branch information
thesamet committed Aug 27, 2021
1 parent 738bed0 commit 270d998
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 3 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,26 @@ sonatypeBundleDirectory := (ThisBuild / baseDirectory).value / "target" / "sonat

publish / skip := true

/* Skipping common protos due to https://github.com/googleapis/api-common-protos/issues/83
def commonProtos =
ProtosProject(
"com.google.api.grpc" % "proto-google-common-protos" % "1.18.1",
"com.google.api.grpc" % "proto-google-common-protos" % "2.4.1",
grpc = true,
protoPackage = "google",
buildNumber = 2
buildNumber = 0
)
lazy val commonProtos09 = commonProtos.scalapb09
lazy val commonProtos10 = commonProtos.scalapb10
lazy val commonProtos11 = commonProtos.scalapb11

val cloudPubSub = ProtosProject(
"com.google.api.grpc" % "proto-google-cloud-pubsub-v1" % "1.93.4",
"com.google.api.grpc" % "proto-google-cloud-pubsub-v1" % "1.96.2",
grpc = true,
protoPackage = "google",
buildNumber = 0
).dependsOn(commonProtos)
lazy val cloudPubSub09 = cloudPubSub.scalapb09
lazy val cloudPubSub10 = cloudPubSub.scalapb10
lazy val cloudPubSub11 = cloudPubSub.scalapb11
*/

val pgvProto = ProtosProject(
"io.envoyproxy.protoc-gen-validate" % "pgv-java-stub" % "0.6.1",
Expand Down
12 changes: 11 additions & 1 deletion project/BuildHelpers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ final case class ProtosProject(
}.taskValue,
Compile / packageBin / packageOptions += {
Package.ManifestAttributes("ScalaPB-Options-Proto" -> optionsFile)
},
// Workaround for https://github.com/googleapis/java-common-protos/issues/210
Compile / PB.runProtoc := {
val runner = (Compile / PB.runProtoc).value
protocbridge.ProtocRunner.fromFunction { (args, extraEnv) =>
runner.run(
args.filterNot(_.contains("google/cloud/common_resources.proto")),
extraEnv
)
}
}
)
}
Expand All @@ -115,7 +125,7 @@ final case class ProtosProject(
)

val scalapb11: Project =
protoProject("0.11.3").dependsOn(
protoProject("0.11.5").dependsOn(
dependencies.map(d => ClasspathDependency(d.scalapb11, None)): _*
)

Expand Down

0 comments on commit 270d998

Please sign in to comment.