mirror of
https://github.com/sbt/sbt.git
synced 2026-10-06 18:14:04 +02:00
minor improvement to use stripSuffix in DotGraph
This commit is contained in:
@@ -58,13 +58,8 @@ object DotGraph
|
||||
IO.writeLines(file, lines)
|
||||
}
|
||||
def sourceToString(roots: Iterable[File], source: File) =
|
||||
{
|
||||
val rawName = relativized(roots, source).trim
|
||||
if(rawName.endsWith(".scala"))
|
||||
rawName.substring(0, rawName.length - ".scala".length)
|
||||
else
|
||||
rawName
|
||||
}
|
||||
relativized(roots, source).trim.stripSuffix(".scala").stripSuffix(".java")
|
||||
|
||||
private def relativized(roots: Iterable[File], path: File): String =
|
||||
{
|
||||
val relativized = roots.flatMap(root => Path.relativize(root, path))
|
||||
|
||||
Reference in New Issue
Block a user