Skip to content

Commit

Permalink
Cache output of assembly (#188)
Browse files Browse the repository at this point in the history
* Cache output of assembly
  • Loading branch information
Roiocam committed Apr 12, 2024
1 parent ff7682d commit a0cc422
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ lazy val cassandraLauncher = project
.settings(
name := "pekko-persistence-cassandra-launcher",
Compile / managedResourceDirectories += (cassandraBundle / target).value / "bundle",
Compile / managedResources += (cassandraBundle / assembly).value)
Compile / managedResources += (cassandraBundle / Compile / packageBin).value)

// This project doesn't get published directly, rather the assembled artifact is included as part of cassandraLaunchers
// resources
Expand All @@ -62,7 +62,19 @@ lazy val cassandraBundle = project
.exclude("commons-logging", "commons-logging"),
dependencyOverrides += "com.github.jbellis" % "jamm" % "0.3.3", // See jamm comment in https://issues.apache.org/jira/browse/CASSANDRA-9608
assembly / target := target.value / "bundle" / "pekko" / "persistence" / "cassandra" / "launcher",
assembly / assemblyJarName := "cassandra-bundle.jar")
assembly / assemblyJarName := "cassandra-bundle.jar",
Compile / packageBin := Def.taskDyn {
val store = streams.value.cacheStoreFactory.make("shaded-output")
val uberJarLocation = (assembly / assemblyOutputPath).value
val tracker = Tracked.outputChanged(store) { (changed: Boolean, file: File) =>
if (changed) {
Def.task {
(Compile / assembly).value
}
} else Def.task { file }
}
tracker(() => uberJarLocation)
}.value)

// Used for testing events by tag in various environments
lazy val endToEndExample = project
Expand Down

0 comments on commit a0cc422

Please sign in to comment.