diff --git a/.github/workflows/dokka-gh-pages.yml b/.github/workflows/dokka-gh-pages.yml index 2781a64..53c853c 100644 --- a/.github/workflows/dokka-gh-pages.yml +++ b/.github/workflows/dokka-gh-pages.yml @@ -2,9 +2,9 @@ name: Deploy the API documentation to GitHub Pages with Dokka on: push: - branches: [ "release" ] + branches: [ "plugins-release" ] pull_request: - branches: [ "release" ] + branches: [ "plugins-release" ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/build.gradle.kts b/build.gradle.kts index f2ba312..13392ad 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,10 @@ tasks.wrapper { distributionType = Wrapper.DistributionType.ALL } +plugins { + id("org.jetbrains.dokka") +} + evaluationDependsOnChildren() task("publishPluginProjectPlugins") { group = "plugin portal" @@ -9,3 +13,17 @@ task("publishPluginProjectPlugins") { val pluginProjects = subprojects.filter { it.name.endsWith("plugins") } pluginProjects.forEach { dependsOn(it.tasks.named("publishPlugins")) } } + + +dependencies { + /* + "common-gradle-dependencies" not added because it's published in a separate branch + "huanshankeji-team-gradle-plugins" not added because it's renamed and more cumbersome to configure, and also because it's only used by us + */ + listOf( + "kotlin-common-gradle-plugins", + "architecture-common-gradle-plugins", + ).forEach { + dokka(project(":$it")) + } +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 6b5e030..db36dd1 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -38,4 +38,6 @@ dependencies { // This is also a bootstrapping dependency. implementation("com.huanshankeji:common-gradle-dependencies:0.7.1-20240314-boostrap") { exclude("org.jetbrains.kotlin") } */ + + implementation("org.jetbrains.dokka:dokka-gradle-plugin:2.0.0-Beta") } diff --git a/buildSrc/src/main/kotlin/aligned-version-plugin-conventions.gradle.kts b/buildSrc/src/main/kotlin/aligned-version-plugin-conventions.gradle.kts index b8b0bbe..93ac02b 100644 --- a/buildSrc/src/main/kotlin/aligned-version-plugin-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/aligned-version-plugin-conventions.gradle.kts @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask plugins { id("conventions") + id("dokka-convention") } version = alignedPluginVersion 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..6bceb68 --- /dev/null +++ b/buildSrc/src/main/kotlin/dokka-convention.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("org.jetbrains.dokka") +} + +dokka { + dokkaSourceSets.all { + sourceLink { + remoteUrl("https://github.com/huanshankeji/kotlin-common/tree/v${version}/${project.name}") + remoteLineSuffix.set("#L") + } + } +} diff --git a/gradle.properties b/gradle.properties index 6e2c210..860f258 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,3 +2,5 @@ #kotlin.mpp.stability.nowarn=true # More memory is needed to build "architecture-common-gradle-plugins" since Kotlin 2.0.0 org.gradle.jvmargs=-Xmx2G +# for Dokka +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled