Skip to content

Commit

Permalink
fix(evaluator): Use invariant paths in ProjectSourceRule
Browse files Browse the repository at this point in the history
This fixes `ProjectSourceRuleTest` on Windows.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Dec 12, 2024
1 parent 94ba630 commit 64f323b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions evaluator/src/main/kotlin/ProjectSourceRule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,17 @@ open class ProjectSourceRule(
*/
fun projectSourceFindDirectories(vararg patterns: String): List<File> =
projectSourcesDir.walkBottomUp().filterTo(mutableListOf()) {
it.isDirectory && FileMatcher.match(patterns.asList(), it.relativeTo(projectSourcesDir).path)
val path = it.relativeTo(projectSourcesDir).invariantSeparatorsPath
it.isDirectory && FileMatcher.match(patterns.asList(), path)
}

/**
* Return all files from the project's source tree which match any of the provided [glob expressions][patterns].
*/
fun projectSourceFindFiles(vararg patterns: String): List<File> =
projectSourcesDir.walkBottomUp().filterTo(mutableListOf()) {
it.isFile && FileMatcher.match(patterns.asList(), it.relativeTo(projectSourcesDir).path)
val path = it.relativeTo(projectSourcesDir).invariantSeparatorsPath
it.isFile && FileMatcher.match(patterns.asList(), path)
}

/**
Expand Down

0 comments on commit 64f323b

Please sign in to comment.