Skip to content

Commit

Permalink
Fix UnusedDependencyChecker Windows issue
Browse files Browse the repository at this point in the history
  • Loading branch information
majcherm-da committed Apr 5, 2019
1 parent 4b252e6 commit 59ae7ab
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class UnusedDependencyChecker(val global: Global) extends Plugin { self =>
var analyzerMode: AnalyzerMode = Error
var currentTarget: String = "NA"

val isWindows: Boolean = System.getProperty("os.name").toLowerCase.contains("windows")

override def init(options: List[String], error: (String) => Unit): Boolean = {
var directJars: Seq[String] = Seq.empty
var directTargets: Seq[String] = Seq.empty
Expand Down Expand Up @@ -66,7 +68,7 @@ class UnusedDependencyChecker(val global: Global) extends Plugin { self =>
private def unusedDependenciesFound: Set[String] = {
val usedJars: Set[AbstractFile] = findUsedJars
val directJarPaths = direct.keys.toSet
val usedJarPaths = usedJars.map(_.path)
val usedJarPaths = if (!isWindows) usedJars.map(_.path) else usedJars.map(_.path.replaceAll("\\\\", "/"))

val usedTargets = usedJarPaths
.map(direct.get)
Expand Down

0 comments on commit 59ae7ab

Please sign in to comment.