Skip to content

Support Gradle Configuration cache #2231

@TWiStErRob

Description

@TWiStErRob

Configuration cache is a new feature in Gradle that speeds up running repetitive tasks (during daily development) by storing the task graph on disk and loading it back. This requires certain actions from plugin authors to be compatible. For example not using specific types.

Describe the solution you'd like
With dokka, the problem is

- Task `:checkstyle:dokkaJavadoc` of type `org.jetbrains.dokka.gradle.DokkaTask`: cannot serialize object of type 'org.gradle.api.internal.artifacts.configurations.DefaultConfiguration', a subtype of 'org.gradle.api.artifacts.Configuration', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.3/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

The solution to this is a bit of refactoring the task to use cacheable types.
The first example in the docs might help.

Describe alternatives you've considered
@3flex tried #1800, but that probably needs more work.
Right now if developers / CI ever wants to execute Dokka, they have to disable configuration caching, e.g. with --no-configuration-cache.

Additional context
Repro:

  • Project with dokka configured on it
  • Run dokka with --configuration-cache on gradlew command line

Are you willing to provide a PR?
I don't have enough experience with this yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAn issue for a feature or an overall improvementrunner: Gradle pluginAn issue/PR related to Dokka's Gradle plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions