mirror of https://github.com/sbt/sbt.git
added saveAsDot method to IvyGraphMLDependencies that generates a simple dot file
This commit is contained in:
parent
4bc9e3f7df
commit
b7ae723423
|
|
@ -195,6 +195,20 @@ object IvyGraphMLDependencies extends App {
|
|||
|
||||
XML.save(outputFile, xml)
|
||||
}
|
||||
def saveAsDot(graph : ModuleGraph, outputFile: File) : File = {
|
||||
|
||||
val edges = {
|
||||
for ( e <- graph.edges)
|
||||
yield
|
||||
"\t\"" + e._1.idString + "\" -> \"" + e._2.idString + "\""
|
||||
}.mkString("\n")
|
||||
|
||||
val dot = "digraph \"dependency-graph\" {\n" + edges + "\n}"
|
||||
|
||||
sbt.IO.write(outputFile, dot)
|
||||
outputFile
|
||||
}
|
||||
|
||||
def moduleIdFromElement(element: Node, version: String): ModuleId =
|
||||
ModuleId(element.attribute("organisation").get.text, element.attribute("name").get.text, version)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue