This repository was archived by the owner on Jan 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
109 lines (94 loc) · 2.88 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`java-library`
signing
`maven-publish`
kotlin("jvm") version "1.8.21"
}
group = "io.kotest.extensions"
version = Ci.version
repositories {
mavenCentral()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
}
dependencies {
api("io.ktor:ktor-http:2.2.4")
implementation(libs.wiremock)
implementation(libs.kotest.api)
testImplementation(libs.kotest.runner)
testImplementation(libs.kotest.assertions)
testImplementation("io.ktor:ktor-client-apache:2.2.4")
}
tasks.test {
useJUnitPlatform()
testLogging {
showExceptions = true
showStandardStreams = true
exceptionFormat = TestExceptionFormat.FULL
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
val signingKey: String? by project
val signingPassword: String? by project
val publications: PublicationContainer = (extensions.getByName("publishing") as PublishingExtension).publications
signing {
useGpgCmd()
if (signingKey != null && signingPassword != null) {
@Suppress("UnstableApiUsage")
useInMemoryPgpKeys(signingKey, signingPassword)
}
if (Ci.isRelease) {
sign(publications)
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
repositories {
maven {
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
name = "deploy"
url = if (Ci.isRelease) releasesRepoUrl else snapshotsRepoUrl
credentials {
username = System.getenv("OSSRH_USERNAME") ?: ""
password = System.getenv("OSSRH_PASSWORD") ?: ""
}
}
}
publications {
register("mavenJava", MavenPublication::class) {
from(components["java"])
pom {
name.set("kotest-extensions-httpstub")
description.set("Kotest extension for stubbing http services")
url.set("https://www.github.com/kotest/kotest-extensions-httpstub")
scm {
connection.set("scm:git:http://www.github.com/kotest/kotest-extensions-httpstub")
developerConnection.set("scm:git:http://github.com/sksamuel")
url.set("https://www.github.com/kotest/kotest-extensions-httpstub")
}
licenses {
license {
name.set("The Apache 2.0 License")
url.set("https://opensource.org/licenses/Apache-2.0")
}
}
developers {
developer {
id.set("sksamuel")
name.set("Stephen Samuel")
email.set("[email protected]")
}
}
}
}
}
}