Skip to content

Commit

Permalink
bump sbt-protoc for better integration with common-protos
Browse files Browse the repository at this point in the history
Fixes scripted 10-scalapb-validate, see
* scalapb/ScalaPB#873 (comment)
* scalapb/scalapb-validate#70

Other changes
* cacheClassLoaders is now deprecated, see
  thesamet/sbt-protoc@2a730a4
* Forcing recompilation is no longer necessary as the cache gets
  invalidated if a sandbox genererator classpath is updated, see
  thesamet/sbt-protoc@80824b0
* The new classloader caching implementation resolves sandboxed
  generators artifacts earlier, even if they are no sources. That is
  the case for Test / protocGenerate, which was starting before
  codeGenProject / Compile / publishLocal, causing:
  > Error downloading com.lightbend.akka.grpc:akka-grpc-codegen_2.12:
  > 1.1.0-5-c5975cd5
  • Loading branch information
github-brice-jaglin committed Feb 16, 2021
1 parent 70ba7a2 commit a648ac9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion benchmark-java/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ val root = project.in(file("."))
"org.scalatest" %% "scalatest" % "3.1.2" % "test",
"org.scalatestplus" %% "junit-4-12" % "3.1.2.0" % "test"
),
Compile / PB.generate := ((Compile / PB.generate) dependsOn (
PB.artifactResolver := (PB.artifactResolver dependsOn (
codeGenProject / Compile / publishLocal)).value
)

Expand Down
3 changes: 0 additions & 3 deletions project/ReflectiveCodeGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ object ReflectiveCodeGen extends AutoPlugin {
}
}
}.value,
// Reload generators on each invocation
PB.cacheClassLoaders := false,
setCodeGenerator := loadAndSetGenerator(
// the magic sauce: use the output classpath from the the sbt-plugin project and instantiate generators from there
(fullClasspath in Compile in ProjectRef(file("."), "sbt-akka-grpc")).value,
Expand All @@ -76,7 +74,6 @@ object ReflectiveCodeGen extends AutoPlugin {
codeGeneratorSettings.value,
PB.targets.value.asInstanceOf[ListBuffer[Target]],
scalaBinaryVersion.value),
PB.recompile ~= (_ => true),
PB.protoSources in Compile := PB.protoSources.value ++ Seq(
PB.externalIncludePath.value,
sourceDirectory.value / "proto"))) ++ Seq(
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enablePlugins(BuildInfoPlugin)

val sbtProtocV = "1.0.0"
val sbtProtocV = "1.0.1"

buildInfoKeys := Seq[BuildInfoKey]("sbtProtocVersion" -> sbtProtocV)

Expand Down

0 comments on commit a648ac9

Please sign in to comment.