Skip to content

Commit

Permalink
rebase #1065
Browse files Browse the repository at this point in the history
Signed-off-by: Andy.Chen <[email protected]>
  • Loading branch information
Roiocam committed Jan 29, 2024
1 parent 201ed1d commit c921252
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,10 @@ lazy val protobufV3 = pekkoModule("protobuf-v3")
// 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
// Both assembly and osgi change the (Compile / packageBin) task define/semantic, so when we apply assembly then we have to
// let osgi first, and let osgi dependOn assembly.
OsgiKeys.explodedJars += assembly.value,
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")
.settings(PekkoDependWalker.protobufV3Settings)
.enablePlugins(DependWalkerPlugin)
Expand Down
4 changes: 2 additions & 2 deletions project/OSGi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ object OSGi {
OsgiKeys.requireCapability := "osgi.ee;filter:=\"(&(osgi.ee=JavaSE)(version>=1.8))\"",
// Recent versions of BND create corrupted jars so use JDK jar instead, see https://github.com/sbt/sbt-osgi/pull/81
OsgiKeys.packageWithJVMJar := true,
OsgiKeys.cacheStrategy := Some(OsgiKeys.CacheStrategy.Hash)
)
// Enable caching to avoid duplicate execution.
OsgiKeys.cacheStrategy := Some(OsgiKeys.CacheStrategy.Hash))

lazy val actor = osgiSettings ++ Seq(
OsgiKeys.exportPackage := Seq("org.apache.pekko*"),
Expand Down
8 changes: 8 additions & 0 deletions project/PekkoDependWalker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
*/

import Jdk9.CompileJdk9
import com.github.sbt.osgi.OsgiKeys
import io.github.roiocam.DependWalkerPlugin.autoImport.walkTasks
import io.github.roiocam.TaskDefine._
import io.github.roiocam._
import sbt.Keys._
import sbt._
import sbtassembly.AssemblyKeys

object PekkoDependWalker {

Expand All @@ -30,4 +32,10 @@ object PekkoDependWalker {
ScopeKeyMatcher((Compile / packageBin).scopedKey, CheckBoth),
ScopeKeyMatcher((CompileJdk9 / compile).scopedKey, CheckConfig))))

lazy val protobufV3Settings = Seq(
walkTasks := Seq(
WalkTask(
ScopeKeyMatcher(OsgiKeys.bundle.scopedKey, CheckTask),
ScopeKeyMatcher(AssemblyKeys.assembly.scopedKey, CheckTask))))

}
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")
addSbtPlugin("com.github.sbt" % "sbt-boilerplate" % "0.7.0")
addSbtPlugin("io.github.roiocam" % "sbt-depend-walker" % "0.1.0")

addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
addSbtPlugin("com.github.sbt" % "sbt-pull-request-validator" % "2.0.0")
Expand Down

0 comments on commit c921252

Please sign in to comment.