Skip to content

Commit

Permalink
Fix protobuf compiler version
Browse files Browse the repository at this point in the history
  • Loading branch information
RustedBones committed Jul 9, 2024
1 parent 652a08b commit 70470d8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -586,16 +586,8 @@ val protocJavaSourceManaged =
val protocGrpcSourceManaged =
settingKey[File]("Default directory for gRPC sources generated by protoc.")

lazy val protobufConfigSettings = Def.settings(
PB.protocVersion := gcpBom.key.value.version("com.google.protobuf" % "protobuf-java"),
PB.targets := Seq(
PB.gens.java(PB.protocVersion.value) -> Defaults.configSrcSub(protocJavaSourceManaged).value,
PB.gens.plugin("grpc-java") -> Defaults.configSrcSub(protocGrpcSourceManaged).value
),
managedSourceDirectories ++= PB.targets.value.map(_.outputPath)
)

lazy val protobufSettings = Def.settings(
PB.protocVersion := gcpBom.key.value.version("com.google.protobuf" % "protobuf-java"),
protocJavaSourceManaged := sourceManaged.value / "compiled_proto",
protocGrpcSourceManaged := sourceManaged.value / "compiled_grpc",
libraryDependencies ++= Seq(
Expand All @@ -605,6 +597,14 @@ lazy val protobufSettings = Def.settings(
)
) ++ Seq(Compile, Test).flatMap(c => inConfig(c)(protobufConfigSettings))

lazy val protobufConfigSettings = Def.settings(
PB.targets := Seq(
PB.gens.java(PB.protocVersion.value) -> Defaults.configSrcSub(protocJavaSourceManaged).value,
PB.gens.plugin("grpc-java") -> Defaults.configSrcSub(protocGrpcSourceManaged).value
),
managedSourceDirectories ++= PB.targets.value.map(_.outputPath)
)

def splitTests(tests: Seq[TestDefinition], filter: Seq[String], forkOptions: ForkOptions) = {
val (filtered, default) = tests.partition(test => filter.contains(test.name))
val policy = Tests.SubProcess(forkOptions)
Expand Down

0 comments on commit 70470d8

Please sign in to comment.