Skip to content

Commit 4e35789

Browse files
committed
use Gradle version catalog for ArchUnit-Examples
Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
1 parent 4d49b4c commit 4e35789

5 files changed

Lines changed: 24 additions & 24 deletions

File tree

archunit-3rd-party-test/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ext.moduleName = 'com.tngtech.archunit.thirdpartytest'
77
dependencies {
88
testImplementation project(path: ':archunit', configuration: 'shadow')
99
testImplementation project(path: ':archunit', configuration: 'tests')
10-
testImplementation dependency.springBootLoader
10+
testImplementation libs.springBootLoader
1111
dependency.addGuava { dependencyNotation, config -> testImplementation(dependencyNotation, config) }
1212
testImplementation libs.junit4
1313
testImplementation libs.junit.dataprovider

build-steps/release/archunit-examples-utils.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ private void updateArchUnitExampleDependencies(File targetArchUnitExampleDir) {
3333
def buildFile = new File(targetArchUnitExampleDir, 'build.gradle')
3434

3535
List<Map<String, String>> sortedDependencies = archUnitExamplesMainDependencies.collect()
36-
.sort { first, second -> first.group <=> second.group ?: first.name <=> second.name }
36+
.sort { first, second -> first.get().group <=> second.get().group ?: first.get().name <=> second.get().name }
3737
def dependencyIndent = ' ' * 8
38-
List<String> dependencyLines = sortedDependencies
38+
List<String> dependencyLines = sortedDependencies.collect { it.get() }
3939
.collect { "${dependencyIndent}implementation '${it.group}:${it.name}:${it.version}'".toString() }
4040

4141
buildFile.text = archUnitExamplesRootBuildFileContent.replace('#{dependencies}', dependencyLines.join('\n')) // always Unix line separator

build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,6 @@ ext {
4343
exclude module: 'j2objc-annotations'
4444
}
4545
},
46-
47-
// Dependencies for example projects / tests
48-
javaxAnnotationApi : [group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'],
49-
springBeans : [group: 'org.springframework', name: 'spring-beans', version: '5.3.23'],
50-
springBootLoader : [group: 'org.springframework.boot', name: 'spring-boot-loader', version: '2.7.13'],
51-
jakartaInject : [group: 'jakarta.inject', name: 'jakarta.inject-api', version: '2.0.1'],
52-
jakartaAnnotations : [group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '2.1.1'],
53-
guice : [group: 'com.google.inject', name: 'guice', version: '5.1.0'],
54-
// NOTE: The pure javaee-api dependencies are crippled, so to run any test we need to choose a full implementation provider
55-
geronimoEjb : [group: 'org.apache.geronimo.specs', name: 'geronimo-ejb_3.1_spec', version: '1.0.2'],
56-
geronimoJpa : [group: 'org.apache.geronimo.specs', name: 'geronimo-jpa_2.0_spec', version: '1.1'],
57-
jodaTime : [group: 'joda-time', name: 'joda-time', version: '2.12.7'],
58-
joox : [group: 'org.jooq', name: 'joox-java-6', version: '1.6.0']
5946
]
6047

6148
minSupportedJavaVersion = JavaVersion.VERSION_1_8

buildSrc/src/main/groovy/archunit.java-examples-conventions.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ archUnitTest {
1111
}
1212

1313
rootProject.ext.archUnitExamplesMainDependencies = [
14-
dependency.jodaTime,
15-
dependency.javaxAnnotationApi,
16-
dependency.jakartaInject,
17-
dependency.jakartaAnnotations,
18-
dependency.springBeans,
19-
dependency.guice,
20-
dependency.geronimoEjb,
21-
dependency.geronimoJpa
14+
libs.jodaTime,
15+
libs.javaxAnnotationApi,
16+
libs.jakartaInject,
17+
libs.jakartaAnnotations,
18+
libs.springBeans,
19+
libs.guice,
20+
libs.geronimoEjb,
21+
libs.geronimoJpa
2222
]
2323

2424
dependencies {

gradle/libs.versions.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,16 @@ mockito = { group = "org.mockito", name = "mockito-core", version = "4.11.0" } #
2424
mockito_junit5 = { group = "org.mockito", name = "mockito-junit-jupiter", version = "4.6.1" }
2525
assertj = { group = "org.assertj", name = "assertj-core", version.ref = "assertj" }
2626
assertj_guava = { group = "org.assertj", name = "assertj-guava", version.ref = "assertj" }
27+
28+
# Dependencies for example projects / tests
29+
javaxAnnotationApi = { group = "javax.annotation", name = "javax.annotation-api", version = "1.3.2" }
30+
springBeans = {group = "org.springframework", name = "spring-beans", version = "5.3.23" }
31+
springBootLoader = { group = "org.springframework.boot", name = "spring-boot-loader", version = "2.7.13" }
32+
jakartaInject = { group = "jakarta.inject", name = "jakarta.inject-api", version = "2.0.1" }
33+
jakartaAnnotations = { group = "jakarta.annotation", name = "jakarta.annotation-api", version = "2.1.1" }
34+
guice = { group = "com.google.inject", name = "guice", version = "5.1.0" }
35+
# NOTE: The pure javaee-api dependencies are crippled, so to run any test we need to choose a full implementation provider
36+
geronimoEjb = {group = "org.apache.geronimo.specs", name = "geronimo-ejb_3.1_spec", version = "1.0.2" }
37+
geronimoJpa = { group = "org.apache.geronimo.specs", name = "geronimo-jpa_2.0_spec", version = "1.1" }
38+
jodaTime = { group = "joda-time", name = "joda-time", version = "2.12.7" }
39+
joox = { group = "org.jooq", name = "joox-java-6", version = "1.6.0" }

0 commit comments

Comments
 (0)