-
Notifications
You must be signed in to change notification settings - Fork 648
Migrate to DGPv2 #3005
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
base: dev
Are you sure you want to change the base?
Migrate to DGPv2 #3005
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
import org.jetbrains.dokka.gradle.* | ||
import java.net.URI | ||
|
||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
@@ -18,62 +11,24 @@ dependencies { | |
dokkaPlugin(provider { extens.getByType<VersionCatalogsExtension>().named("libs").findLibrary("dokka.pathsaver").get().get() }) | ||
} | ||
|
||
tasks.withType<DokkaTaskPartial>().named("dokkaHtmlPartial") { | ||
outputDirectory.set(file("build/dokka")) | ||
|
||
|
||
pluginsMapConfiguration.put("org.jetbrains.dokka.base.DokkaBase", """{ "templatesDir": "${rootDir.resolve("dokka-templates").canonicalPath.replace('\\', '/')}" }""") | ||
|
||
dokkaSourceSets { | ||
configureEach { | ||
includes.from(rootDir.resolve("dokka/moduledoc.md").path) | ||
|
||
perPackageOption { | ||
matchingRegex.set("kotlinx\\.serialization(\$|\\.).*") | ||
reportUndocumented.set(true) | ||
skipDeprecated.set(true) | ||
} | ||
|
||
// Internal API | ||
perPackageOption { | ||
matchingRegex.set("kotlinx\\.serialization.internal(\$|\\.).*") | ||
suppress.set(true) | ||
} | ||
|
||
// Internal JSON API | ||
perPackageOption { | ||
matchingRegex.set("kotlinx\\.serialization.json.internal(\$|\\.).*") | ||
suppress.set(true) | ||
reportUndocumented.set(false) | ||
} | ||
|
||
// Workaround for typealias | ||
perPackageOption { | ||
matchingRegex.set("kotlinx\\.serialization.protobuf.internal(\$|\\.).*") | ||
suppress.set(true) | ||
reportUndocumented.set(false) | ||
} | ||
|
||
// Deprecated migrations | ||
perPackageOption { | ||
matchingRegex.set("kotlinx\\.protobuf(\$|\\.).*") | ||
reportUndocumented.set(true) | ||
skipDeprecated.set(true) | ||
} | ||
dokka { | ||
pluginsConfiguration.html { | ||
templatesDir = rootDir.resolve("dokka-templates") | ||
} | ||
|
||
// Deprecated migrations | ||
perPackageOption { | ||
matchingRegex.set("org\\.jetbrains\\.kotlinx\\.serialization\\.config(\$|\\.).*") | ||
reportUndocumented.set(false) | ||
skipDeprecated.set(true) | ||
} | ||
dokkaSourceSets.configureEach { | ||
includes.from(rootDir.resolve("dokka/moduledoc.md").path) | ||
reportUndocumented = true | ||
skipDeprecated = true | ||
|
||
sourceLink { | ||
localDirectory.set(rootDir) | ||
perPackageOption { | ||
matchingRegex = ".*\\.internal(\\..*)?" | ||
suppress = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reportUndocumented = false ? |
||
} | ||
|
||
remoteUrl.set(URI("https://github.com/Kotlin/kotlinx.serialization/tree/master").toURL()) | ||
remoteLineSuffix.set("#L") | ||
} | ||
sourceLink { | ||
localDirectory = rootDir | ||
remoteUrl("https://github.com/Kotlin/kotlinx.serialization/tree/master") | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,12 +33,9 @@ kotlin { | |
|
||
project.configureJava9ModuleInfo() | ||
|
||
tasks.named<DokkaTaskPartial>("dokkaHtmlPartial") { | ||
dokkaSourceSets { | ||
configureEach { | ||
externalDocumentationLink { | ||
url.set(URI("https://kotlin.github.io/kotlinx-io/").toURL()) | ||
} | ||
} | ||
dokka.dokkaSourceSets.configureEach { | ||
externalDocumentationLinks.register("kotlinx-io") { | ||
url("https://kotlinlang.org/api/kotlinx-io/") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JIC: old URL is not accessible anymore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Local build gives me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, that looks strange, local build works fine on my side. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added local package lists for both kotlinx-io and okio, so that the build will be less dependent on network failures. JIC: Dokka by default still relies on downloading the package list of the stdlib. |
||
packageListUrl = file("dokka/kotlinx-io.package-list").toURI() | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$dokka.format:html-v1 | ||
$dokka.linkExtension:html | ||
|
||
module:kotlinx-io-bytestring | ||
kotlinx.io.bytestring | ||
module:kotlinx-io-core | ||
kotlinx.io | ||
kotlinx.io.files | ||
module:kotlinx-io-okio | ||
kotlinx.io.okio |
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.
Previously, there were multiple
perPackageOption
- most of them are obsolete or separate configurations forinternal
package. So, obsolete were removed andinternal
are handled by one regex nowThere 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.
Are
@Deprecated
declarations skipped now by default?Uh oh!
There was an error while loading. Please reload this page.
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.
Nope, only
HIDDEN
ones. Looks like I missed the flag during refactoringIs it desirable behavior to skip deprecated with
WARNING
andERROR
declarations in all modules?Uh oh!
There was an error while loading. Please reload this page.
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.
I've brought back
skipDeprecated = true