Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coursier/sbt-shading
https://github.com/coursier/sbt-shading
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/coursier/sbt-shading
- Owner: coursier
- License: apache-2.0
- Created: 2020-05-11T18:44:31.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-13T14:38:51.000Z (about 1 month ago)
- Last Synced: 2024-11-13T15:33:33.156Z (about 1 month ago)
- Language: Scala
- Size: 112 KB
- Stars: 33
- Watchers: 8
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sbt-shading
[![Build Status](https://travis-ci.org/coursier/sbt-shading.svg?branch=master)](https://travis-ci.org/coursier/sbt-shading)
Enable the plugin with
```scala
addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.1")
```
in `project/plugins.sbt`. sbt-shading requires sbt >= 1.3.0.Then use settings like the following:
```scala
// Enable the plugin
enablePlugins(ShadingPlugin)// Add the dependencies to shade along the other (non-shaded) ones
libraryDependencies += "io.argonaut" %% "argonaut" % "6.2"
libraryDependencies += "org.scalameta" %%% "trees" % "4.8.5"// Tell the plugin to shade some dependencies.
// This also shades all their transitive dependencies, except those
// that are also brought by non-shaded dependencies.
// This merges those dependencies JARs in our output JAR, along with our
// classes.
// NB: the version itself doesn't matter but `%%` vs `%%%` does
shadedDependencies += "io.argonaut" %% "argonaut" % ""
shadedDependencies += "org.scalameta" %%% "trees" % ""// Tell the plugin to rename some namespaces in the output JAR.
// This renames any of our classes in this namespace, and adjusts
// any reference in this namespace.
// Be sure that all classes in this namespace are effectively
// in the output JAR.
shadingRules += ShadingRule.moveUnder("argonaut", "test.shaded")// Tell the plugin that the output JAR can contain classes in that
// namespace. Fail loudly if it finds any class outside of it.
validNamespaces += "test"
```