From 270d9982d7fa35618d5538532953caf2aa85ac43 Mon Sep 17 00:00:00 2001 From: Nadav Samet Date: Fri, 27 Aug 2021 13:53:01 -0700 Subject: [PATCH] Update google-common-protos/cloud-pubusb with workaround This re-adds google-common-protos and cloud pubsub with a workaround for https://github.com/googleapis/java-common-protos/issues/210 See scalapb/ScalaPB#1122 --- build.sbt | 8 +++----- project/BuildHelpers.scala | 12 +++++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index f5bdde2..9393fa8 100644 --- a/build.sbt +++ b/build.sbt @@ -8,20 +8,19 @@ 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 @@ -29,7 +28,6 @@ val cloudPubSub = ProtosProject( 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", diff --git a/project/BuildHelpers.scala b/project/BuildHelpers.scala index d82d787..5968bab 100644 --- a/project/BuildHelpers.scala +++ b/project/BuildHelpers.scala @@ -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 + ) + } } ) } @@ -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)): _* )