Skip to content

Commit 6ca0874

Browse files
committed
Adapt Multiplatform publishing
1 parent b089b41 commit 6ca0874

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

library/build.gradle.kts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import org.jetbrains.dokka.gradle.DokkaBasePlugin
2-
31
plugins {
42
kotlin("multiplatform")
53
kotlin("plugin.serialization")
64
alias(libs.plugins.dokka)
5+
alias(libs.plugins.kover)
76
alias(libs.plugins.ktlint)
87
`maven-publish`
98
signing
10-
alias(libs.plugins.kover)
119
}
1210

1311
dependencies {
@@ -48,49 +46,51 @@ tasks.withType<GenerateModuleMetadata> {
4846
enabled = !isSnapshot()
4947
}
5048

51-
val dokkaHtmlJar by tasks.registering(Jar::class) {
52-
group = DokkaBasePlugin.TASK_GROUP
49+
val dokkaJavadocJar by tasks.registering(Jar::class) {
50+
group = JavaBasePlugin.DOCUMENTATION_GROUP
5351
description = "Assembles Kotlin docs with Dokka"
54-
archiveClassifier.set("javadoc")
52+
archiveClassifier = "javadoc"
5553
from(tasks.dokkaGeneratePublicationHtml)
5654
}
5755

5856
publishing {
5957
publications {
60-
create<MavenPublication>("library") {
61-
artifactId = "kotlinx-serialization-csv"
58+
withType<MavenPublication> {
59+
artifactId = artifactId.replace(project.name, "kotlinx-serialization-csv")
60+
61+
if (artifactId.endsWith("-jvm")) {
62+
artifact(dokkaJavadocJar)
63+
}
6264

6365
pom {
64-
name.set("kotlinx-serialization-csv")
65-
description.set("Library to easily use Kotlin Serialization to serialize to/from CSV.")
66-
url.set("https://github.com/brudaswen/serialization-csv/")
66+
name = "kotlinx-serialization-csv"
67+
description = "Library to easily use Kotlin Serialization to serialize to/from CSV."
68+
url = "https://github.com/brudaswen/serialization-csv/"
6769

6870
licenses {
6971
license {
70-
name.set("Apache License, Version 2.0")
71-
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
72+
name = "Apache License, Version 2.0"
73+
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
7274
}
7375
}
7476
developers {
7577
developer {
76-
id.set("brudaswen")
77-
name.set("Sven Obser")
78-
email.set("[email protected]")
78+
id = "brudaswen"
79+
name = "Sven Obser"
80+
7981
}
8082
}
8183
scm {
82-
connection.set("scm:git:git://github.com/brudaswen/kotlinx-serialization-csv.git")
83-
developerConnection.set("scm:git:ssh://[email protected]:brudaswen/kotlinx-serialization-csv.git")
84-
url.set("https://github.com/brudaswen/kotlinx-serialization-csv/")
84+
connection = "scm:git:git://github.com/brudaswen/kotlinx-serialization-csv.git"
85+
developerConnection =
86+
"scm:git:ssh://[email protected]:brudaswen/kotlinx-serialization-csv.git"
87+
url = "https://github.com/brudaswen/kotlinx-serialization-csv/"
8588
}
8689
issueManagement {
87-
system.set("GitHub Issues")
88-
url.set("https://github.com/brudaswen/kotlinx-serialization-csv/issues/")
90+
system = "GitHub Issues"
91+
url = "https://github.com/brudaswen/kotlinx-serialization-csv/issues/"
8992
}
9093
}
91-
92-
from(components["kotlin"])
93-
artifact(dokkaHtmlJar)
9494
}
9595
}
9696
}
@@ -102,7 +102,7 @@ signing {
102102
val signingPassword: String? by project
103103
useInMemoryPgpKeys(signingKey, signingPassword)
104104

105-
sign(publishing.publications["library"])
105+
sign(publishing.publications)
106106
}
107107

108108
kover {

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ plugins {
2020
}
2121

2222
dependencyResolutionManagement {
23-
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
23+
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
2424

2525
repositories {
2626
google()

0 commit comments

Comments
 (0)