This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 91d8aea7c4 Resolve checkstyle cache miss
91d8aea7c4 is described below

commit 91d8aea7c42b10c68767e2f0a2a955389477f03f
Author: Tyler Bertrand <[email protected]>
AuthorDate: Tue Sep 5 09:38:23 2023 -0500

    Resolve checkstyle cache miss
    
    Instead of the absolute path to checkstyle cacheFile which was causing a 
cache miss, use the relative path from configDir for cacheFile path
---
 .../src/main/kotlin/build-logic.checkstyle.gradle.kts             | 8 +++++---
 config/checkstyle/checkstyle.xml                                  | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/build-logic/verification/src/main/kotlin/build-logic.checkstyle.gradle.kts 
b/build-logic/verification/src/main/kotlin/build-logic.checkstyle.gradle.kts
index cfe92743fd..f5bdcd09f9 100644
--- a/build-logic/verification/src/main/kotlin/build-logic.checkstyle.gradle.kts
+++ b/build-logic/verification/src/main/kotlin/build-logic.checkstyle.gradle.kts
@@ -24,9 +24,12 @@ 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")
@@ -34,8 +37,7 @@ checkstyle {
         ?.let { toolVersion = it.get() }
 
     isShowViolations = true
-    // TOOD: move to /config
-    val configDir = File(rootDir, "config/checkstyle")
+
     configDirectory.set(configDir)
     configFile = configDir.resolve("checkstyle.xml")
 }
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index 64b890e240..e54989ba38 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -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"/>

Reply via email to