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

update: DGPV2 migration guide #4025

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AlejandraPedroza
Copy link
Contributor

@AlejandraPedroza AlejandraPedroza commented Feb 10, 2025

This PR contains updates for the DGP V2 Migration guide.

The additions to the Migration guide are:

  • Add context for cases when people are not using convention plugins in their multi-module build.
  • Clarify a bit earlier that the formats you obtain now require adding more dependencies (if you want javadoc)
  • externalDocumentationLinks has changed API and it's missing in migration guide
  • Document Output directory for additional files
  • Document how to configure Dokka Plugins
  • Document how to configure custom Dokka Plugins
  • Document sourceLink
  • Highlight what are migration helpers in migration guide
  • Document the change of directory in DGPv2

Additionally, there are some fixes in the code format and indentation. Plus, the content within "Adjust configuration options" is now broken into single subsections instead of bullet points.

KT-72053 [Dokka] DGP v2 migration guide feedback

@AlejandraPedroza AlejandraPedroza force-pushed the DGPV2-update-migration-guide branch from f4b0526 to fb10fbd Compare February 10, 2025 14:11
@AlejandraPedroza AlejandraPedroza changed the title This PR contains updates for the DGP V2 Migration guide. update: DGPV2 migration guide Feb 11, 2025
```
```kotlin
plugins {
kotlin("jvm") version "1.9.25"
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could use here the latest stable Kotlin version (2.1.10)?


```kotlin
dokka {
this: DokkaExtension
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like something is broken in the snippet. The old one was:

tasks.dokkaHtml {
    dokkaSourceSets {
        configureEach {
            externalDocumentationLink {
                url = URL("https://example.com/docs/")
                packageListUrl = File("/path/to/package-list").toURI().toURL()
            }
        }
    }
}

// build.gradle.kts

plugins {
id("org.jetbrains.dokka") version "2.0.0-Beta"
Copy link
Contributor

Choose a reason for hiding this comment

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

We could drop Beta from version

}
```

### Configure custom Dokka plugins
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we promote the feature in the migration guide? I expect the minimal required amount of material to move projects from DGP v1 to DGP v2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is part of the feedback we got to update the migration guide. You can see in the feedback issue the comment addressed by @adam-enko as pointed here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

May be it makes more sense to only add a link to an example configuration which will be introduced in #3871 (and so possibly copy part of the text there to readme) instead of this big section here, as we don’t really want to promote using custom Dokka plugins :)

@OptIn(DokkaInternalApi::class)
abstract class DokkaScriptsPluginParameters @Inject constructor(
name: String
) : DokkaPluginParametersBaseSpec(name, "ca.solostudios.dokkascript.plugin.DokkaScriptsPlugin") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Who is ca.solostudios? I think we should avoid mentioning external namespaces.

includes.from("README.md")
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl("https://github.com/your-repo")
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency (set in all properties), maybe we could use remoteUrl.set(URI("https://github.com/your-repo")).

Copy link
Collaborator

@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.

Nice! Thank you!
There are some small comments from me, but overall looks good!

dokka {
dokkaPublications.html {
outputDirectory.set(layout.buildDirectory.dir("dokkaDir"))
The ability to set an output directory and include additional files, such as `README.md`, is still supported in
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe that the initial concern of user for this feedback (https://youtrack.jetbrains.com/issue/KT-72053/Dokka-DGP-v2-migration-guide-feedback#focus=Comments-27-10821114.0-0) was that previously Dokka configuration was split between dokkaHtml task and dokkaHtmlMultiModule task but with DGPv2 we do have single place (dokka extension) to configure both type of projects.
So I think that may be it would make sense to rephrase this to point to this moment instead of still supported wording.


New configuration:

DGP v2 replaces the JSON-based configuration with a type-safe DSL that is compatible with incremental builds.
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor: we could additionally place a link to a versioning example here—https://github.com/Kotlin/dokka/tree/master/examples/gradle-v2/versioning-multimodule-example

}
```

### Configure custom Dokka plugins
Copy link
Collaborator

Choose a reason for hiding this comment

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

May be it makes more sense to only add a link to an example configuration which will be introduced in #3871 (and so possibly copy part of the text there to readme) instead of this big section here, as we don’t really want to promote using custom Dokka plugins :)

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