Kotlin / dokka

API documentation engine for Kotlin
https://kotl.in/dokka
Apache License 2.0
3.45k stars 411 forks source link

Consider supporting Gradle's configuration cache #1217

Open eskatos opened 4 years ago

eskatos commented 4 years ago

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 users experience.

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

The configuration cache is introduced in Gradle 6.6. This can already be tested using 6.6-rc-2.

eskatos commented 4 years ago

Given this plugin is currently being deeply reworked I didn't bother reporting what exact issues the "old" dokka or the "new" dokka have. Running a build with --configuration-cache will produce a report of the found problems.

sellmair commented 4 years ago

This is awesome. We try to implement this (probably even with #1194 )

eskatos commented 4 years ago

FYI, Kotlin master branch should now work with the configuration cache without emitting problems. You can use dev builds >= 1.4.20-dev-3361 in your tests.

3flex commented 3 years ago

There are still a couple of warnings when using the configuration cache with dokka plugin. The configuration cache report points to plugins and runtime properties in AbstractDokkaTask, because Configuration type is not serializable.

https://github.com/Kotlin/dokka/blob/ac4b818a8616e4de8f702167fe6ddbe911df5d24/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaTask.kt#L70-L74

I think the best thing is to setup the configurations when the tasks are created and set the classpath files there, but I'm not familiar with the dokka Gradle plugin internals and it's a bit more complex than I'm comfortable with otherwise I would attempt the change. But if runtime and plugins can be changed to FileCollection or ConfigurableFileCollection type then configuration cache should then be able to handle it.

JavierSegoviaCordoba commented 2 years ago

Any new update?

emartynov commented 1 year ago

It looks like there is no update on the configuration cache yet.

adam-enko commented 2 months ago

Hi all, I have an update.

We're planning to release a new version of Dokka Gradle Plugin (DGPv2 for short) in the Dokka 2.0.0 release. DGPv2 is based on Dokkatoo. The current Dokka Gradle Plugin (DGPv1) will become deprecated.

DGPv2 fully supports configuration cache and build cache!

We'll be releasing a version for previewing soon, along with a migration guide. So, watch this space...