diff --git a/project/build.properties b/project/build.properties index 817bc38d..43b8278c 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.9 +sbt.version=0.13.11 diff --git a/project/plugins.sbt b/project/plugins.sbt index 33096ea7..d807a3f1 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,6 +2,6 @@ resolvers += Classpaths.sbtPluginReleases addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.3.2") -addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.8.5") diff --git a/scalac-scoverage-plugin/src/main/scala/scoverage/report/BaseReportWriter.scala b/scalac-scoverage-plugin/src/main/scala/scoverage/report/BaseReportWriter.scala index e16d133b..8d3b1759 100644 --- a/scalac-scoverage-plugin/src/main/scala/scoverage/report/BaseReportWriter.scala +++ b/scalac-scoverage-plugin/src/main/scala/scoverage/report/BaseReportWriter.scala @@ -10,20 +10,22 @@ class BaseReportWriter(sourceDirectories: Seq[File], outputDir: File) { /** * Converts absolute path to relative one if any of the source directories is it's parent. * If there is no parent directory, the path is returned unchanged (absolute). - * + * * @param src absolute file path in canonical form */ def relativeSource(src: String): String = relativeSource(src, formattedSourcePaths) private def relativeSource(src: String, sourcePaths: Seq[String]): String = { + // We need the canonical path for the given src because our formattedSourcePaths are canonical + val canonicalSrc = new File(src).getCanonicalPath val sourceRoot: Option[String] = sourcePaths.find( - sourcePath => src.startsWith(sourcePath) + sourcePath => canonicalSrc.startsWith(sourcePath) ) sourceRoot match { - case Some(path: String) => src.replace(path, "") + case Some(path: String) => canonicalSrc.replace(path, "") case _ => val fmtSourcePaths: String = sourcePaths.mkString("'", "', '", "'") - throw new RuntimeException(s"No source root found for '$src' (source roots: $fmtSourcePaths)"); + throw new RuntimeException(s"No source root found for '$canonicalSrc' (source roots: $fmtSourcePaths)"); } }