Skip to content
This repository was archived by the owner on Dec 15, 2024. It is now read-only.

Commit 4bb7a0f

Browse files
committed
Updated publication
1 parent edd3765 commit 4bb7a0f

File tree

2 files changed

+77
-71
lines changed

2 files changed

+77
-71
lines changed

build.gradle.kts

Lines changed: 2 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
22
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33

44
plugins {
5-
`java-library`
6-
signing
7-
`maven-publish`
5+
id("kotest-publishing-conventions")
86
kotlin("jvm") version "1.6.21"
97
}
108

119
group = "io.kotest.extensions"
1210
version = Ci.version
1311

1412
repositories {
13+
mavenLocal()
1514
mavenCentral()
1615
maven {
1716
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
@@ -40,71 +39,3 @@ tasks.test {
4039
tasks.withType<KotlinCompile> {
4140
kotlinOptions.jvmTarget = "11"
4241
}
43-
44-
val signingKey: String? by project
45-
val signingPassword: String? by project
46-
47-
val publications: PublicationContainer = (extensions.getByName("publishing") as PublishingExtension).publications
48-
49-
signing {
50-
useGpgCmd()
51-
if (signingKey != null && signingPassword != null) {
52-
@Suppress("UnstableApiUsage")
53-
useInMemoryPgpKeys(signingKey, signingPassword)
54-
}
55-
if (Ci.isRelease) {
56-
sign(publications)
57-
}
58-
}
59-
60-
java {
61-
withJavadocJar()
62-
withSourcesJar()
63-
}
64-
65-
publishing {
66-
repositories {
67-
maven {
68-
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
69-
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
70-
name = "deploy"
71-
url = if (Ci.isRelease) releasesRepoUrl else snapshotsRepoUrl
72-
credentials {
73-
username = System.getenv("OSSRH_USERNAME") ?: ""
74-
password = System.getenv("OSSRH_PASSWORD") ?: ""
75-
}
76-
}
77-
}
78-
79-
publications {
80-
register("mavenJava", MavenPublication::class) {
81-
from(components["java"])
82-
pom {
83-
name.set("kotest-extensions-ktor-openapi")
84-
description.set("Kotest extension for generating open-API docs")
85-
url.set("https://www.github.com/kotest/kotest-extensions-ktor-openapi")
86-
87-
scm {
88-
connection.set("scm:git:http://www.github.com/kotest/kotest-extensions-ktor-openapi")
89-
developerConnection.set("scm:git:http://github.com/sksamuel")
90-
url.set("https://www.github.com/kotest/kotest-extensions-ktor-openapi")
91-
}
92-
93-
licenses {
94-
license {
95-
name.set("The Apache 2.0 License")
96-
url.set("https://opensource.org/licenses/Apache-2.0")
97-
}
98-
}
99-
100-
developers {
101-
developer {
102-
id.set("sksamuel")
103-
name.set("Stephen Samuel")
104-
email.set("[email protected]")
105-
}
106-
}
107-
}
108-
}
109-
}
110-
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
plugins {
2+
`java-library`
3+
`maven-publish`
4+
signing
5+
}
6+
7+
val signingKey: String? by project
8+
val signingPassword: String? by project
9+
10+
11+
val publications: PublicationContainer = (extensions.getByName("publishing") as PublishingExtension).publications
12+
13+
signing {
14+
useGpgCmd()
15+
if (signingKey != null && signingPassword != null) {
16+
@Suppress("UnstableApiUsage")
17+
useInMemoryPgpKeys(signingKey, signingPassword)
18+
}
19+
if (Ci.isRelease) {
20+
sign(publications)
21+
}
22+
}
23+
24+
java {
25+
withJavadocJar()
26+
withSourcesJar()
27+
}
28+
29+
publishing {
30+
repositories {
31+
maven {
32+
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
33+
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
34+
name = "deploy"
35+
url = if (Ci.isRelease) releasesRepoUrl else snapshotsRepoUrl
36+
credentials {
37+
username = System.getenv("OSSRH_USERNAME") ?: ""
38+
password = System.getenv("OSSRH_PASSWORD") ?: ""
39+
}
40+
}
41+
}
42+
43+
publications {
44+
register("mavenJava", MavenPublication::class) {
45+
from(components["java"])
46+
pom {
47+
name.set("kotest-extensions-clock")
48+
description.set("Kotest Extension for Java time Clocks")
49+
url.set("http://www.github.com/kotest/kotest-extensions-clock")
50+
51+
scm {
52+
connection.set("scm:git:http://www.github.com/kotest/kotest-extensions-clock")
53+
developerConnection.set("scm:git:http://github.com/sksamuel")
54+
url.set("http://www.github.com/kotest/kotest-extensions-clock")
55+
}
56+
57+
licenses {
58+
license {
59+
name.set("The Apache 2.0 License")
60+
url.set("https://opensource.org/licenses/Apache-2.0")
61+
}
62+
}
63+
64+
developers {
65+
developer {
66+
id.set("sksamuel")
67+
name.set("Stephen Samuel")
68+
email.set("[email protected]")
69+
}
70+
}
71+
}
72+
73+
}
74+
}
75+
}

0 commit comments

Comments
 (0)