Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for Dokka 2 #849

Merged
merged 4 commits into from
Oct 4, 2024
Merged

add support for Dokka 2 #849

merged 4 commits into from
Oct 4, 2024

Conversation

gabrielittner
Copy link
Collaborator

Comment on lines 413 to 418
val tasks = project.tasks.withType(DokkaTask::class.java)
tasks.singleOrNull()?.name ?: "dokkaHtml"
if (tasks.size == 0) {
"dokkaGeneratePublicationHtml"
} else {
tasks.singleOrNull()?.name ?: "dokkaHtml"
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With V2Enabled there will be 0 registered DokkaTask instances so we can use that as an indicator. When Dokka reached 2.1.0 we can make v2 mode required and simplify all of this to just JavadocJar.Dokka("dokkaGeneratePublicationHtml), like the javadoc block above.

Comment on lines 44 to 45
// TODO can always return true when dropping support for dokka 1
return plugins.none { it.id == dokkaPlugin.id }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Config cache doesn't like the provider.flatMap { tasks.named(it) } that we're doing right now. So until we're dropping support for Dokka 1 it will stay incompatible.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: Configuration cache is supported ONLY when pluginMode is V2Enabled/V2EnabledWithHelpers - so in so called DGP v2

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I've clarified/updated the comment

Copy link

@whyoleg whyoleg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for so fast support for DGPv2!
I've just added some more context in comments :)

Comment on lines 44 to 45
// TODO can always return true when dropping support for dokka 1
return plugins.none { it.id == dokkaPlugin.id }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: Configuration cache is supported ONLY when pluginMode is V2Enabled/V2EnabledWithHelpers - so in so called DGP v2

CHANGELOG.md Outdated
@@ -2,6 +2,12 @@

## 0.30.0 **UNRELEASED**

- Add support for Dokka 2.0.0-Beta
- Supports `org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled`
- When `pluginMode` is set to `V2EnabledWithHelpers` the old v1 tasks are used
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: in case of V2EnabledWithHelpers we do only create stub tasks which matches old types - they will fail to generate documentation.
Still, it should not really matter, as V2EnabledWithHelpers should only be used during migration and should not be committed or used afterwards

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look at this. I adjusted the v2 detection for the html plugin to be project.extensions.findByName("dokka") != null. That way we a) don't need this part about the migration and b) it fixes a configuration cache issue on our side. 9ecef5c

@gabrielittner gabrielittner merged commit dd9aa18 into main Oct 4, 2024
9 checks passed
@gabrielittner gabrielittner deleted the dokka2 branch October 4, 2024 15:02
@gabrielittner gabrielittner mentioned this pull request Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants