Skip to content

Commit

Permalink
fix: drop support for Gradle v5 and v6
Browse files Browse the repository at this point in the history
close #557
  • Loading branch information
KengoTODA committed Sep 17, 2021
1 parent f544288 commit 97f330f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ public class SpotBugsBasePlugin implements Plugin<Project> {
* href="https://guides.gradle.org/using-the-worker-api/">The Gradle Worker API</a> needs 5.6 or
* later, so we use this value as minimal required version.
*/
private static final GradleVersion SUPPORTED_VERSION = GradleVersion.version("5.6");
private static final GradleVersion SUPPORTED_VERSION = GradleVersion.version("7.0");

@Override
public void apply(Project project) {
// use XML report by default, only when SpotBugs plugin is applied
boolean isSpotBugsPluginApplied = project.getPluginManager().hasPlugin("com.github.spotbugs");
verifyGradleVersion(GradleVersion.current());
project.getPluginManager().apply(ReportingBasePlugin.class);

Expand All @@ -58,7 +56,6 @@ public void apply(Project project) {
task ->
task.init(
extension,
isSpotBugsPluginApplied,
Boolean.parseBoolean(enableWorkerApi),
Boolean.parseBoolean(enableHybridWorker)));
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/groovy/com/github/spotbugs/snom/SpotBugsTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ abstract class SpotBugsTask extends DefaultTask implements VerificationTask {

private boolean enableWorkerApi;
private boolean enableHybridWorker;
private boolean isSpotBugsPluginApplied;

void setClasses(FileCollection fileCollection) {
this.classes = fileCollection
Expand Down Expand Up @@ -350,7 +349,7 @@ abstract class SpotBugsTask extends DefaultTask implements VerificationTask {
*
* @param extension the source extension to copy the properties.
*/
void init(SpotBugsExtension extension, boolean isSpotBugsPluginApplied, boolean enableWorkerApi, boolean enableHybridWorker) {
void init(SpotBugsExtension extension, boolean enableWorkerApi, boolean enableHybridWorker) {
ignoreFailures.convention(extension.ignoreFailures)
showStackTraces.convention(extension.showStackTraces)
showProgress.convention(extension.showProgress)
Expand All @@ -375,7 +374,6 @@ abstract class SpotBugsTask extends DefaultTask implements VerificationTask {
configureJavaLauncher()
}

this.isSpotBugsPluginApplied = isSpotBugsPluginApplied
this.enableWorkerApi = enableWorkerApi
this.enableHybridWorker = enableHybridWorker
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ void testVerifyGradleVersion() {
assertThrows(
IllegalArgumentException.class,
() -> {
new SpotBugsBasePlugin().verifyGradleVersion(GradleVersion.version("5.5"));
new SpotBugsBasePlugin().verifyGradleVersion(GradleVersion.version("6.9"));
});
new SpotBugsBasePlugin().verifyGradleVersion(GradleVersion.version("5.6"));
new SpotBugsBasePlugin().verifyGradleVersion(GradleVersion.version("7.0"));
}

@Test
Expand Down

0 comments on commit 97f330f

Please sign in to comment.