Show which projects are depend on a specific project in your multi-project build.
Add the plugin in project/plugins.sbt:
addSbtPlugin("com.mayreh" % "sbt-reverse-dependency" % "0.2.0")
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]
.
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 whenprintBaseDirectory
is true)false
by default.
Published under the MIT License.