Skip to content

Commit

Permalink
Move the SLF4J ban to checkstyle
Browse files Browse the repository at this point in the history
It was inconsistent to exclude the dependencies
  • Loading branch information
octylFractal authored and wizjany committed Aug 25, 2024
1 parent 54be5fa commit 210e316
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 39 deletions.
4 changes: 0 additions & 4 deletions build-logic/src/main/kotlin/buildlogic.adapter.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ plugins {
id("io.papermc.paperweight.userdev")
}

configure<buildlogic.CommonJavaExtension> {
banSlf4j = false
}

paperweight {
injectPaperRepository = false
}
Expand Down
13 changes: 0 additions & 13 deletions build-logic/src/main/kotlin/buildlogic.common-java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ plugins {
id("buildlogic.common")
}

val commonJava = extensions.create<buildlogic.CommonJavaExtension>("commonJava")
commonJava.banSlf4j.convention(true)

tasks
.withType<JavaCompile>()
.matching { it.name == "compileJava" || it.name == "compileTestJava" }
Expand Down Expand Up @@ -67,16 +64,6 @@ configure<JavaPluginExtension> {
withSourcesJar()
}

configurations["compileClasspath"].apply {
resolutionStrategy.componentSelection {
withModule("org.slf4j:slf4j-api") {
if (commonJava.banSlf4j.get()) {
reject("No SLF4J allowed on compile classpath")
}
}
}
}

tasks.named("check").configure {
dependsOn("checkstyleMain", "checkstyleTest")
}
7 changes: 0 additions & 7 deletions build-logic/src/main/kotlin/buildlogic/CommonJavaExtension.kt

This file was deleted.

4 changes: 4 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ Checks based on Google Checks, modified for EngineHub.
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="customImportOrderRules" value="THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE###STATIC"/>
</module>
<module name="IllegalImport">
<property name="illegalPkgs" value="org.slf4j"/>
<message key="name.invalidPattern" value="Illegal import - {0}. Use Log4J instead."/>
</module>
<module name="MethodParamPad"/>
<module name="OperatorWrap">
<property name="option" value="NL"/>
Expand Down
1 change: 0 additions & 1 deletion worldedit-bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ dependencies {
because("Resolving Spigot annotations")
}
"compileOnly"(libs.paperApi) {
exclude("org.slf4j", "slf4j-api")
exclude("junit", "junit")
}
"implementation"(libs.paperLib)
Expand Down
5 changes: 0 additions & 5 deletions worldedit-fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ plugins {
id("buildlogic.platform")
}

commonJava {
// Not easy to do, because it's in a bunch of separate configurations
banSlf4j = false
}

platform {
kind = buildlogic.WorldEditKind.Mod
includeClasspath = true
Expand Down
5 changes: 0 additions & 5 deletions worldedit-neoforge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ plugins {
id("buildlogic.platform")
}

commonJava {
// Not easy to do, because it's in a bunch of separate configurations
banSlf4j = false
}

platform {
kind = buildlogic.WorldEditKind.Mod
}
Expand Down
4 changes: 0 additions & 4 deletions worldedit-sponge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ platform {
includeClasspath = true
}

commonJava {
banSlf4j = false
}

minecraft {
injectRepositories(false)
version(libs.versions.sponge.minecraft.get())
Expand Down

0 comments on commit 210e316

Please sign in to comment.