-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a4133d
commit ad06ae0
Showing
8 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,6 @@ | |
|
||
### Mac OS ### | ||
.DS_Store | ||
|
||
### Project ### | ||
/docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
plugins { | ||
id("ozone-dokka") | ||
id("ozone-multiplatform") | ||
id("ozone-publish") | ||
kotlin("plugin.serialization") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
build-logic/src/main/kotlin/sh/christian/plugin/DokkaPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package sh.christian.plugin | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.api.artifacts.VersionCatalogsExtension | ||
import org.gradle.kotlin.dsl.getByType | ||
import org.gradle.kotlin.dsl.withType | ||
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask | ||
|
||
@Suppress("unused") | ||
class DokkaPlugin : Plugin<Project> { | ||
override fun apply(target: Project) = target.applyPlugin() | ||
} | ||
|
||
private fun Project.applyPlugin() { | ||
plugins.apply("org.jetbrains.dokka") | ||
|
||
val libs = project.rootProject.extensions.getByType<VersionCatalogsExtension>().named("libs") | ||
|
||
tasks.withType<AbstractDokkaLeafTask>().configureEach { | ||
dokkaSourceSets.configureEach { | ||
reportUndocumented.set(true) | ||
suppressGeneratedFiles.set(false) | ||
|
||
externalDocumentationLink( | ||
url = "https://kotlinlang.org/api/kotlinx.serialization/", | ||
) | ||
|
||
val ktorVersion = libs.findVersion("ktor").get().displayName | ||
externalDocumentationLink( | ||
url = "https://api.ktor.io/older/$ktorVersion/ktor-client", | ||
packageListUrl = "https://api.ktor.io/older/$ktorVersion/package-list", | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters