djice / sbt-unzip-plugin   1.0.2

Apache License 2.0 GitHub

Extract Zip dependencies with SBT

Scala versions: 2.13 2.12 2.11
sbt plugins: 1.0

sbt-unzip-plugin

==========

Extract Zip dependencies with SBT.

This plugin will extract all dependencies finishing by ".zip" extension in your base directory.

You can configure exclusion and the path where you want to extract the files.

Add plugin

LAST_VERSION: Maven Central

Add the plugin to project/plugins.sbt. For example:

addSbtPlugin("com.typesafe.sbt" % "sbt-unzip" % "LAST_VERSION")

In your build.sbt:

val root = (project in file(".")).enablePlugins(UnzipPlugin)

Configuration

Exclusion

By default, all dependency files finishing by "."zip" will be extract. You can make an exclusion list.

In your build.sbt, add the exclusion:

excludeDependencies in unzip := Seq(
  ExclusionRule("com.jcabi", "DynamaDBLocal")
)

Path of extraction

By default, the path of extraction is your project basedir, you can customize it.

In your build.sbt, add the exclusion:

pathToExtract in unzip := new sbt.File(baseDirectory.value.getPath  + "/target/universal/stage" )

Run

In your build.sbt, define when the task (extract of zip) should be executed, in this example, it's before compilation:

packageBin in Compile := (packageBin in Compile dependsOn unzip).value

Contribution policy

Contributions via GitHub pull requests are gladly accepted from their original author. Before we can accept pull requests, you will need to agree to the Typesafe Contributor License Agreement online, using your GitHub account.

License

This code is licensed under the Apache 2.0 License.