forked from michaelbull/kotlin-retry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
159 lines (133 loc) · 4.87 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val ossrhUsername: String? by project
val ossrhPassword: String? by project
val signingKeyId: String? by project // must be the last 8 digits of the key
val signingKey: String? by project
val signingPassword: String? by project
description = "A higher-order function for retrying operations that may fail."
plugins {
`maven-publish`
signing
kotlin("jvm") version "1.7.10"
id("org.jetbrains.dokka") version "1.7.10"
id("com.github.ben-manes.versions") version "0.42.0"
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation(kotlin("stdlib"))
implementation("com.michael-bull.kotlin-result:kotlin-result:1.1.16")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4")
testImplementation("io.mockk:mockk:1.12.5")
}
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
listOf("alpha", "beta", "rc", "cr", "m", "eap", "pr", "dev").any {
candidate.version.contains(it, ignoreCase = true)
}
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-opt-in=kotlin.contracts.ExperimentalContracts")
}
}
tasks.withType<Test> {
failFast = true
useJUnitPlatform()
}
val dokkaJavadoc by tasks.existing(DokkaTask::class)
val javadocJar by tasks.registering(Jar::class) {
group = LifecycleBasePlugin.BUILD_GROUP
description = "Assembles a jar archive containing the Javadoc API documentation."
archiveClassifier.set("javadoc")
from(dokkaJavadoc)
}
val sourcesJar by tasks.registering(Jar::class) {
group = LifecycleBasePlugin.BUILD_GROUP
description = "Assembles a jar archive containing the main classes with sources."
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
publishing {
repositories {
maven {
if (project.version.toString().endsWith("SNAPSHOT")) {
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
} else {
setUrl("https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
publications {
register("mavenJava", MavenPublication::class) {
from(components["java"])
artifact(javadocJar.get())
artifact(sourcesJar.get())
pom {
name.set(project.name)
description.set(project.description)
url.set("https://github.com/michaelbull/kotlin-retry")
inceptionYear.set("2019")
licenses {
license {
name.set("ISC License")
url.set("https://opensource.org/licenses/isc-license.txt")
}
}
developers {
developer {
name.set("Michael Bull")
url.set("https://www.michael-bull.com")
}
}
contributors {
contributor {
name.set("Nicolas Dermine")
url.set("https://github.com/nicoder")
}
contributor {
name.set("Thorsten Hake")
url.set("http://www.thorsten-hake.com/")
}
contributor {
name.set("gnefedev")
url.set("https://github.com/gnefedev")
}
contributor {
name.set("cherrydev")
url.set("https://github.com/cherrydev")
}
}
scm {
connection.set("scm:git:https://github.com/michaelbull/kotlin-retry")
developerConnection.set("scm:git:[email protected]:michaelbull/kotlin-retry.git")
url.set("https://github.com/michaelbull/kotlin-retry")
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/michaelbull/kotlin-retry/issues")
}
ciManagement {
system.set("GitHub")
url.set("https://github.com/michaelbull/kotlin-retry/actions?query=workflow%3Aci")
}
}
}
}
}
signing {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications)
}