Skip to content

Commit 97ce872

Browse files
snicollwilkinsonabclozel
committed
Configure nullability checks with ErrorProne
See gh-1562 Co-authored-by: Andy Wilkinson <[email protected]> Co-authored-by: Brian Clozel <[email protected]>
1 parent d370dbd commit 97ce872

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

gradle/plugins/conventions-plugin/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dependencies {
1515
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}")
1616

1717
implementation("com.github.ben-manes:gradle-versions-plugin:$gradleVersionsPluginVersion")
18+
implementation("io.spring.gradle.nullability:nullability-plugin:$nullabilityPluginVersion")
1819
implementation("io.spring.javaformat:spring-javaformat-gradle-plugin:$javaFormatVersion")
1920

2021
testImplementation("org.junit.jupiter:junit-jupiter")

gradle/plugins/conventions-plugin/src/main/java/org/springframework/ws/gradle/conventions/ConventionsPlugin.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.ws.gradle.conventions;
1818

19+
import io.spring.gradle.nullability.NullabilityPlugin;
1920
import org.gradle.api.Plugin;
2021
import org.gradle.api.Project;
2122
import org.gradle.api.plugins.JavaBasePlugin;
@@ -37,7 +38,10 @@ public void apply(Project project) {
3738
new JavaBasePluginConventions().apply(project);
3839
new CheckstyleConventions().apply(project);
3940
});
40-
project.getPlugins().withType(JavaPlugin.class).all((plugin) -> new JavaPluginConventions().apply(project));
41+
project.getPlugins().withType(JavaPlugin.class).all((plugin) -> {
42+
project.getPlugins().apply(NullabilityPlugin.class);
43+
new JavaPluginConventions().apply(project);
44+
});
4145
project.getPlugins()
4246
.withType(MavenPublishPlugin.class)
4347
.all((plugin) -> new MavenPublishPluginConventions().apply(project));

gradle/plugins/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ assertJVersion=3.25.3
22
gradleVersionsPluginVersion=0.52.0
33
javaFormatVersion=0.0.45
44
junitVersion=5.11.0
5+
nullabilityPluginVersion=0.0.1

src/checkstyle/checkstyle-suppressions.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
<suppress files="." checks="SpringMethodVisibility"/>
99

1010
<suppress files=".+TransportConstants\.java" checks="InterfaceIsType"/>
11+
<!-- Ignore this check for @Nullable annotations -->
12+
<suppress files="[\\/]src[\\/]main[\\/]java[\\/]" checks="AnnotationLocation" />
1113
</suppressions>

0 commit comments

Comments
 (0)