项目作者: mariussoutier

项目描述 :
sbt unpack plugin
高级语言: Scala
项目地址: git://github.com/mariussoutier/sbt-unpack.git
创建时间: 2017-10-06T15:01:38Z
项目社区:https://github.com/mariussoutier/sbt-unpack

开源协议:Apache License 2.0

下载


sbt-unpack

Simple plugin to unpack JARs in your project. Loosely based on ideas presented in Josh Suereth’s book
sbt in Action
Chapter 7
and packaged into an auto plugin.

Installation

Add this to plugins.sbt:

  1. addSbtPlugin("com.mariussoutier.sbt" % "sbt-unpack" % "0.9.5")

Usage

First, enable the plugin on the project you want to use it with.

  1. lazy val root = project(...)
  2. .enablePlugins(com.mariussoutier.sbt.UnpackPlugin)

Then run unpackJars manually or execute it automatically by adding to a generator, for example:

  1. import com.mariussoutier.sbt.UnpackKeys
  2. // Unpacks whenever you compile
  3. sourceGenerators in Compile += UnpackKeys.unpackJars
  4. // Or if you want to execute another task after unpacking
  5. 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:

  1. import com.mariussoutier.sbt.UnpackKeys
  2. import NameFilter._
  3. .settings(
  4. UnpackKeys.dependencyFilter := { (fileName: String) => fileName.startsWith("example-") },
  5. )