Skip to content

Commit

Permalink
fix: replace deprecated setDestination() API
Browse files Browse the repository at this point in the history
  • Loading branch information
KengoTODA committed Nov 14, 2021
1 parent a635b7d commit 20e1752
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@
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 {
@Inject
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 20e1752

Please sign in to comment.