Skip to content

Instantly share code, notes, and snippets.

@Sciss
Last active November 17, 2020 15:54
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 Sciss/49d1e9350ae9cd85dd50165e9b89e0a2 to your computer and use it in GitHub Desktop.
Save Sciss/49d1e9350ae9cd85dd50165e9b89e0a2 to your computer and use it in GitHub Desktop.
// output of 'sbt dependencyTree'
val e = scala.io.Source.fromFile(userHome/"Downloads"/"dep.txt")
.getLines.toList.filter(_.contains("+-de.sciss"))
.map { ln =>
val i = ln.indexOf("+-") + 2
val j = ln.indexOf(" ", i)
val k = ln.lastIndexOf(":", if (j < 0) ln.length else j)
ln.substring(i, k)
}
.sorted.distinct
e.foreach(println)
val f = e.map { s =>
val i = s.indexOf(":")
val j = s.indexOf("_", i) + 1
// if (j < i) println(s"ERROR: $s")
val k = if (j < i) s.substring(i + 1) else s.substring(i + 1, j) + "*"
s""" \"${s.substring(0, i)} $k\": \"Sciss/???\","""
}
f.foreach(println)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment