Checkstyle plugin: is "cacheFile" property supported?

I’m trying to migrate a project from Maven to Gradle. The project had a Checkstyle configuration with a custom checkstyle.xml file. Right now I’m getting build failures pointing to this part:

<module name="Checker">
  <module name="TreeWalker">
    <module name="FileContentsHolder"/>

    <property name="cacheFile" value="${checkstyle.cache.file}"/>

I can’t find how the checkstyle.cache.file property was set on Maven side, but I’m guessing the Maven plugin had a non-null default. Does Gradle Checkstyle plugin support the cacheFile property, or is there any other way to set it?

You wouldn’t really care about cacheFile itself as that part is handled entirely by checkstyle and the checkstyle configuration file and could even be hard-coded to a certain location. If you’re using a configuration property, in the context of the plugin, you only care about how setting that property is supported (i.e. checkstyle.cache.file, not cacheFile).

You can set as many configuration properties as you want. For example,

checkstyleMain {
    configProperties += ['checkstyle.cache.file': file('checkstyleCacheFile')]

Thanks, that’s definitely something I can work with!

Does checkstyle cachefile save any time in gradle?

Gradle 6.0.1, Checkstyle 8.27.
Adding <property name="cacheFile" value="${cache_file}"/> and (in Kotlin DSL)

configProperties = mapOf(
    "base_dir" to rootDir.toString(),
    "cache_file" to buildDir.resolve("checkstyle/cacheFile")

improves the check times dramatically.

Note: the above configuration is likely to play bad with build cache, however, that is a different story.