From f047f0528bdfa11731f2e8d0c73ff1aa7d374f68 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 6 May 2020 15:53:28 -0400 Subject: [PATCH] Fix Checkstyle to rely on the absolute path It turns out that relative path in the property `` in some cases is resolved against a Gradle deamon dir as a root for configs * Fix Checkstyle plugin config to use an absolute path in the project for the `configDirectory`. * Since `configDirectory` is exposed as a Checkstyle config variable, we can use its `${config_loc}` placeholder to rely on the absolute path in the project --- build.gradle | 2 +- src/checkstyle/checkstyle.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 3837c1a593..8c6ceda2c0 100644 --- a/build.gradle +++ b/build.gradle @@ -317,7 +317,7 @@ configure(javaProjects) { subproject -> } checkstyle { - configFile = file("$rootDir/src/checkstyle/checkstyle.xml") + configDirectory.set(rootProject.file("src/checkstyle")) toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '8.32' } diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index b953a4bb45..f98f6f3c35 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -5,12 +5,12 @@ - + - +