-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 to Dokka 2.0.0 #4257
base: develop
Are you sure you want to change the base?
Update to Dokka 2.0.0 #4257
Conversation
Otherwise, fails with "Cannot run Project.afterEvaluate(Action) when the project is already evaluated."
NB: not tested, waits for KT-71784
// Workaround for https://github.com/Kotlin/dokka/issues/1833: make implicit dependency explicit | ||
tasks.named("dokkaHtmlPartial") { | ||
tasks.withType<DokkaBaseTask>() { | ||
dependsOn(jvmJar) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please could you try removing this workaround? It shouldn't be necessary in DGPv2.
If ./gradlew :dokkaGenerate
still complains, then please raise an issue.
Co-authored-by: Adam <[email protected]>
knitTask.dependsOn(dokkaTasks) | ||
} | ||
tasks.named("knitPrepare") { | ||
dependsOn("dokka") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the coroutines Gradle config have a task named dokka
? Or should this be dokkaGenerate
?
dokkaPlugin("org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version") | ||
|
||
subprojects.forEach { | ||
if (it.name !in projetsWithoutDokka) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typo.
if (it.name !in projetsWithoutDokka) { | |
if (it.name !in projectsWithoutDokka) { |
(I made a suggestion to make it easier to see the typo, but maybe other places in the code should be updated.)
) | ||
private fun DokkaExtension.setupDokkaTemplatesDir() { | ||
pluginsConfiguration.html { | ||
templatesDir = file(rootDir.toString().replace('\\', '/') + "/dokka-templates") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rootDir.resolve("dokka-templates")
|
||
// TODO: WA for KT-71784 | ||
dokkaSourceSets.matching { it.name == "commonMain" }.configureEach { | ||
suppress.set(true) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workaround could be removed after update to Dokka 2.0.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
some minor comments/questions
externalDocumentationLink { | ||
this.url = URL(url) | ||
packageListUrl = packageList.toPath().toUri().toURL() | ||
externalDocumentationLinks.register("api") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: because the name ("api"
) is fixed here, it's not possible to call Project::configureExternalLinks
multiple times in one project (there will be an error during register
call)
And at this point, it's called only once in every project, but it could change in future, so probably it could be better to provide this name explicitly in every project (as a parameter to a function, or may be just use value of url
instead of name) - so that if multiple links will be added in future, there will be no obscure errors
} | ||
} | ||
|
||
private fun Project.configureExternalLinks() { | ||
tasks.withType<DokkaTaskPartial>() { | ||
dokka { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: what is the reason why this manual linking to core
artifact exists here at all?
@@ -2,19 +2,14 @@ plugins { | |||
id("kotlinx-knit") | |||
} | |||
|
|||
// TODO check that roots are correct | |||
knit { | |||
siteRoot = "https://kotlinlang.org/api/kotlinx.coroutines" | |||
moduleRoots = listOf(".", "integration", "reactive", "ui") | |||
moduleDocs = "build/dokka/htmlPartial" | |||
dokkaMultiModuleRoot = "build/dokka/htmlMultiModule/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dokkaMultiModuleRoot = "build/dokka/htmlMultiModule/" | |
dokkaMultiModuleRoot = "build/dokka/html/" |
@@ -2,19 +2,14 @@ plugins { | |||
id("kotlinx-knit") | |||
} | |||
|
|||
// TODO check that roots are correct | |||
knit { | |||
siteRoot = "https://kotlinlang.org/api/kotlinx.coroutines" | |||
moduleRoots = listOf(".", "integration", "reactive", "ui") | |||
moduleDocs = "build/dokka/htmlPartial" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moduleDocs = "build/dokka/htmlPartial" | |
moduleDocs = "build/dokka-module/html/module" |
@@ -11,7 +11,9 @@ junit_version=4.12 | |||
junit5_version=5.7.0 | |||
knit_version=0.5.0 | |||
lincheck_version=2.18.1 | |||
dokka_version=1.9.20 | |||
dokka_version=2.0.0-Beta | |||
org.jetbrains.dokka.experimental.gradle.pluginMode=V2EnabledWithHelpers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
org.jetbrains.dokka.experimental.gradle.pluginMode=V2EnabledWithHelpers | |
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled |
helpers are not needed after migration
No description provided.