Skip to content

Commit 2ab8cef

Browse files
committed
build: Move common logging dependencies to application conventions
All ORT applications shall use Logback as the logger implementation, so move it (along with the required adapter from the Log4j API) to the application conventions. This also fixes the Log4j to SLF4J adapter to only be a runtime dependency for the helper-cli. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent e9401ca commit 2ab8cef

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

buildSrc/src/main/kotlin/ort-application-conventions.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ import java.nio.file.Files
2222

2323
import org.graalvm.buildtools.gradle.tasks.BuildNativeImageTask
2424

25+
import org.gradle.accessors.dm.LibrariesForLibs
26+
27+
private val Project.libs: LibrariesForLibs
28+
get() = extensions.getByType()
29+
2530
plugins {
2631
// Apply core plugins.
2732
application
@@ -115,6 +120,12 @@ graalvmNative {
115120
}
116121
}
117122

123+
dependencies {
124+
implementation(libs.logbackClassic)
125+
126+
runtimeOnly(libs.log4jApiToSlf4j)
127+
}
128+
118129
tasks.named<BuildNativeImageTask>("nativeCompile") {
119130
// Gradle's "Copy" task cannot handle symbolic links, see https://github.com/gradle/gradle/issues/3982. That is why
120131
// links contained in the GraalVM distribution archive get broken during provisioning and are replaced by empty

cli/build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@ dependencies {
3636
implementation(project(":utils:ort-utils"))
3737

3838
implementation(libs.clikt)
39-
implementation(libs.logbackClassic)
4039
implementation(libs.mordant)
4140
implementation(libs.slf4j)
4241

43-
runtimeOnly(libs.log4jApiToSlf4j)
44-
4542
funTestImplementation(project(":downloader"))
4643
funTestImplementation(project(":evaluator"))
4744
funTestImplementation(project(":notifier"))

helper-cli/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,4 @@ dependencies {
4242
implementation(libs.jacksonModuleKotlin)
4343
implementation(libs.jslt)
4444
implementation(libs.log4jApi)
45-
implementation(libs.log4jApiToSlf4j)
46-
implementation(libs.logbackClassic)
4745
}

0 commit comments

Comments
 (0)