mirror of
https://github.com/spring-projects/spring-security.git
synced 2026-01-17 03:46:56 +00:00
Fix: migrate compiler-warnings-error plugin to gradle
Fixes: gh-18434 Signed-off-by: paulvas <paulvas@gmail.com>
This commit is contained in:
parent
da4362111a
commit
0d47870928
@ -52,10 +52,6 @@ gradlePlugin {
|
||||
id = "org.springframework.security.check-expected-branch-version"
|
||||
implementationClass = "org.springframework.security.CheckExpectedBranchVersionPlugin"
|
||||
}
|
||||
compileWarningsError {
|
||||
id = "compile-warnings-error"
|
||||
implementationClass = "CompileWarningsErrorPlugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
10
buildSrc/src/main/groovy/compile-warnings-error.gradle
Normal file
10
buildSrc/src/main/groovy/compile-warnings-error.gradle
Normal file
@ -0,0 +1,10 @@
|
||||
import org.gradle.api.tasks.compile.JavaCompile
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs += "-Werror"
|
||||
}
|
||||
|
||||
tasks.withType(KotlinCompile) {
|
||||
kotlinOptions.allWarningsAsErrors = true
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.tasks.compile.JavaCompile
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
class CompileWarningsErrorPlugin implements Plugin<Project> {
|
||||
void apply(Project project) {
|
||||
project.tasks.withType(JavaCompile) {
|
||||
options.compilerArgs += "-Werror"
|
||||
}
|
||||
project.tasks.withType(KotlinCompile) {
|
||||
kotlinOptions.allWarningsAsErrors = true
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user