diff --git a/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsHtmlReport.java b/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsHtmlReport.java index e08f89e30..6ff675262 100644 --- a/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsHtmlReport.java +++ b/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsHtmlReport.java @@ -21,7 +21,6 @@ import java.util.Optional; import javax.inject.Inject; import org.gradle.api.InvalidUserDataException; -import org.gradle.api.file.RegularFile; import org.gradle.api.model.ObjectFactory; import org.gradle.api.provider.Property; import org.gradle.api.resources.TextResource; @@ -34,8 +33,7 @@ public abstract class SpotBugsHtmlReport extends SpotBugsReport { public SpotBugsHtmlReport(ObjectFactory objects, SpotBugsTask task) { super(objects, task); // the default reportsDir is "$buildDir/reports/spotbugs/${baseName}.html" - setDestination( - task.getReportsDir().file(task.getBaseName() + ".html").map(RegularFile::getAsFile)); + getOutputLocation().value(task.getReportsDir().file(task.getBaseName() + ".html")); stylesheet = objects.property(TextResource.class); stylesheetPath = objects.property(String.class); } diff --git a/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsSarifReport.java b/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsSarifReport.java index 2fa64fdd8..56ccede39 100644 --- a/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsSarifReport.java +++ b/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsSarifReport.java @@ -18,7 +18,6 @@ import edu.umd.cs.findbugs.annotations.NonNull; import java.util.Optional; import javax.inject.Inject; -import org.gradle.api.file.RegularFile; import org.gradle.api.model.ObjectFactory; public class SpotBugsSarifReport extends SpotBugsReport { @@ -26,8 +25,7 @@ public class SpotBugsSarifReport extends SpotBugsReport { public SpotBugsSarifReport(ObjectFactory objects, SpotBugsTask task) { super(objects, task); // the default reportsDir is "$buildDir/reports/spotbugs/${baseName}.sarif" - setDestination( - task.getReportsDir().file(task.getBaseName() + ".sarif").map(RegularFile::getAsFile)); + getOutputLocation().value(task.getReportsDir().file(task.getBaseName() + ".sarif")); } @NonNull diff --git a/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsTextReport.java b/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsTextReport.java index 1ec2a82aa..95d0eac36 100644 --- a/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsTextReport.java +++ b/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsTextReport.java @@ -18,7 +18,6 @@ import edu.umd.cs.findbugs.annotations.NonNull; import java.util.Optional; import javax.inject.Inject; -import org.gradle.api.file.RegularFile; import org.gradle.api.model.ObjectFactory; public abstract class SpotBugsTextReport extends SpotBugsReport { @@ -27,8 +26,7 @@ public abstract class SpotBugsTextReport extends SpotBugsReport { public SpotBugsTextReport(ObjectFactory objects, SpotBugsTask task) { super(objects, task); // the default reportsDir is "$buildDir/reports/spotbugs/${baseName}.txt" - setDestination( - task.getReportsDir().file(task.getBaseName() + ".txt").map(RegularFile::getAsFile)); + getOutputLocation().value(task.getReportsDir().file(task.getBaseName() + ".txt")); } @NonNull diff --git a/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsXmlReport.java b/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsXmlReport.java index cb3ea7ccc..cdbba81ca 100644 --- a/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsXmlReport.java +++ b/src/main/groovy/com/github/spotbugs/snom/internal/SpotBugsXmlReport.java @@ -18,7 +18,6 @@ import edu.umd.cs.findbugs.annotations.NonNull; import java.util.Optional; import javax.inject.Inject; -import org.gradle.api.file.RegularFile; import org.gradle.api.model.ObjectFactory; public abstract class SpotBugsXmlReport extends SpotBugsReport { @@ -27,8 +26,7 @@ public abstract class SpotBugsXmlReport extends SpotBugsReport { public SpotBugsXmlReport(ObjectFactory objects, SpotBugsTask task) { super(objects, task); // the default reportsDir is "$buildDir/reports/spotbugs/${baseName}.xml" - setDestination( - task.getReportsDir().file(task.getBaseName() + ".xml").map(RegularFile::getAsFile)); + getOutputLocation().value(task.getReportsDir().file(task.getBaseName() + ".xml")); } @NonNull