Skip to content

Commit c1fef55

Browse files
committed
Upgrade dokka plugin
1 parent 0dc74aa commit c1fef55

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

build.gradle.kts

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import java.util.*
77

88
plugins {
99
kotlin("multiplatform") version "2.2.0"
10-
id("org.jetbrains.dokka") version "1.9.20"
10+
id("org.jetbrains.dokka") version "2.1.0"
1111
`maven-publish`
1212
}
1313

@@ -173,25 +173,21 @@ allprojects {
173173

174174
if (project.name !in listOf("native", "tests")) {
175175
afterEvaluate {
176-
val dokkaOutputDir = layout.buildDirectory.dir("dokka").get().asFile
177-
178-
tasks.dokkaHtml {
179-
outputDirectory.set(file(dokkaOutputDir))
180-
dokkaSourceSets {
181-
configureEach {
182-
val platformName = when (platform.get()) {
183-
Platform.jvm -> "jvm"
184-
Platform.js -> "js"
185-
Platform.native -> "native"
186-
Platform.common -> "common"
187-
Platform.wasm -> "wasm"
188-
else -> error("invalid platform ${platform.get()}")
189-
}
190-
displayName.set(platformName)
191-
192-
perPackageOption {
193-
matchingRegex.set(".*\\.internal.*") // will match all .internal packages and sub-packages
194-
suppress.set(true)
176+
val dokkaOutputDir = layout.buildDirectory.dir("dokka")
177+
178+
dokka {
179+
moduleName = "secp256k1-kmp"
180+
dokkaPublications.html {
181+
outputDirectory.set(dokkaOutputDir)
182+
dokkaSourceSets {
183+
configureEach {
184+
val platformName = analysisPlatform.get().name
185+
displayName.set(platformName)
186+
187+
perPackageOption {
188+
matchingRegex.set(".*\\.internal.*") // will match all .internal packages and sub-packages
189+
suppress.set(true)
190+
}
195191
}
196192
}
197193
}
@@ -202,7 +198,7 @@ allprojects {
202198
}
203199

204200
javadocJar {
205-
dependsOn(deleteDokkaOutputDir, tasks.dokkaHtml)
201+
dependsOn(deleteDokkaOutputDir, tasks.dokkaGenerate)
206202
from(dokkaOutputDir)
207203
}
208204
}

jni/android/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.gradle.kotlin.dsl.register
12
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
23

34
plugins {
@@ -65,7 +66,7 @@ afterEvaluate {
6566
create<MavenPublication>("android") {
6667
artifactId = "secp256k1-kmp-jni-android"
6768
from(components["release"])
68-
val sourcesJar = task<Jar>("sourcesJar") {
69+
val sourcesJar = tasks.register<Jar>("sourcesJar") {
6970
archiveClassifier.set("sources")
7071
from(android.sourceSets["main"].java.srcDirs)
7172
}

jni/jvm/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.gradle.kotlin.dsl.register
12
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
23

34
plugins {
@@ -52,7 +53,7 @@ publishing {
5253
create<MavenPublication>("jvm") {
5354
artifactId = "secp256k1-kmp-jni-jvm-extract"
5455
from(components["java"])
55-
val sourcesJar = task<Jar>("sourcesJar") {
56+
val sourcesJar = tasks.register<Jar>("sourcesJar") {
5657
archiveClassifier.set("sources")
5758
}
5859
artifact(sourcesJar)

0 commit comments

Comments
 (0)