From 97ba480e7183c6a06aa4d88bd851de5467e9b992 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 6 May 2020 16:13:58 -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 66caf8db..8da34d26 100644 --- a/build.gradle +++ b/build.gradle @@ -256,7 +256,7 @@ subprojects { subproject -> } checkstyle { - configFile = file("${rootDir}/src/checkstyle/checkstyle.xml") + configDirectory.set(rootProject.file("src/checkstyle")) toolVersion = '8.24' } diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index f716676f..59662a38 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -5,12 +5,12 @@ - + - +