From 2b567706cb5b2d7451717fbc2c99f8556eb97929 Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Thu, 29 Apr 2021 11:59:27 +0200 Subject: [PATCH] build: more reliable reference to protobuf jar This avoids problems when the naming convention changes and also makes sure the file has actually been generated. --- project/Protobuf.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/project/Protobuf.scala b/project/Protobuf.scala index b3ea71dffa..3ca7224e9d 100644 --- a/project/Protobuf.scala +++ b/project/Protobuf.scala @@ -13,6 +13,8 @@ import sbt._ import sbt.util.CacheStoreFactory import Keys._ +import sbtassembly.AssemblyKeys._ + object Protobuf { val paths = SettingKey[Seq[File]]("protobuf-paths", "The paths that contain *.proto files.") val outputPaths = @@ -29,8 +31,7 @@ object Protobuf { outputPaths := Seq((sourceDirectory in Compile).value, (sourceDirectory in Test).value).map(_ / "java"), importPath := None, // this keeps intellij happy for files that use the shaded protobuf - Compile / unmanagedJars ++= Seq( - baseDirectory.value / ".." / "akka-protobuf-v3" / "target" / s"scala-${scalaBinaryVersion.value}" / s"akka-protobuf-v3-assembly-${version.value}.jar"), + Compile / unmanagedJars += (LocalProject("akka-protobuf-v3") / assembly).value, protoc := "protoc", protocVersion := "3.11.4", generate := {