-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
100 lines (87 loc) · 2.45 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
import java.net.URL
plugins {
kotlin("jvm")
id("com.lovelysystems.gradle")
id("io.gitlab.arturbosch.detekt")
id("org.jetbrains.kotlinx.kover")
id("org.jetbrains.dokka")
`maven-publish`
}
group = "com.lovelysystems"
kotlin {
jvmToolchain(17)
}
lovely {
gitProject()
}
koverReport {
defaults {
verify {
onCheck = true
rule {
bound {
minValue = 90
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.INSTRUCTION
}
}
}
}
}
if (JavaVersion.current() != JavaVersion.VERSION_17) {
// we require Java 17 here, to ensure we are always using the same version as the docker images are using
error("Java 17 is required for this Project, found ${JavaVersion.current()}")
}
tasks.test {
useJUnitPlatform()
}
tasks.check {
dependsOn("detekt")
dependsOn("detektMain")
dependsOn("detektTest")
}
dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.reactive)
implementation(libs.bundles.jooq)
implementation(libs.spotbugs.annotations)
implementation(libs.slf4j.api)
testImplementation(testLibs.kotest.runner)
testImplementation(testLibs.r2dbc.postgresql)
testImplementation(testLibs.lovely.db.testing)
testImplementation(testLibs.jooq.codegen)
testImplementation(testLibs.logback)
}
tasks.dokkaHtml {
val versionToUse = (project.findProperty("docVersion") as? String?) ?: project.version.toString()
moduleVersion.set(versionToUse)
dokkaSourceSets {
named("main") {
sourceLink {
localDirectory.set(projectDir.resolve("src"))
remoteUrl.set(URL("https://github.com/lovelysystems/lovely-jooq/tree/master/src"))
remoteLineSuffix.set("#L")
}
}
}
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/lovelysystems/lovely-jooq")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_USER")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
register<MavenPublication>("gpr") {
from(components["java"])
}
}
}
java {
withJavadocJar()
withSourcesJar()
}