Skip to content

Commit 852b990

Browse files
authored
chore: gradle housekeeping
1 parent 97a2ba5 commit 852b990

File tree

4 files changed

+67
-61
lines changed

4 files changed

+67
-61
lines changed

app/build.gradle.kts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,19 @@ dependencies {
2727
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
2828
}
2929

30-
val executables = mapOf(
31-
"AccountDemo" to "org.example.app.AccountDemo",
32-
"BasinDemo" to "org.example.app.BasinDemo",
33-
"BufferedReadSessionDemo" to "org.example.app.BufferedReadSessionDemo",
34-
"FutureAppendSessionDemo" to "org.example.app.FutureAppendSessionDemo",
35-
"ReadSessionDemo" to "org.example.app.ReadSessionDemo",
30+
val executables = listOf(
31+
"org.example.app.AccountDemo",
32+
"org.example.app.BasinDemo",
33+
"org.example.app.ManagedReadSessionDemo",
34+
"org.example.app.ManagedAppendSessionDemo",
35+
"org.example.app.ReadSessionDemo"
3636
)
3737

38-
executables.forEach { name, mainClassName ->
39-
tasks.register<JavaExec>("run${name}") {
38+
executables.forEach { mainClassName ->
39+
val name = mainClassName.substringAfterLast('.')
40+
tasks.register<JavaExec>("run$name") {
4041
group = "application"
41-
description = "Run the $name executable"
42+
description = "Run the $name demo app."
4243
classpath = sourceSets["main"].runtimeClasspath
4344
mainClass.set(mainClassName)
4445
}

gradle/libs.versions.toml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
1-
# This file was generated by the Gradle 'init' task.
2-
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
3-
41
[versions]
2+
assertJ = "3.24.2"
3+
grpc = "1.70.0"
4+
javaxAnnotation = "1.3.2"
55
junit-jupiter = "5.11.4"
6+
mockito = "5.8.0"
7+
protobuf = "4.29.3"
8+
slf4j = "1.7.32"
9+
system-stubs-jupiter = "2.1.7"
10+
tomcatAnnotations = "11.0.2"
611

712
[libraries]
8-
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
13+
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertJ" }
14+
grpc-inprocess = { module = "io.grpc:grpc-inprocess", version.ref = "grpc" }
15+
grpc-netty-shaded = { module = "io.grpc:grpc-netty-shaded", version.ref = "grpc" }
16+
grpc-protobuf = { module = "io.grpc:grpc-protobuf", version.ref = "grpc" }
17+
grpc-stub = { module = "io.grpc:grpc-stub", version.ref = "grpc" }
18+
grpc-testing = { module = "io.grpc:grpc-testing", version.ref = "grpc" }
19+
javax-annotation-api = { module = "javax.annotation:javax.annotation-api", version.ref = "javaxAnnotation" }
20+
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit-jupiter" }
21+
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
22+
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" }
23+
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" }
24+
mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" }
25+
protobuf-java = { module = "com.google.protobuf:protobuf-java", version.ref = "protobuf" }
26+
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
27+
system-stubs-jupiter = { module = "uk.org.webcompere:system-stubs-jupiter", version.ref = "system-stubs-jupiter" }
28+
tomcat-annotations = { module = "org.apache.tomcat:tomcat-annotations-api", version.ref = "tomcatAnnotations" }

s2-internal/build.gradle.kts

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,29 @@ repositories {
1111
mavenCentral()
1212
}
1313

14-
val grpcVersion = "1.64.0"
15-
val protobufVersion = "3.25.0"
16-
val tomcatAnnotationsVersion = "11.0.2"
17-
val javaxAnnotationVersion = "1.3.2"
18-
val mockitoVersion = "5.8.0"
19-
val assertJVersion = "3.24.2"
20-
2114
dependencies {
22-
implementation("io.grpc:grpc-protobuf:$grpcVersion")
23-
implementation("io.grpc:grpc-stub:$grpcVersion")
24-
implementation("io.grpc:grpc-netty-shaded:$grpcVersion")
25-
implementation("javax.annotation:javax.annotation-api:$javaxAnnotationVersion")
26-
implementation("com.google.protobuf:protobuf-java:$protobufVersion")
27-
implementation("org.slf4j:slf4j-api:1.7.32")
28-
compileOnly("org.apache.tomcat:tomcat-annotations-api:$tomcatAnnotationsVersion")
29-
testImplementation(platform("org.junit:junit-bom:5.11.4"))
15+
compileOnly(libs.tomcat.annotations)
16+
implementation(libs.grpc.netty.shaded)
17+
implementation(libs.grpc.protobuf)
18+
implementation(libs.grpc.stub)
19+
implementation(libs.javax.annotation.api)
20+
implementation(libs.protobuf.java)
21+
implementation(libs.slf4j.api)
22+
testImplementation(libs.assertj.core)
23+
testImplementation(libs.grpc.inprocess)
24+
testImplementation(libs.grpc.testing)
3025
testImplementation(libs.junit.jupiter)
31-
testImplementation("io.grpc:grpc-testing:$grpcVersion")
32-
testImplementation("io.grpc:grpc-inprocess:$grpcVersion")
33-
testImplementation("org.mockito:mockito-core:$mockitoVersion")
34-
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion") {
26+
testImplementation(libs.mockito.core)
27+
testImplementation(libs.mockito.junit.jupiter) {
3528
exclude(group = "org.junit.jupiter")
3629
}
37-
testImplementation("uk.org.webcompere:system-stubs-jupiter:2.1.7")
38-
testImplementation("org.assertj:assertj-core:$assertJVersion")
39-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
30+
testImplementation(libs.system.stubs.jupiter)
31+
testImplementation(platform(libs.junit.bom))
32+
testRuntimeOnly(libs.junit.platform.launcher)
4033
}
4134

35+
val protobufVersion: String = libs.versions.protobuf.get()
36+
val grpcVersion: String = libs.versions.grpc.get()
4237
protobuf {
4338
protoc {
4439
artifact = "com.google.protobuf:protoc:$protobufVersion"
@@ -61,6 +56,8 @@ java {
6156
toolchain {
6257
languageVersion.set(JavaLanguageVersion.of(17))
6358
}
59+
withJavadocJar()
60+
withSourcesJar()
6461
}
6562

6663

s2/build.gradle.kts

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,25 @@ repositories {
1010
mavenCentral()
1111
}
1212

13-
val grpcVersion = "1.64.0"
14-
val protobufVersion = "3.25.0"
15-
val tomcatAnnotationsVersion = "11.0.2"
16-
val javaxAnnotationVersion = "1.3.2"
17-
val mockitoVersion = "5.8.0"
18-
val assertJVersion = "3.24.2"
19-
2013
dependencies {
14+
compileOnly(libs.tomcat.annotations)
15+
implementation(libs.grpc.netty.shaded)
16+
implementation(libs.grpc.protobuf)
17+
implementation(libs.grpc.stub)
18+
implementation(libs.javax.annotation.api)
19+
implementation(libs.slf4j.api)
2120
implementation(project(":s2-internal"))
22-
23-
implementation("io.grpc:grpc-protobuf:$grpcVersion")
24-
implementation("io.grpc:grpc-stub:$grpcVersion")
25-
implementation("io.grpc:grpc-netty-shaded:$grpcVersion")
26-
implementation("javax.annotation:javax.annotation-api:$javaxAnnotationVersion")
27-
implementation("com.google.protobuf:protobuf-java:$protobufVersion")
28-
implementation("org.slf4j:slf4j-api:1.7.32")
29-
30-
compileOnly("org.apache.tomcat:tomcat-annotations-api:$tomcatAnnotationsVersion")
31-
32-
testImplementation(platform("org.junit:junit-bom:5.11.4"))
21+
testImplementation(libs.assertj.core)
22+
testImplementation(libs.grpc.inprocess)
23+
testImplementation(libs.grpc.testing)
3324
testImplementation(libs.junit.jupiter)
34-
testImplementation("io.grpc:grpc-testing:$grpcVersion")
35-
testImplementation("io.grpc:grpc-inprocess:$grpcVersion")
36-
testImplementation("org.mockito:mockito-core:$mockitoVersion")
37-
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion") {
25+
testImplementation(libs.mockito.core)
26+
testImplementation(libs.mockito.junit.jupiter) {
3827
exclude(group = "org.junit.jupiter")
3928
}
40-
testImplementation("uk.org.webcompere:system-stubs-jupiter:2.1.7")
41-
testImplementation("org.assertj:assertj-core:$assertJVersion")
42-
43-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
29+
testImplementation(libs.system.stubs.jupiter)
30+
testImplementation(platform(libs.junit.bom))
31+
testRuntimeOnly(libs.junit.platform.launcher)
4432
}
4533

4634

0 commit comments

Comments
 (0)