Skip to content

Commit

Permalink
deps: Fully migrate to dokka v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuckame committed Feb 9, 2025
1 parent 6ef6e29 commit 0e85c85
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 26 deletions.
45 changes: 23 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ plugins {
id("maven-publish")
signing
alias(libs.plugins.dokka)
alias(libs.plugins.dokka.javadoc)
alias(libs.plugins.kover)
alias(libs.plugins.kotest)
alias(libs.plugins.github.versions)
alias(libs.plugins.nexus.publish)
alias(libs.plugins.spotless)
alias(libs.plugins.binary.compatibility.validator)
}

tasks {
javadoc
}

group = "com.github.avro-kotlin.avro4k"
version = Ci.publishVersion

Expand Down Expand Up @@ -47,33 +43,30 @@ kotlin {
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
tasks.named<Test>("test") {
tasks.withType<Test>().configureEach {
useJUnitPlatform()
filter {
isFailOnNoMatchingTests = false
}
testLogging {
showExceptions = true
showStandardStreams = true
events =
setOf(
org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED,
org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
)
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
tasks.named<Jar>("javadocJar") {
from(tasks.named("dokkaJavadoc"))

val dokkaJavadocJar by tasks.register<Jar>("dokkaJavadocJar") {
dependsOn(tasks.dokkaGeneratePublicationJavadoc)
from(tasks.dokkaGeneratePublicationJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
}

val dokkaHtmlJar by tasks.register<Jar>("dokkaHtmlJar") {
dependsOn(tasks.dokkaGeneratePublicationHtml)
from(tasks.dokkaGeneratePublicationHtml.flatMap { it.outputDirectory })
archiveClassifier.set("html-docs")
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifact(dokkaJavadocJar)
artifact(dokkaHtmlJar)
pom {
val projectUrl = "https://github.com/avro-kotlin/avro4k"
name.set("avro4k-core")
Expand Down Expand Up @@ -162,6 +155,14 @@ spotless {
}
}

task("actionsBeforeCommit") {
this.group = "verification"
dependsOn("apiDump")
dependsOn("spotlessApply")
dependsOn("test")
dependsOn("koverLog")
}

repositories {
mavenCentral()
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ kotest-property = { group = "io.kotest", name = "kotest-property", version.ref =

[plugins]
dokka = { id = "org.jetbrains.dokka", version = "2.0.0" }
kotest = { id = "io.kotest", version = "0.4.11" }
github-versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }
dokka-javadoc = { id = "org.jetbrains.dokka-javadoc", version = "2.0.0" }
github-versions = { id = "com.github.ben-manes.versions", version = "0.52.0" }
nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0" }
spotless = { id = "com.diffplug.spotless", version = "7.0.2" }
kover = { id = "org.jetbrains.kotlinx.kover", version = "0.8.1" }
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.14.0" }
kover = { id = "org.jetbrains.kotlinx.kover", version = "0.9.1" }
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.17.0" }

0 comments on commit 0e85c85

Please sign in to comment.