-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
136 lines (114 loc) · 4.9 KB
/
build.gradle.kts
File metadata and controls
136 lines (114 loc) · 4.9 KB
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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.vanniktech.maven.publish.DeploymentValidation
plugins {
id("java")
id("java-library")
kotlin("jvm") version "2.3.10"
id("com.vanniktech.maven.publish") version "0.36.0"
}
tasks.withType<JavaCompile> {
options.compilerArgs.add("-Xlint:unchecked") // warn about unchecked operations
options.compilerArgs.add("-Xlint:deprecation") // warn about deprecated APIs
options.compilerArgs.add("-Xlint:rawtypes") // warn about raw types
options.compilerArgs.add("-Werror") // treat all warnings as errors
}
tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions).apply {
addStringOption("Xdoclint:all,-missing", "-quiet") // hide warnings for missing javadoc comments
encoding = "UTF-8" // optional, ensures UTF-8 for docs
}
}
tasks.named("build") {
dependsOn("javadoc")
}
dependencies {
api("org.slf4j:slf4j-api:2.0.17") // logging api
implementation("org.postgresql:postgresql:42.7.10")
implementation("com.zaxxer:HikariCP:7.0.2") // Connection pool
implementation("com.fasterxml.jackson.core:jackson-databind:2.21.1") // json
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.1")
implementation("com.cronutils:cron-utils:9.2.1") // cron for scheduled wf
implementation("io.netty:netty-all:4.2.10.Final") // netty for websocket
compileOnly("org.jspecify:jspecify:1.0.0")
testImplementation(platform("org.junit:junit-bom:6.0.3"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.junit-pioneer:junit-pioneer:2.3.0")
testImplementation("uk.org.webcompere:system-stubs-jupiter:2.1.8")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.java-websocket:Java-WebSocket:1.6.0")
testImplementation("ch.qos.logback:logback-classic:1.5.32")
testImplementation("org.mockito:mockito-core:5.22.0")
testImplementation("io.rest-assured:rest-assured:6.0.0")
testImplementation("io.rest-assured:json-path:6.0.0")
testImplementation("io.rest-assured:xml-path:6.0.0")
testImplementation("org.apache.maven:maven-artifact:3.9.13")
testImplementation("org.testcontainers:testcontainers-postgresql:2.0.3")
}
val projectVersion = project.version.toString()
tasks.processResources {
inputs.property("version", projectVersion)
filesMatching("**/app.properties") {
expand(mapOf("projectVersion" to projectVersion))
}
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
showStandardStreams = true
}
addTestListener(object : TestListener {
override fun beforeSuite(suite: TestDescriptor) {}
override fun beforeTest(testDescriptor: TestDescriptor) {}
override fun afterTest(testDescriptor: TestDescriptor, result: TestResult) {}
override fun afterSuite(suite: TestDescriptor, result: TestResult) {
if (suite.parent == null) {
println("\nTest Results:")
println(" Tests run: ${result.testCount}")
println(" Passed: ${result.successfulTestCount}")
println(" Failed: ${result.failedTestCount}")
println(" Skipped: ${result.skippedTestCount}")
}
}
})
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
// jvmTarget now uses the JvmTarget enum instead of a String
jvmTarget.set(JvmTarget.JVM_17)
// freeCompilerArgs is now a Property/ListProperty, so we use .add() or .addAll()
freeCompilerArgs.add("-Xjsr305=strict")
}
}
val publishingToMavenCentral = gradle.startParameter.taskNames.any { it.contains("publishToMavenCentral") }
mavenPublishing {
publishToMavenCentral(automaticRelease = true, validateDeployment = DeploymentValidation.NONE)
if (publishingToMavenCentral) {
signAllPublications()
}
pom {
name.set("DBOS Transact")
description.set("DBOS Transact Java SDK for lightweight durable workflows")
inceptionYear.set("2025")
url.set("https://github.com/dbos-inc/dbos-transact-java")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("dbos-inc")
name.set("DBOS Inc")
email.set("support@dbos.dev")
}
}
scm {
connection.set("scm:git:git://github.com/dbos-inc/dbos-transact-java.git")
developerConnection.set("scm:git:ssh://github.com:dbos-inc/dbos-transact-java.git")
url.set("https://github.com/dbos-inc/dbos-transact-java/tree/main")
}
}
}