Skip to content

Commit

Permalink
* Add assemblyUnzipDirectory to AssemblyOption to use a different dir…
Browse files Browse the repository at this point in the history
…ectory for unzipping jars

* Add assemblyCacheDependency task to unzip jar dependencies as a separate task
  • Loading branch information
er1c committed Oct 20, 2021
1 parent 9f1e4f1 commit 264ca8e
Show file tree
Hide file tree
Showing 16 changed files with 672 additions and 161 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,25 @@ lazy val app = (project in file("app"))
)
```


### Unzip Caching

When assembling an über artifact, that has many library dependencies, the unzip process can be very IO intensive. These unzipped directories are very suitable for CI systems to persist in between job runs.

```scala
lazy val app = (project in file("app"))
.settings(
assemblyUnzipDirectory := Some(localCacheDirectory.value / "sbt-assembly" / "dependencies"),
assemblyCacheUnzip := true, // this is the default setting
assemblyCacheUseHardLinks := true, // this is experimental but will use a hard link between the files in assemblyUnzipDirectory to assemblyDirectory to avoid additional copy IO
// more settings here ...
)
```

To populate the assemblyUnzipDirectory without a full assembly:

sbt assemblyCacheDependency

Other Things
------------

Expand Down
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ThisBuild / crossScalaVersions := Seq(scala212)
ThisBuild / scalaVersion := scala212

lazy val root = (project in file("."))
.enablePlugins(SbtPlugin) // ContrabandPlugin
.enablePlugins(SbtPlugin)
.settings(pomConsistency2021DraftSettings)
.settings(nocomma {
name := "sbt-assembly"
Expand All @@ -21,7 +21,6 @@ lazy val root = (project in file("."))
case "2.12" => "1.2.8"
}
}
Compile / generateContrabands / sourceManaged := baseDirectory.value / "src" / "main" / "contraband-scala"
})

ThisBuild / scmInfo := Some(
Expand Down
36 changes: 0 additions & 36 deletions src/main/contraband/AssemblyOption.contra

This file was deleted.

Loading

0 comments on commit 264ca8e

Please sign in to comment.