Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated Report method usage #100

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/org/sonarqube/gradle/SonarPropertyComputer.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ private static void extractTestProperties(Project project, Map<String, Object> p
private static void configureJaCoCoCoverageReport(final Test testTask, final boolean addForGroovy, Project project, final Map<String, Object> properties) {
project.getTasks().withType(JacocoReport.class, jacocoReportTask -> {
SingleFileReport xmlReport = jacocoReportTask.getReports().getXml();
if (xmlReport.isEnabled() && xmlReport.getDestination().exists()) {
appendProp(properties, "sonar.coverage.jacoco.xmlReportPaths", xmlReport.getDestination());
if (xmlReport.getRequired().get() && xmlReport.getOutputLocation().getAsFile().getOrNull().exists()) {
appendProp(properties, "sonar.coverage.jacoco.xmlReportPaths", xmlReport.getOutputLocation().getAsFile().getOrNull());
} else {
LOGGER.info("JaCoCo report task detected, but XML report is not enabled or it was not produced. " +
"Coverage for this task will not be reported.");
Expand All @@ -270,7 +270,7 @@ private static void configureJaCoCoCoverageReport(final Test testTask, final boo
}

private static void configureTestReports(Test testTask, Map<String, Object> properties) {
File testResultsDir = testTask.getReports().getJunitXml().getDestination();
File testResultsDir = testTask.getReports().getJunitXml().getOutputLocation().getAsFile().getOrNull();

// do not set a custom test reports path if it does not exists, otherwise SonarQube will emit an error
// do not set a custom test reports path if there are no files, otherwise SonarQube will emit a warning
Expand Down