Skip to content

Commit 5b31d29

Browse files
committed
Standardise use of CanonicalPath
Location.scala uses AbstractFile.canonicalPath while ScoverageHtmlWriter.scala uses java.io.File.getAbsolutePath for file paths. This mean that there is a possibility (esp. Windows environment) that creation of reports will fail because the scoverage.coverage.xml created will contain paths with an upper case drive letter while ScoverageHtmlWriter will be using paths with a lower case drive letter.
1 parent 9e2834f commit 5b31d29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scalac-scoverage-plugin/src/main/scala/scoverage/report/ScoverageHtmlWriter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ScoverageHtmlWriter(sourceDirectory: File, outputDir: File) {
2323
coverage.packages.foreach(writePackage)
2424
}
2525

26-
private def relativeSource(src: String): String = src.replace(sourceDirectory.getAbsolutePath + File.separator, "")
26+
private def relativeSource(src: String): String = src.replace(sourceDirectory.getCanonicalPath + File.separator, "")
2727

2828
private def writePackage(pkg: MeasuredPackage): Unit = {
2929
// package overview files are written out using a filename that respects the package name

0 commit comments

Comments
 (0)