Skip to content

Commit

Permalink
consolidate test dependencies for logging
Browse files Browse the repository at this point in the history
To provide an SLF4J implementation to all tests, `dependency.log4j_slf4j`
(with the implementation of `org.apache.logging.slf4j.SLF4JServiceProvider` picked up at runtime by the ServiceLoader)
is moved to the `archunit.java-testing-conventions` plugin.
It transitively depends on `dependency.log4j_core` / `dependency.log4j_api`,
which are only needed as explicit implementation dependencies in modules that specifically test logs.

Signed-off-by: Manfred Hanke <[email protected]>
  • Loading branch information
hankem authored and codecholeric committed Jun 9, 2024
1 parent fd93733 commit 6c53da9
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 21 deletions.
1 change: 0 additions & 1 deletion archunit-3rd-party-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies {
testImplementation project(path: ':archunit', configuration: 'tests')
testImplementation dependency.springBootLoader
dependency.addGuava { dependencyNotation, config -> testImplementation(dependencyNotation, config) }
testImplementation dependency.log4j_slf4j
testImplementation dependency.junit4
testImplementation dependency.junit_dataprovider
testImplementation dependency.assertj
Expand Down
4 changes: 0 additions & 4 deletions archunit-example/example-junit4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ ext.moduleName = 'com.tngtech.archunit.example.junit4'
dependencies {
testImplementation project(path: ':archunit-junit4')
testImplementation project(path: ':archunit-example:example-plain')

testRuntimeOnly dependency.log4j_api
testRuntimeOnly dependency.log4j_core
testRuntimeOnly dependency.log4j_slf4j
}

test {
Expand Down
4 changes: 0 additions & 4 deletions archunit-example/example-junit5/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ ext.minimumJavaVersion = JavaVersion.VERSION_1_8
dependencies {
testImplementation project(path: ':archunit-junit5')
testImplementation project(path: ':archunit-example:example-plain')

testRuntimeOnly dependency.log4j_api
testRuntimeOnly dependency.log4j_core
testRuntimeOnly dependency.log4j_slf4j
}

test {
Expand Down
3 changes: 0 additions & 3 deletions archunit-integration-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ ext.minimumJavaVersion = JavaVersion.VERSION_1_8
dependencies {
testImplementation dependency.junitPlatform
testImplementation dependency.assertj
testImplementation dependency.log4j_api
testImplementation dependency.log4j_core
testImplementation dependency.log4j_slf4j
testImplementation project(path: ':archunit', configuration: 'tests')
testImplementation project(path: ':archunit-junit4')
testImplementation project(path: ':archunit-junit5-api')
Expand Down
1 change: 0 additions & 1 deletion archunit-java-modules-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ext.minimumJavaVersion = JavaVersion.VERSION_1_9

dependencies {
testImplementation project(path: ':archunit', configuration: 'shadow')
testImplementation dependency.log4j_slf4j
}

def addArchUnitModuleOptions = {
Expand Down
3 changes: 0 additions & 3 deletions archunit-junit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ dependencies {
dependency.addGuava { dependencyNotation, config -> implementation(dependencyNotation, config) }
implementation dependency.slf4j

testImplementation dependency.log4j_api
testImplementation dependency.log4j_core
testImplementation dependency.log4j_slf4j
testImplementation dependency.junit4
testImplementation dependency.junit_dataprovider
testImplementation dependency.mockito
Expand Down
3 changes: 0 additions & 3 deletions archunit-junit/junit4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ dependencies {
dependency.addGuava { dependencyNotation, config -> implementation(dependencyNotation, config) }
implementation dependency.slf4j

testImplementation dependency.log4j_api
testImplementation dependency.log4j_core
testImplementation dependency.log4j_slf4j
testImplementation dependency.junit4
testImplementation dependency.junit_dataprovider
testImplementation dependency.mockito
Expand Down
1 change: 0 additions & 1 deletion archunit-junit/junit5/engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dependencies {
testImplementation dependency.mockito
testImplementation dependency.mockito_junit5
testImplementation dependency.log4j_core
testImplementation dependency.log4j_slf4j
}

gradle.projectsEvaluated {
Expand Down
1 change: 0 additions & 1 deletion archunit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies {

testImplementation dependency.log4j_api
testImplementation dependency.log4j_core
testImplementation dependency.log4j_slf4j
testImplementation dependency.junit4
testImplementation dependency.junit_dataprovider
testImplementation dependency.mockito
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {

testRuntimeOnly dependency.junit5JupiterEngine
testRuntimeOnly dependency.junit5VintageEngine
testRuntimeOnly dependency.log4j_slf4j
}

tasks.withType(Test) {
Expand Down

0 comments on commit 6c53da9

Please sign in to comment.