SonarQube Gradle Plugin should support the Gradle Configuration Cache

See https://github.com/gradle/gradle/issues/13490

The configuration cache is a feature that significantly improves build performance by caching the result of the configuration phase and reusing this for subsequent builds.

Implementing support for the configuration cache in this plugin would improve user experience.

See https://docs.gradle.org/nightly/userguide/configuration_cache.html

The configuration cache was introduced in Gradle 6.6 and it is critical that SonarQube’s Gradle plugin supports it

Thanks for letting us know.
Could you please clarify why you think it’s critical that the SonarQube’s plugin supports it?

IMHO it’s critical if we think about SRE. Config cache accelerates build time. When one of used plugins doesn’t support it then it can’t be created. For my company TTM is critical so every improvement of time spended in CI is very important.

Tech notes:

When I try to enable gradle’s config-cache in my project. I see following error:

1 problem was found storing the configuration cache.
- Task `:sonarqube` of type `org.sonarqube.gradle.SonarQubeTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/6.8.3/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

Here you can find documentation how to support config-cache:
https://docs.gradle.org/6.8.3/userguide/configuration_cache.html
https://docs.gradle.org/6.8.3/userguide/lazy_configuration.html

You break build cache support in line:

by executing getProject() at execution time.

Here you have manual how to get rid of it:
https://docs.gradle.org/6.8.3/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

PR has been added: