Created
January 25, 2016 16:10
-
-
Save EdgeCaseBerg/928a6a3e09e030ad7f3d to your computer and use it in GitHub Desktop.
sbt build task to see dependencies in a project.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://groups.google.com/forum/#!topic/simple-build-tool/rcPh-lWbDtk | |
lazy val versionReport = TaskKey[String]("version-report") | |
// Add this setting to your project. | |
versionReport <<= (externalDependencyClasspath in Compile, streams) map { | |
(cp: Seq[Attributed[File]], streams) => | |
val report = cp.map { | |
attributed => | |
attributed.get(Keys.moduleID.key) match { | |
case Some(moduleId) => "%40s %20s %10s %10s".format( | |
moduleId.organization, | |
moduleId.name, | |
moduleId.revision, | |
moduleId.configurations.getOrElse("") | |
) | |
case None => | |
// unmanaged JAR, just | |
attributed.data.getAbsolutePath | |
} | |
}.mkString("\n") | |
streams.log.info(report) | |
report | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment