Skip to content

Commit e60b573

Browse files
committed
Update processing for new maven portal process
1 parent 9881d84 commit e60b573

File tree

2 files changed

+28
-72
lines changed

2 files changed

+28
-72
lines changed

build.gradle.kts

Lines changed: 25 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ plugins {
2828
alias(libs.plugins.benmanes.versions)
2929
alias(libs.plugins.kover)
3030
alias(libs.plugins.binarycompatibility)
31-
alias(libs.plugins.nexus)
3231
alias(libs.plugins.poko)
33-
`maven-publish`
34-
signing
32+
alias(libs.plugins.mavenpublish)
3533
}
3634

3735
group = "dev.jamesyox"
@@ -151,73 +149,39 @@ tasks.register("allDetekt") {
151149
}
152150
}
153151

154-
nexusPublishing {
155-
repositories {
156-
sonatype {
157-
val ossrhUsername: String? by project
158-
val ossrhPassword: String? by project
159-
val ossrhStagingProfileId: String? by project
152+
mavenPublishing {
153+
publishToMavenCentral()
154+
signAllPublications()
160155

161-
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
162-
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
156+
coordinates(groupId = project.group.toString(), artifactId = project.name)
163157

164-
username = ossrhUsername
165-
password = ossrhPassword
166-
stagingProfileId = ossrhStagingProfileId
167-
}
168-
}
169-
}
170-
171-
signing {
172-
isRequired = gradle.taskGraph.hasTask("publish")
173-
sign(publishing.publications)
174-
}
175-
176-
publishing {
177-
publications.withType<MavenPublication> {
178-
groupId = project.group.toString()
179-
version = libs.versions.current.get()
180-
val publication = this
181-
val dokkaJar = tasks.register<Jar>("${publication.name}DokkaJar") {
182-
group = JavaBasePlugin.DOCUMENTATION_GROUP
183-
description = "Assembles Kotlin docs with Dokka into a Javadoc jar"
184-
archiveClassifier.set("javadoc")
185-
from(tasks.named("dokkaHtml"))
186-
// Each archive name should be distinct, to avoid implicit dependency issues.
187-
// We use the same format as the sources Jar tasks.
188-
// https://youtrack.jetbrains.com/issue/KT-46466
189-
archiveBaseName.set("${archiveBaseName.get()}-${publication.name}")
190-
}
191-
192-
artifact(dokkaJar)
193-
194-
pom {
195-
name = project.name
196-
description = "TODO"
197-
url = "http://www.jamesyox.dev/kastro"
158+
pom {
159+
name = project.name
160+
description = "Calculates the time of solar and lunar events"
161+
url = "http://www.jamesyox.dev/kastro"
198162

199-
licenses {
200-
license {
201-
name = "Apache License, Version 2.0"
202-
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
203-
}
163+
licenses {
164+
license {
165+
name = "Apache License, Version 2.0"
166+
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
204167
}
168+
}
205169

206-
developers {
207-
developer {
208-
name = "James Yox"
209-
id = "yoxjames"
210-
url = "http://www.jamesyox.dev"
211-
}
170+
developers {
171+
developer {
172+
name = "James Yox"
173+
id = "yoxjames"
174+
url = "http://www.jamesyox.dev"
212175
}
176+
}
213177

214-
scm {
215-
connection = "scm:git:github.com/yoxjames/Kastro.git"
216-
developerConnection = "scm:git:ssh://github.com/yoxjames/Kastro.git"
217-
url = "https://github.com/yoxjames/Kastro"
218-
}
178+
scm {
179+
connection = "scm:git:github.com/yoxjames/Kastro.git"
180+
developerConnection = "scm:git:ssh://github.com/yoxjames/Kastro.git"
181+
url = "https://github.com/yoxjames/Kastro"
219182
}
220183
}
184+
221185
}
222186

223187
fun String.isNonStable(): Boolean {
@@ -232,11 +196,3 @@ tasks.dependencyUpdates {
232196
candidate.version.isNonStable()
233197
}
234198
}
235-
236-
/*
237-
apiValidation {
238-
@OptIn(kotlinx.validation.ExperimentalBCVApi::class)
239-
klib {
240-
enabled = true
241-
}
242-
}*/

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ kotlin-datetime = "0.6.2"
99
npm-joda-time = "2.20.0"
1010
kover = "0.9.1"
1111
binary-compatibility-validator = "0.18.0"
12-
nexus = "2.0.0"
1312
poko = "0.19.0"
13+
maven-publish = "0.34.0-rc6"
1414

1515
[libraries]
1616
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlin-datetime" }
@@ -24,5 +24,5 @@ dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
2424
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
2525
benmanes-versions = { id = "com.github.ben-manes.versions", version.ref = "benmanes-versions" }
2626
binarycompatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary-compatibility-validator"}
27-
nexus = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexus" }
28-
poko = { id = "dev.drewhamilton.poko", version.ref = "poko" }
27+
poko = { id = "dev.drewhamilton.poko", version.ref = "poko" }
28+
mavenpublish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }

0 commit comments

Comments
 (0)