diff --git a/build.gradle.kts b/build.gradle.kts index 1241019..67bc02e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,28 @@ +import com.huanshankeji.cpnProject + tasks.wrapper { distributionType = Wrapper.DistributionType.ALL } + +plugins { + id("org.jetbrains.dokka") +} + +dependencies { + listOf( + "core", + "net", + "web", + + "arrow", + "coroutines", + "exposed", + "ktor:client", + "reflect", + "serialization", + "vertx", + "vertx:with-context-receivers", + ).forEach { + dokka(cpnProject(project, ":$it")) + } +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index bf8774c..6a6f9e2 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -19,4 +19,5 @@ dependencies { implementation(kotlin("gradle-plugin", "2.0.10")) implementation("com.huanshankeji:common-gradle-dependencies:0.8.0-20241016") // don't use a snapshot version in a main branch implementation("com.huanshankeji.team:gradle-plugins:0.6.0") // don't use a snapshot version in a main branch + implementation("org.jetbrains.dokka:dokka-gradle-plugin:2.0.0-Beta") } diff --git a/buildSrc/src/main/kotlin/common-conventions.gradle.kts b/buildSrc/src/main/kotlin/common-conventions.gradle.kts index 4241d0e..4d9114e 100644 --- a/buildSrc/src/main/kotlin/common-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/common-conventions.gradle.kts @@ -5,6 +5,7 @@ plugins { id("com.huanshankeji.team.with-group") id("maven-central") id("com.huanshankeji.team.default-github-packages-maven-publish") + id("dokka-convention") } version = projectVersion diff --git a/buildSrc/src/main/kotlin/dokka-convention.gradle.kts b/buildSrc/src/main/kotlin/dokka-convention.gradle.kts new file mode 100644 index 0000000..0ae0853 --- /dev/null +++ b/buildSrc/src/main/kotlin/dokka-convention.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("org.jetbrains.dokka") +} + +dokka { + // TODO + /* + moduleName.set("Huanshankeji Kotlin Common") + dokkaSourceSets.named("main") { + includes.from("README.md") + sourceLink { + localDirectory.set(file("src/main/kotlin")) + remoteUrl("https://github.com/huanshankeji/kotlin-common/tree/v${version}") + remoteLineSuffix.set("#L") + } + pluginsConfiguration.html { + footerMessage.set("(c) Yongshun Ye") + } + } + */ +} diff --git a/gradle.properties b/gradle.properties index 29f9702..5fc7d29 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,5 @@ kotlin.mpp.stability.nowarn=true # needed for the GitHub Actions CI org.gradle.jvmargs=-Xmx4G +# for Dokka +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled