Skip to content

Commit

Permalink
fix: use / as path separator for all OS
Browse files Browse the repository at this point in the history
  • Loading branch information
goofyz committed Jun 5, 2024
1 parent a7b5154 commit 9e7ae97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build-logic/convention/src/main/kotlin/DataChecksumsPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class DataChecksumsPlugin : Plugin<Project> {
?: mutableMapOf()

fun File.allParents(): List<File> =
if (parentFile == null || parentFile.path in map) {
if (parentFile == null || parentFile.invariantSeparatorsPath in map) {
listOf()
} else {
listOf(parentFile) + parentFile.allParents()
Expand All @@ -110,7 +110,7 @@ class DataChecksumsPlugin : Plugin<Project> {
}
logger.log(LogLevel.DEBUG, "${change.changeType}: ${change.normalizedPath}")
val relativeFile = change.file.relativeTo(file.parentFile)
val key = relativeFile.path
val key = relativeFile.invariantSeparatorsPath
if (change.changeType == ChangeType.REMOVED) {
map.remove(key)
} else {
Expand All @@ -120,7 +120,7 @@ class DataChecksumsPlugin : Plugin<Project> {
// calculate dirs
inputDir.asFileTree.forEach {
it.relativeTo(file.parentFile).allParents().forEach { p ->
map[p.path] = ""
map[p.invariantSeparatorsPath] = ""
}
}
serialize(map.toSortedMap())
Expand Down

0 comments on commit 9e7ae97

Please sign in to comment.