Scalac plugin to detect classpath entries that aren't directly used
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 17 commits ahead of retronym:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example/src/main/scala/demo
plugin/src
project
.drone.yml
.drone.yml.sig
.gitignore
README.md
build.sbt
version.sbt

README.md

Classpath Shrinker

Build Status Maven Central

The Classpath Shrinker is a scalac plugin to detect unused classpath entries. It was originally created by Jason Zaugg as a better alternative to a commit which fulfilled the same functionality but required the instrumentation of symbol initializers.

This plugin is now maintained by the Scala Center.

The creation of this plugin was motivated by SCP-009: Improve direct dependency experience, and complements the improvements to stub error messages available in 2.12.2 and 2.11.9.

If you use Pants or Bazel, you may find this compiler plugin useful.

Add to your project

resolvers += Resolver.bintrayRepo("scalacenter", "releases")
addCompilerPlugin("ch.epfl.scala" %% "classpath-shrinker" % "0.1.1")

Once it's added, it will report if there are unused classpath entries automatically.

Output looks like:

[info] Compiling 1 Scala source to /drone/src/github.com/scalacenter/classpath-shrinker/example/target/scala-2.12/classes...
[warn] Detected the following unused classpath entries: 
[warn] /.coursier-cache/https/repo1.maven.org/maven2/com/google/guava/guava/21.0/guava-21.0.jar
[warn] one warning found