Skip to content

Commit

Permalink
Resolve checkstyle cache miss
Browse files Browse the repository at this point in the history
Instead of the absolute path to checkstyle cacheFile which was causing a cache miss, use the relative path from configDir for cacheFile path
  • Loading branch information
tylerbertrand authored and vlsi committed Sep 6, 2023
1 parent c94db97 commit 91d8aea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ plugins {
}

checkstyle {
// TOOD: move to /config
val configDir = File(rootDir, "config/checkstyle")

toolVersion = "10.12.1"
configProperties = mapOf(
"cache_file" to buildDir.resolve("checkstyle/cacheFile")
"cache_file" to buildDir.resolve("checkstyle/cacheFile").relativeTo(configDir)
)

providers.gradleProperty("checkstyle.version")
.takeIf { it.isPresent }
?.let { toolVersion = it.get() }

isShowViolations = true
// TOOD: move to /config
val configDir = File(rootDir, "config/checkstyle")

configDirectory.set(configDir)
configFile = configDir.resolve("checkstyle.xml")
}
Expand Down
2 changes: 1 addition & 1 deletion config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<module name="Checker">

<property name="cacheFile" value="${cache_file}"/>
<property name="cacheFile" value="${config_loc}/${cache_file}"/>

<property name="localeLanguage" value="en"/>
<property name="charset" value="UTF-8"/>
Expand Down

0 comments on commit 91d8aea

Please sign in to comment.