Skip to content

Commit 62aed4c

Browse files
authored
Migrate to Gradle Version Catalog (#3894)
2 parents 1431a91 + ba46e0c commit 62aed4c

18 files changed

Lines changed: 177 additions & 88 deletions

File tree

build.gradle

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ plugins {
1212
id("eclipse") //support for Eclipse
1313

1414
// Code formatting
15-
id "com.diffplug.spotless" version "8.7.0"
15+
alias(libs.plugins.spotless)
1616

1717
// EISOP Checker Framework
18-
id "org.checkerframework" version "0.6.61"
18+
alias(libs.plugins.checkerframework)
1919

2020
// Plugin for publishing via the new Nexus API
21-
id "com.vanniktech.maven.publish" version "0.37.0" apply false
21+
alias(libs.plugins.maven.publish) apply false
2222
}
2323

2424

@@ -65,37 +65,30 @@ subprojects {
6565
}
6666

6767
dependencies {
68-
implementation("org.slf4j:slf4j-api:2.0.18")
69-
testImplementation("ch.qos.logback:logback-classic:1.5.37")
70-
71-
72-
compileOnly("org.jspecify:jspecify:1.0.0")
73-
testCompileOnly("org.jspecify:jspecify:1.0.0")
74-
def eisop_version = "3.49.5-eisop1"
75-
compileOnly "io.github.eisop:checker-qual:$eisop_version"
76-
compileOnly "io.github.eisop:checker-util:$eisop_version"
77-
testCompileOnly "io.github.eisop:checker-qual:$eisop_version"
78-
checkerFramework "io.github.eisop:checker-qual:$eisop_version"
79-
checkerFramework "io.github.eisop:checker:$eisop_version"
80-
81-
testImplementation("ch.qos.logback:logback-classic:1.5.37")
82-
testImplementation("org.assertj:assertj-core:3.27.7")
83-
testImplementation("ch.qos.logback:logback-classic:1.5.37")
84-
85-
testImplementation(platform("org.junit:junit-bom:6.1.1"))
86-
testImplementation ("org.junit.jupiter:junit-jupiter-api")
87-
testImplementation ("org.junit.jupiter:junit-jupiter-params")
88-
testRuntimeOnly ("org.junit.jupiter:junit-jupiter-engine")
89-
testRuntimeOnly ("org.junit.platform:junit-platform-launcher")
90-
testImplementation ("org.assertj:assertj-core:3.27.7")
91-
testImplementation (project(':key.util'))
92-
testImplementation (testFixtures(project(":key.util")))
68+
implementation(libs.slf4j.api)
69+
testImplementation(libs.logback.classic)
70+
71+
72+
compileOnly(libs.jspecify)
73+
testCompileOnly(libs.jspecify)
74+
compileOnly(libs.checkerframework.qual)
75+
compileOnly(libs.checkerframework.util)
76+
testCompileOnly(libs.checkerframework.qual)
77+
checkerFramework(libs.checkerframework.qual)
78+
checkerFramework(libs.checkerframework)
79+
80+
testImplementation(platform(libs.junit.bom))
81+
testImplementation(libs.junit.jupiter.api)
82+
testImplementation(libs.junit.jupiter.params)
83+
testRuntimeOnly(libs.junit.jupiter.engine)
84+
testRuntimeOnly(libs.junit.platform.launcher)
85+
testImplementation(libs.assertj.core)
86+
testImplementation(project(':key.util'))
87+
testImplementation(testFixtures(project(":key.util")))
9388

9489
// test fixtures
95-
testImplementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.21.4")
96-
testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.4")
97-
98-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
90+
testImplementation(libs.jackson.dataformat.yaml)
91+
testImplementation(libs.jackson.datatype.jsr310)
9992
}
10093

10194
tasks.withType(JavaCompile).configureEach {

gradle/libs.versions.toml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Version catalog for KeY project
2+
# See https://docs.gradle.org/current/userguide/platforms.html
3+
4+
[versions]
5+
# Plugins
6+
spotless = "8.7.0"
7+
checkerframework-gradle = "0.6.61"
8+
maven-publish = "0.37.0"
9+
shadow = "9.4.3"
10+
11+
# Core dependencies
12+
slf4j = "2.0.18"
13+
logback = "1.5.37"
14+
jspecify = "1.0.0"
15+
eisop = "3.49.5-eisop1"
16+
assertj = "3.27.7"
17+
junit = "6.1.1"
18+
jackson = "2.21.4"
19+
20+
# ANTLR
21+
antlr = "4.13.2"
22+
stringtemplate = "4.3.4"
23+
24+
# Java parsing and analysis
25+
javapoet = "1.13.0"
26+
javaparser = "3.28.0-K13.5"
27+
truth = "1.4.5"
28+
29+
# UI and CLI
30+
flatlaf = "3.7.1"
31+
miglayout = "11.4.3"
32+
picocli = "4.7.7"
33+
docking-frames = "1.1.3p1"
34+
35+
# External tools
36+
scala-isabelle = "0.4.5"
37+
38+
[libraries]
39+
# SLF4J and logging
40+
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
41+
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
42+
43+
# JSpecify (nullability annotations)
44+
jspecify = { module = "org.jspecify:jspecify", version.ref = "jspecify" }
45+
46+
# EISOP Checker Framework
47+
checkerframework-qual = { module = "io.github.eisop:checker-qual", version.ref = "eisop" }
48+
checkerframework-util = { module = "io.github.eisop:checker-util", version.ref = "eisop" }
49+
checkerframework = { module = "io.github.eisop:checker", version.ref = "eisop" }
50+
51+
# Testing
52+
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj" }
53+
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" }
54+
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api" }
55+
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params" }
56+
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" }
57+
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" }
58+
59+
# Jackson (JSON/YAML)
60+
jackson-dataformat-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" }
61+
jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jackson" }
62+
63+
# ANTLR
64+
antlr4 = { module = "org.antlr:antlr4", version.ref = "antlr" }
65+
antlr4-runtime = { module = "org.antlr:antlr4-runtime", version.ref = "antlr" }
66+
stringtemplate = { module = "org.antlr:ST4", version.ref = "stringtemplate" }
67+
68+
# Java source code processing
69+
javapoet = { module = "com.squareup:javapoet", version.ref = "javapoet" }
70+
javaparser-core = { module = "org.key-project.proofjava:javaparser-core", version.ref = "javaparser" }
71+
javaparser-core-serialization = { module = "org.key-project.proofjava:javaparser-core-serialization", version.ref = "javaparser" }
72+
javaparser-symbol-solver-core = { module = "org.key-project.proofjava:javaparser-symbol-solver-core", version.ref = "javaparser" }
73+
74+
# Testing utilities
75+
truth = { module = "com.google.truth:truth", version.ref = "truth" }
76+
77+
# UI components
78+
flatlaf = { module = "com.formdev:flatlaf", version.ref = "flatlaf" }
79+
miglayout-swing = { module = "com.miglayout:miglayout-swing", version.ref = "miglayout" }
80+
docking-frames-common = { module = "org.key-project:docking-frames-common", version.ref = "docking-frames" }
81+
docking-frames-core = { module = "org.key-project:docking-frames-core", version.ref = "docking-frames" }
82+
83+
# CLI
84+
picocli = { module = "info.picocli:picocli", version.ref = "picocli" }
85+
86+
# External tools
87+
scala-isabelle = { module = "de.unruh:scala-isabelle_2.13", version.ref = "scala-isabelle" }
88+
89+
[bundles]
90+
# Common testing dependencies
91+
testing = ["junit-jupiter-api", "junit-jupiter-params", "junit-jupiter-engine", "junit-platform-launcher", "assertj-core"]
92+
checkerframework = ["checkerframework-qual", "checkerframework-util"]
93+
jackson = ["jackson-dataformat-yaml", "jackson-datatype-jsr310"]
94+
javaparser = ["javaparser-core", "javaparser-core-serialization", "javaparser-symbol-solver-core"]
95+
96+
[plugins]
97+
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
98+
checkerframework = { id = "org.checkerframework", version.ref = "checkerframework-gradle" }
99+
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
100+
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }

key.core.example/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ application {
1010

1111
dependencies {
1212
implementation project(":key.core")
13-
implementation 'ch.qos.logback:logback-classic:1.5.37'
14-
}
13+
implementation(libs.logback.classic)
14+
}

key.core.symbolic_execution.example/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ description = "Example project to use KeY's APIs"
33
dependencies {
44
implementation project(":key.core")
55
implementation project(":key.core.symbolic_execution")
6-
}
6+
}

key.core.testgen/build.gradle

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ dependencies {
44
implementation project(":key.core")
55
testImplementation(testFixtures(project(":key.core")))
66

7-
8-
implementation("com.squareup:javapoet:1.13.0")
9-
10-
11-
12-
implementation "info.picocli:picocli:4.7.7"
7+
implementation(libs.javapoet)
8+
implementation(libs.picocli)
139
}
1410

key.core/build.gradle

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,26 @@ dependencies {
1212
api project(':key.ncore.calculus')
1313
api project(':key.ncore.compiler')
1414

15-
antlr4 "org.antlr:antlr4:4.13.2"
16-
api "org.antlr:antlr4-runtime:4.13.2"
15+
antlr4(libs.antlr4)
16+
api(libs.antlr4.runtime)
1717

1818
api project(':key.util')
1919

20-
// Make Javadoc accessible at runtime
21-
annotationProcessor 'com.github.therapi:therapi-runtime-javadoc-scribe:0.13.0'
22-
implementation 'com.github.therapi:therapi-runtime-javadoc:0.13.0'
20+
api(libs.javaparser.core)
21+
api(libs.javaparser.core.serialization)
22+
api(libs.javaparser.symbol.solver.core)
2323

24-
def JP_VERSION = "3.28.0-K13.5"
25-
api "org.key-project.proofjava:javaparser-core:$JP_VERSION"
26-
api "org.key-project.proofjava:javaparser-core-serialization:$JP_VERSION"
27-
api "org.key-project.proofjava:javaparser-symbol-solver-core:$JP_VERSION"
28-
29-
testImplementation("com.google.truth:truth:1.4.5")
24+
testImplementation(libs.truth)
3025
testImplementation(project(":key.core"))
3126

3227
// https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml
33-
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.21.4'
28+
testImplementation(libs.jackson.dataformat.yaml)
3429

3530
// test fixtures
3631
testFixturesApi(testFixtures(project(":key.util")))
3732
}
3833

39-
tasks.withType(JavaCompile) {
34+
tasks.withType(JavaCompile).configureEach {
4035
options.compilerArgs << "-Ajavadoc.packages=de.uka.ilkd.key.scripts"
4136
}
4237

@@ -104,7 +99,7 @@ classes.dependsOn << generateSMTListings
10499
classes.dependsOn << generateSolverPropsList
105100

106101

107-
tasks.withType(Test) {
102+
tasks.withType(Test).configureEach {
108103
enableAssertions = true
109104
// Forward retention-probe knobs (see MtRetentionProbe) to the test JVM.
110105
// Other test cases also need "key." prefixed properties
@@ -184,7 +179,7 @@ tasks.register('generateVersionFiles') {
184179
static def gitRevParse(String args) {
185180
try {
186181
return "git rev-parse $args".execute().text.trim()
187-
} catch (Exception e) {
182+
} catch (Exception ignored) {
188183
return ""
189184
}
190185
}

key.ncore.calculus/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repositories {
55
dependencies {
66
api project(':key.util')
77
api project(':key.ncore')
8-
implementation('org.jspecify:jspecify:1.0.0')
8+
implementation(libs.jspecify)
99
}
1010

1111
checkerFramework {

key.ncore.compiler/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies {
66
api project(':key.util')
77
api project(':key.ncore')
88
api project(':key.ncore.calculus')
9-
implementation('org.jspecify:jspecify:1.0.0')
9+
implementation(libs.jspecify)
1010
}
1111

1212
checkerFramework {

key.ncore/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ repositories {
1111

1212
dependencies {
1313
api project(':key.util')
14-
implementation('org.jspecify:jspecify:1.0.0')
15-
antlr4 "org.antlr:antlr4:4.13.2"
16-
api "org.antlr:antlr4-runtime:4.13.2"
14+
implementation(libs.jspecify)
15+
antlr4(libs.antlr4)
16+
api(libs.antlr4.runtime)
1717
}
1818

1919
def antlr4OutputKey = String.valueOf(projectDir) + '/build/generated-src/antlr/main/org/key_project/parser'

key.ui/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
// Used to create a single executable jar file with all dependencies
99
// see task "shadowJar" below
1010
// https://github.com/GradleUp/shadow
11-
id 'com.gradleup.shadow' version "9.4.3"
11+
alias(libs.plugins.shadow)
1212
}
1313

1414
description = "User interface for the deductive verification of Java programs"
@@ -17,7 +17,7 @@ dependencies {
1717
implementation project(":key.core")
1818
//implementation project(":key.core.rifl")
1919

20-
implementation("com.formdev:flatlaf:3.7.1")
20+
implementation(libs.flatlaf)
2121

2222
implementation project(":key.core.infflow")
2323
implementation project(":key.core.wd")
@@ -26,15 +26,15 @@ dependencies {
2626
implementation project(":key.core.symbolic_execution")
2727
//implementation project(":key.removegenerics")
2828

29-
api 'com.miglayout:miglayout-swing:11.4.3'
29+
api(libs.miglayout.swing)
3030

31-
implementation("info.picocli:picocli:4.7.7")
31+
implementation(libs.picocli)
3232

3333
//logging implementation used by the slf4j
34-
implementation 'ch.qos.logback:logback-classic:1.5.37'
34+
implementation(libs.logback.classic)
3535

36-
api 'org.key-project:docking-frames-common:1.1.3p1'
37-
api 'org.key-project:docking-frames-core:1.1.3p1'
36+
api(libs.docking.frames.common)
37+
api(libs.docking.frames.core)
3838

3939
runtimeOnly project(":keyext.ui.testgen")
4040
runtimeOnly project(":keyext.caching")

0 commit comments

Comments
 (0)