-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
142 lines (121 loc) · 4.03 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URI
import java.time.Duration
plugins {
`java-library`
kotlin("jvm") version "1.7.20"
id("maven-publish")
signing
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("com.github.ben-manes.versions") version "0.44.0"
id("me.champeau.gradle.jmh") version "0.5.3"
id("net.researchgate.release") version "3.0.2"
id("org.jmailen.kotlinter") version "3.12.0"
}
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
vendor.set(JvmVendorSpec.AZUL)
}
}
repositories {
mavenCentral()
}
val deps by extra {
mapOf(
"slf4j" to "2.0.5",
"jmh" to "1.22",
"junit" to "5.9.1"
)
}
dependencies {
api("com.google.code.findbugs", "jsr305", "3.0.2")
testRuntimeOnly("org.slf4j", "slf4j-simple", "${deps["slf4j"]}")
testRuntimeOnly("org.slf4j", "log4j-over-slf4j", "${deps["slf4j"]}")
testRuntimeOnly("org.slf4j", "jcl-over-slf4j", "${deps["slf4j"]}")
testImplementation("org.slf4j", "jul-to-slf4j", "${deps["slf4j"]}")
testImplementation("org.junit.jupiter", "junit-jupiter-api", "${deps["junit"]}")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "${deps["junit"]}")
testImplementation(kotlin("stdlib-jdk8"))
testImplementation(kotlin("test-junit5"))
jmhImplementation("com.google.guava", "guava", "31.1-jre")
}
group = "com.palominolabs.http"
tasks {
test {
useJUnitPlatform()
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
}
publishing {
publications {
register<MavenPublication>("sonatype") {
from(components["java"])
// sonatype required pom elements
pom {
name.set("${project.group}:${project.name}")
description.set(name)
url.set("https://github.com/palominolabs/url-builder")
licenses {
license {
name.set("Copyfree Open Innovation License 0.4")
url.set("https://copyfree.org/content/standard/licenses/coil/license.txt")
}
}
developers {
developer {
id.set("marshallpierce")
name.set("Marshall Pierce")
email.set("575695+marshallpierce@users.noreply.github.com")
}
}
scm {
connection.set("scm:git:https://github.com/palominolabs/url-builder")
developerConnection.set("scm:git:ssh://git@github.com:palominolabs/url-builder.git")
url.set("https://github.com/palominolabs/url-builder")
}
}
}
}
// A safe throw-away place to publish to:
// ./gradlew publishSonatypePublicationToLocalDebugRepository -Pversion=foo
repositories {
maven {
name = "localDebug"
url = URI.create("file:///${project.buildDir}/repos/localDebug")
}
}
}
jmh {
jmhVersion = deps["jmh"]
}
tasks.afterReleaseBuild {
dependsOn(provider { project.tasks.named("publishToSonatype") })
}
// don't barf for devs without signing set up
if (project.hasProperty("signing.keyId")) {
signing {
sign(project.extensions.getByType<PublishingExtension>().publications["sonatype"])
}
}
nexusPublishing {
repositories {
sonatype {
// sonatypeUsername and sonatypePassword properties are used automatically
stagingProfileId.set("26c8b7fff47581") // com.palominolabs
}
}
// these are not strictly required. The default timeouts are set to 1 minute. But Sonatype can be really slow.
// If you get the error "java.net.SocketTimeoutException: timeout", these lines will help.
connectTimeout.set(Duration.ofMinutes(3))
clientTimeout.set(Duration.ofMinutes(3))
}
release {
git {
requireBranch.set("master")
}
}