Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ class BruteForceSequenceMatcher(baseDir: File, sourcePath: String) extends PathS
// mock able helpers that allow us to remove the dependency to the real file system during tests

private[pathcleaner] def initSourceDir(): File = {
val sourceDir = new File(baseDir, sourcePath)
sourceDir
val sourceDir = new File(sourcePath)
if (sourceDir.isAbsolute) {
sourceDir
} else {
new File(baseDir, sourcePath)
}
}

private[pathcleaner] def initFilesMap(): Map[String, Seq[PathSeq]] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*/
package com.buransky.plugins.scoverage.sensor

import java.io.File

import com.buransky.plugins.scoverage.language.Scala
import com.buransky.plugins.scoverage.measure.ScalaMetrics
import com.buransky.plugins.scoverage.pathcleaner.{BruteForceSequenceMatcher, PathSanitizer}
Expand Down Expand Up @@ -183,8 +185,9 @@ class ScoverageSensor(settings: Settings, pathResolver: PathResolver, fileSystem

val inputOption: Option[InputPath] = if (isFile) {
val p = fileSystem.predicates()
val pathPredicate = if (new File(path).isAbsolute) p.hasAbsolutePath(path) else p.hasRelativePath(path)
Option(fileSystem.inputFile(p.and(
p.hasRelativePath(path),
pathPredicate,
p.hasLanguage(Scala.key),
p.hasType(InputFile.Type.MAIN))))
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
<version>1.0.4</version>
<version>1.3.0</version>
<configuration>
<highlighting>true</highlighting>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion samples/maven/combined-scala-java-sonar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
<version>1.0.4</version>
<version>1.3.0</version>
<configuration>
<highlighting>true</highlighting>
</configuration>
Expand Down