From 8e79fc96b5cb7ca2ceea3c11a48cc1aa50fc971f Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Tue, 14 Feb 2023 13:45:08 +0100 Subject: [PATCH] make sure to include resources in protobuf-v3 assembly (#174) --- build.sbt | 7 ++++--- project/plugins.sbt | 5 +---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index 7816596ee5..6504f10d29 100644 --- a/build.sbt +++ b/build.sbt @@ -367,7 +367,7 @@ lazy val protobufV3 = pekkoModule("protobuf-v3") // https://github.com/sbt/sbt-assembly/issues/400 .inLibrary(Dependencies.Compile.Provided.protobufRuntime) .inProject), - assembly / assemblyOption := (assembly / assemblyOption).value.withIncludeScala(false).withIncludeBin(false), + assembly / assemblyOption := (assembly / assemblyOption).value.withIncludeScala(false).withIncludeBin(true), autoScalaLibrary := false, // do not include scala dependency in pom exportJars := true, // in dependent projects, use assembled and shaded jar makePomConfiguration := makePomConfiguration.value @@ -377,8 +377,9 @@ lazy val protobufV3 = pekkoModule("protobuf-v3") ReproducibleBuildsPlugin.postProcessJar(OsgiKeys.bundle.value)), Compile / packageBin := ReproducibleBuildsPlugin .postProcessJar((Compile / assembly).value), // package by running assembly - // Prevent cyclic task dependencies, see https://github.com/sbt/sbt-assembly/issues/365 - assembly / fullClasspath := (Runtime / managedClasspath).value, // otherwise, there's a cyclic dependency between packageBin and assembly + // Prevent cyclic task dependencies, see https://github.com/sbt/sbt-assembly/issues/365 by + // redefining the fullClasspath with just what we need to avoid the cyclic task dependency + assembly / fullClasspath := (Runtime / managedClasspath).value ++ (Compile / products).value.map(Attributed.blank), assembly / test := {}, // assembly runs tests for unknown reason which introduces another cyclic dependency to packageBin via exportedJars description := "Apache Pekko Protobuf V3 is a shaded version of the protobuf runtime. Original POM: https://github.com/protocolbuffers/protobuf/blob/v3.9.0/java/pom.xml") diff --git a/project/plugins.sbt b/project/plugins.sbt index fd43610df5..02197aadbc 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,7 +1,4 @@ -libraryDependencies += Defaults.sbtPluginExtra( - "com.eed3si9n" % "sbt-assembly" % "1.2.0", - (pluginCrossBuild / sbtBinaryVersion).value, - (pluginCrossBuild / scalaBinaryVersion).value) +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.1") addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0") addSbtPlugin("com.lightbend.sbt" % "sbt-bill-of-materials" % "1.0.2")