ocadaruma / sbt-reverse-dependency   0.2.0

MIT License GitHub

SBT plugin to show which projects are depend on a specific project in your multi-project build.

Scala versions: 2.12 2.10
sbt plugins: 1.x 0.13

sbt-reverse-dependency

Show which projects are depend on a specific project in your multi-project build.

Circle CI

Usage

Installation

Add the plugin in project/plugins.sbt:

addSbtPlugin("com.mayreh" % "sbt-reverse-dependency" % "0.2.0")

Print reverse dependency

For example, suppose that there is a multi-project sbt build defined by following build.sbt

lazy val root = project in file(".")

lazy val core = project
lazy val web = project.dependsOn(core)
lazy val batch = project.dependsOn(core)

Then, printReverseDependency task works as below.

$ sbt core/printReverseDependency
web
batch
$ sbt web/printReverseDependency    # print nothing
$ sbt batch/printReverseDependency  # print nothing

There is also reverseDependency task, which just return Seq[ResolvedProject].

Configurations

  • reverseDependencySeparator : Specify separator string for printing projects. \n as default.
  • printBaseDirectory : Print base directory instead of project ID. false as default.
  • printAbsolutePath : Print absolute path instead of related path. (only affects when printBaseDirectory is true) false by default.

License

Published under the MIT License.