Skip to content

Commit 9ee3e81

Browse files
committed
Apply Dokka to the root project for aggregation
1 parent c4ef327 commit 9ee3e81

File tree

6 files changed

+57
-4
lines changed

6 files changed

+57
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
public final class io/technoirlab/conventions/root/RootConventionPlugin : org/gradle/api/Plugin {
2+
public fun <init> ()V
3+
public synthetic fun apply (Ljava/lang/Object;)V
4+
public fun apply (Lorg/gradle/api/Project;)V
5+
}
6+

root-conventions/build.gradle.kts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
plugins {
2+
id("io.technoirlab.conventions.gradle-plugin")
3+
}
4+
5+
gradlePluginConfig {
6+
buildFeatures {
7+
abiValidation = true
8+
}
9+
}
10+
11+
dependencies {
12+
implementation(libs.dokka.gradle.plugin)
13+
}
14+
15+
gradlePlugin {
16+
plugins {
17+
register("rootConventions") {
18+
id = "io.technoirlab.conventions.root"
19+
implementationClass = "io.technoirlab.conventions.root.RootConventionPlugin"
20+
}
21+
}
22+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package io.technoirlab.conventions.root
2+
3+
import io.technoirlab.conventions.root.configuration.configureDokka
4+
import org.gradle.api.Plugin
5+
import org.gradle.api.Project
6+
7+
class RootConventionPlugin : Plugin<Project> {
8+
override fun apply(project: Project) = with(project) {
9+
pluginManager.apply("org.gradle.lifecycle-base")
10+
11+
configureDokka()
12+
}
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package io.technoirlab.conventions.root.configuration
2+
3+
import org.gradle.api.Project
4+
import org.gradle.kotlin.dsl.configure
5+
import org.jetbrains.dokka.gradle.DokkaExtension
6+
7+
internal fun Project.configureDokka() {
8+
pluginManager.apply("org.jetbrains.dokka")
9+
10+
extensions.configure(DokkaExtension::class) {
11+
dokkaPublications.named("html") {
12+
outputDirectory.set(layout.projectDirectory.dir("docs"))
13+
}
14+
}
15+
}

settings-conventions/src/main/kotlin/io/technoirlab/conventions/settings/SettingsConventionPlugin.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ class SettingsConventionPlugin : Plugin<Settings> {
2727
rootProject.name = config.projectId.get()
2828
}
2929

30-
gradle.rootProject {
31-
pluginManager.apply("org.gradle.lifecycle-base")
32-
}
33-
3430
gradle.lifecycle.beforeProject {
3531
configureMetadata(config.metadata)
3632
}

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ include(":common-conventions")
5252
include(":gradle-plugin-conventions")
5353
include(":jvm-conventions")
5454
include(":kotlin-multiplatform-conventions")
55+
include(":root-conventions")
5556
include(":settings-conventions")
5657
include(":libraries:gradle-extensions")
5758
include(":libraries:gradle-test-kit")

0 commit comments

Comments
 (0)