You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by ro...@apache.org on 2024/04/12 10:50:07 UTC

(pekko-persistence-cassandra) branch main updated: Cache output of assembly (#188)

This is an automated email from the ASF dual-hosted git repository.

roiocam pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-persistence-cassandra.git


The following commit(s) were added to refs/heads/main by this push:
     new a0cc422  Cache output of assembly (#188)
a0cc422 is described below

commit a0cc422f6f7ca5b6df1346eb8d707e3b58b275c1
Author: AndyChen(Jingzhang) <iR...@gmail.com>
AuthorDate: Fri Apr 12 18:50:01 2024 +0800

    Cache output of assembly (#188)
    
    * Cache output of assembly
---
 build.sbt | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/build.sbt b/build.sbt
index 697ca55..e865b2a 100644
--- a/build.sbt
+++ b/build.sbt
@@ -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
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org