Slackbot
12/06/2023, 12:18 PMVampire
12/06/2023, 3:04 PMsubprojects { ... } (as well as allprojects { ... }, project(...) { ... } and similar) is highly discouraged and bad practice as it immediately introduces project coupling, disturbs more sophisticated Gradle features, and reduces clarity and maintainability.
Instead you should use convention plugins in buildSrc or an included build, for example implemented as precompiled script plugin.
Regarding the actual problem, if you configure for configDirectory the root directory, that is extremely bad, as then the whole directory tree becomes input files for the checkstyle tasks which has very bad consequences, including those warnings you get and the suggestions in those warnings are actually non-sense symptom treatment instead of fixing the root cause. So if you want to set configDirectory, make sure this is a dedicated directory like config/checkstyle that only has the Checkstyle configuration as content and nothing else. Otherwise, do not set the configDirectory, but only the configFile. To configure the suppressions file, you probably need to use some variable like in your "first" branch and set the property from the build script.Vampire
12/06/2023, 3:09 PMconfigProperties["rootDir"] = rootDir in checkstyle { ... } and ${rootDir}/suppressions.xml in the config file. But additionally you then need to declare the suppressions file as input for the checkstyle tasks, or the task will be considered up-to-date if only the suppressions file was changed.uleming
12/07/2023, 10:29 AMuleming
12/07/2023, 11:11 AM