-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
135 lines (119 loc) · 4.27 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
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URL
val kotlinVersion: String by project
val ktorVersion: String by project
val kotestVersion: String by project
plugins {
kotlin("jvm") version "1.8.10"
id("org.jetbrains.dokka") version "1.8.10"
signing
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "1.0.0"
}
group = "com.michaelstrasser"
version = "0.2.15"
repositories {
mavenCentral()
// For kotlinx-html used by Dokka
maven(url = "https://dl.bintray.com/kotlin/kotlinx")
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-call-logging:$ktorVersion")
testImplementation("io.ktor:ktor-client-mock:$ktorVersion")
testImplementation("io.ktor:ktor-client-mock-jvm:$ktorVersion")
testImplementation("io.ktor:ktor-server-tests:$ktorVersion")
testImplementation("io.ktor:ktor-client-tests:$ktorVersion")
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation("io.kotest:kotest-property:$kotestVersion")
testImplementation("io.kotest:kotest-extensions-junitxml:$kotestVersion")
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}
tasks.test {
useJUnitPlatform()
systemProperty("gradle.build.dir", project.buildDir)
}
tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
named("main") {
moduleName.set("Ktor features Zipkin")
sourceLink {
localDirectory.set(file("src/main/kotlin"))
remoteUrl.set(
URL("https://github.com/mjstrasser/ktor-features-zipkin/tree/main/src/main/kotlin")
)
remoteLineSuffix.set("#L")
}
}
}
}
tasks.register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
tasks.register<Jar>("dokkaJar") {
archiveClassifier.set("javadoc")
from(layout.buildDirectory.dir("dokka/html"))
}
publishing {
publications {
create<MavenPublication>("mavenKotlin") {
from(components["kotlin"])
artifact(tasks["sourcesJar"])
artifact(tasks["dokkaJar"])
pom {
name.set("ktor-features-zipkin")
description.set("Ktor feature for OpenZipkin tracing IDs")
url.set("https://github.com/mjstrasser/ktor-features-zipkin")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("mjstrasser")
name.set("Michael Strasser")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/mjstrasser/ktor-features-zipkin.git")
url.set("https://github.com/mjstrasser/ktor-features-zipkin")
}
}
}
}
}
nexusPublishing {
val ossrhUsername: String? by project
val ossrhPassword: String? by project
repositories {
create("sonatype") {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(ossrhUsername)
password.set(ossrhPassword)
}
}
}
signing {
val signingKeyId: String? by project
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications["mavenKotlin"])
}