Skip to content

Commit

Permalink
Address another deprecation warning in report take
Browse files Browse the repository at this point in the history
See gh-400
  • Loading branch information
wilkinsona committed Dec 16, 2024
1 parent fc43f90 commit e870ef7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.gradle.api.DefaultTask;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.ConfigurationContainer;
import org.gradle.api.tasks.TaskAction;

/**
Expand All @@ -44,11 +45,14 @@ public class DependencyManagementReportTask extends DefaultTask {

private final boolean rootProject;

private final ConfigurationContainer configurationContainer;

public DependencyManagementReportTask() {
Project project = getProject();
this.projectPath = project.getPath();
this.projectDescription = project.getDescription();
this.rootProject = project.getRootProject().equals(project);
this.configurationContainer = project.getConfigurations();
}

void setRenderer(DependencyManagementReportRenderer renderer) {
Expand All @@ -73,7 +77,7 @@ public void report() {
.getManagedVersionsForConfiguration(null);
this.renderer.renderGlobalManagedVersions(globalManagedVersions);
Set<Configuration> configurations = new TreeSet<>(Comparator.comparing(Configuration::getName));
configurations.addAll(getProject().getConfigurations());
configurations.addAll(this.configurationContainer);
for (Configuration configuration : configurations) {
Map<String, String> managedVersions = this.dependencyManagementContainer
.getManagedVersionsForConfiguration(configuration);
Expand Down

0 comments on commit e870ef7

Please sign in to comment.