Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Last active April 16, 2021 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuwei-k/3085e3c6b8162eb9f8e6e89a0f8322e5 to your computer and use it in GitHub Desktop.
Save xuwei-k/3085e3c6b8162eb9f8e6e89a0f8322e5 to your computer and use it in GitHub Desktop.
import scala.sys.process.Process
Seq(Compile, Test).map { x =>
(x / TaskKey[File]("dependencySvg")) := {
val output = target.value / s"dependencies-${x.name}.svg"
Process(Seq(
"dot",
"-o" + output.getAbsolutePath,
"-Tsvg",
(x / sbt.plugins.DependencyTreeKeys.dependencyDot).value.getAbsolutePath
)).!
Process(Seq("open", output.getAbsolutePath)).!
output
}
}
addDependencyTreePlugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment