Skip to content

Conversation

@adam-enko
Copy link
Member

The AndroidAdapter, JavaAdapter, and KotlinAdapters apply their configuration multiple times.

Currently, this is acceptable because a project cannot have multiple Android/Kotlin/Java plugins applied.
But the situation gets more complicated with AGP9 and kotlin-built-in.
The kotlin-built-in plugin uses an implementation of KotlinBasePlugin,
so the Android and Kotlin adapters could get applied multiple times, and some of their operations (registering DokkaSourceSets) aren't idempotent.

I also updated the JavaAdapter to use the same approach for consistency (it's not strictly necessary).


Also, group the plugin IDs into Sets, so they can be accessed at once without needing to remember which IDs should be accessed.

The AndroidAdapter, JavaAdapter, and KotlinAdapters apply their configuration multiple times.

Currently, this is acceptable because a project cannot have multiple Android/Kotlin/Java plugins applied.
But the situation gets more complicated with AGP9 and kotlin-built-in.
The kotlin-built-in plugin uses an implementation of `KotlinBasePlugin`,
so the Android and Kotlin adapters could get applied multiple times, and some of their operations (registering DokkaSourceSets) aren't idempotent.

I also updated the JavaAdapter to use the same approach for consistency (it's not strictly necessary).

---

Also, group the plugin IDs into Sets, so they can be accessed at once without needing to remember which IDs should be accessed.
@adam-enko adam-enko added the runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin label Nov 19, 2025
@adam-enko adam-enko force-pushed the adam/feat/dgp-apply-adapters-once branch from 45e9247 to c29ad27 Compare November 19, 2025 17:05
@adam-enko adam-enko marked this pull request as ready for review November 19, 2025 21:02
@adam-enko adam-enko force-pushed the adam/feat/dgp-apply-adapters-once branch from 1104755 to 9daa1b9 Compare November 20, 2025 11:46
@adam-enko adam-enko force-pushed the adam/feat/dgp-apply-adapters-once branch from 9daa1b9 to f271673 Compare November 20, 2025 11:46
(Adding them is not strictly related to this PR. They're added as part of the larger initiative of AGP9 support. We're not adding tests for them because I can't find any up-to-date examples, but they should just work.)
@adam-enko adam-enko merged commit a9b7e59 into master Nov 24, 2025
14 checks passed
@adam-enko adam-enko deleted the adam/feat/dgp-apply-adapters-once branch November 24, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants