Migrate to io.spring.nullability Gradle plugin
There is an `io.spring.nullability` Gradle plugin for NullAway checks. It includes `net.ltgt.errorprone` plugin transitively, manages required dependencies, covers respective configuration options
This commit is contained in:
16
build.gradle
16
build.gradle
@@ -20,7 +20,7 @@ plugins {
|
||||
id 'org.antora' version '1.0.0'
|
||||
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
|
||||
id 'io.freefair.aggregate-javadoc' version '8.11'
|
||||
id 'net.ltgt.errorprone' version '4.1.0' apply false
|
||||
id 'io.spring.nullability' version '0.0.1' apply false
|
||||
}
|
||||
|
||||
description = 'Spring AMQP'
|
||||
@@ -157,7 +157,7 @@ configure(javaProjects) { subproject ->
|
||||
apply plugin: 'checkstyle'
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: 'kotlin-spring'
|
||||
apply plugin: 'net.ltgt.errorprone'
|
||||
apply plugin: 'io.spring.nullability'
|
||||
|
||||
apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle"
|
||||
|
||||
@@ -175,15 +175,6 @@ configure(javaProjects) { subproject ->
|
||||
tasks.withType(JavaCompile) {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
options.encoding = 'UTF-8'
|
||||
options.errorprone {
|
||||
disableAllChecks = true
|
||||
if (!name.toLowerCase().contains('test')) {
|
||||
option('NullAway:OnlyNullMarked', 'true')
|
||||
option('NullAway:CustomContractAnnotations', 'org.springframework.lang.Contract')
|
||||
option('NullAway:JSpecifyMode', 'true')
|
||||
error('NullAway')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
compileTestKotlin {
|
||||
@@ -223,9 +214,6 @@ configure(javaProjects) { subproject ->
|
||||
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-reflect'
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
|
||||
|
||||
errorprone 'com.uber.nullaway:nullaway:0.12.7'
|
||||
errorprone 'com.google.errorprone:error_prone_core:2.36.0'
|
||||
}
|
||||
|
||||
// enable all compiler warnings; individual projects may customize further
|
||||
|
||||
Reference in New Issue
Block a user