Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
thesamet committed Aug 27, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 738bed0 commit 270d998
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
@@ -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",
12 changes: 11 additions & 1 deletion project/BuildHelpers.scala
Original file line number Diff line number Diff line change
@@ -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)): _*
)

0 comments on commit 270d998

Please sign in to comment.