Last active
December 5, 2016 01:44
-
-
Save dwijnand/06884f7dc5b43fe9b3b7 to your computer and use it in GitHub Desktop.
Semi-port of "mvn dependency:list -Dsort=true -DoutputFile=deps.mvn.txt" to sbt
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
val dependencyList = taskKey[File]("") | |
val dependencyListDef = Def.task { | |
val f = baseDirectory.value / "deps.sbt.txt" | |
streams.value.log.info(s"Writing to $f") | |
IO.write(f, "\n") | |
IO.append(f, "The following files have been resolved:\n") | |
val cp = (managedClasspath in Test).value | |
val lines = cp map { att => | |
val md = att.metadata | |
val m = md.get(Keys.moduleID.key).get | |
val a = md.get(Keys.artifact.key).get | |
s" ${m.organization}:${m.name}:${a.extension}:${m.revision}" | |
} | |
lines.sorted.foreach(l => IO.append(f, s"$l\n")) | |
IO.append(f, "\n") | |
f | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment