This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
131 lines (115 loc) · 3.57 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
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val slf4jVersion = "2.0.9"
val kotestVersion = "5.7.2"
group = "sh.brocode"
version = "1.0-SNAPSHOT"
plugins {
val kotlinVersion = "1.9.20"
kotlin("jvm") version kotlinVersion
kotlin("plugin.serialization") version kotlinVersion
`java-library`
id("com.diffplug.spotless") version "6.22.0"
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}
repositories {
mavenLocal()
mavenCentral()
}
java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
dependencies {
implementation("org.slf4j:slf4j-api:$slf4jVersion")
// implementation("org.slf4j:slf4j-nop:$slf4jVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-json:$kotestVersion")
testImplementation("io.kotest:kotest-framework-datatest:$kotestVersion")
testImplementation("com.github.stefanbirkner:system-lambda:1.2.1")
}
tasks.withType<Test> {
useJUnitPlatform()
outputs.upToDateWhen { false }
jvmArgs("--add-opens=java.base/java.util=ALL-UNNAMED")
}
defaultTasks("clean", "test")
val spotlessCheckOrFormat by tasks.registering {
if (project.ext.has("ciBuild")) {
dependsOn(tasks.spotlessCheck)
} else {
dependsOn(tasks.spotlessApply)
}
}
tasks.withType<KotlinCompile> {
dependsOn(spotlessCheckOrFormat)
kotlinOptions {
jvmTarget = "17"
}
}
configure<SpotlessExtension> {
kotlin {
ktlint().editorConfigOverride(
mapOf(
"ij_kotlin_allow_trailing_comma" to "true",
"ij_kotlin_allow_trailing_comma_on_call_site" to "true",
),
)
toggleOffOn()
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
kotlinGradle {
ktlint()
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
pom {
name.set("brolog")
description.set("A simple slf4j backend")
url.set("https://github.com/brocode/brolog/")
licenses {
license {
name.set("The MIT License (MIT)")
url.set("https://mit-license.org/")
}
}
developers {
developer {
id.set("p_haun")
name.set("Patrick Haun")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:[email protected]:brocode/brolog.git")
developerConnection.set("scm:git:ssh://[email protected]:brocode/brolog.git")
url.set("https://github.com/brocode/brolog/")
}
}
from(components["java"])
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
nexusPublishing {
repositories {
sonatype { // only for users registered in Sonatype after 24 Feb 2021
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}