Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mariussoutier/sbt-unpack
sbt unpack plugin
https://github.com/mariussoutier/sbt-unpack
sbt sbt-plugin scala unzip
Last synced: 18 days ago
JSON representation
sbt unpack plugin
- Host: GitHub
- URL: https://github.com/mariussoutier/sbt-unpack
- Owner: mariussoutier
- License: apache-2.0
- Created: 2017-10-06T15:01:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T13:25:00.000Z (almost 7 years ago)
- Last Synced: 2024-11-07T18:03:16.470Z (2 months ago)
- Topics: sbt, sbt-plugin, scala, unzip
- Language: Scala
- Size: 13.7 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sbt-unpack
Simple plugin to unpack JARs in your project. Loosely based on ideas presented in Josh Suereth's book
[sbt in Action](https://www.manning.com/books/sbt-in-action)
[Chapter 7](https://github.com/jsuereth/sbt-in-action-examples/blob/master/chapter7/website/build.sbt)
and packaged into an auto plugin.## Installation
Add this to `plugins.sbt`:
```
addSbtPlugin("com.mariussoutier.sbt" % "sbt-unpack" % "0.9.5")
```## Usage
First, enable the plugin on the project you want to use it with.
```scala
lazy val root = project(...)
.enablePlugins(com.mariussoutier.sbt.UnpackPlugin)```
Then run `unpackJars` manually or execute it automatically by adding to a generator, for example:
```scala
import com.mariussoutier.sbt.UnpackKeys
// Unpacks whenever you compile
sourceGenerators in Compile += UnpackKeys.unpackJars
// Or if you want to execute another task after unpacking
sourceGenerators in Compile += Def.sequential(UnpackKeys.unpackJars, ...).taskValue
```## Configuration
| Key | Description |
| --------------------------- | ------------------------------------------------------------- |
| `dependenciesJarDirectory` | Location of the unpacked dependency JARs |
| `dependencyFilter` | Which dependencies to unpack |
| `fileExcludeFilter` | Files inside the JARs that should be excluded while unpacking |Example:
```scala
import com.mariussoutier.sbt.UnpackKeys
import NameFilter._
.settings(
UnpackKeys.dependencyFilter := { (fileName: String) => fileName.startsWith("example-") },
)
```