|
26 | 26 | import java.util.TreeSet;
|
27 | 27 |
|
28 | 28 | import org.gradle.api.DefaultTask;
|
| 29 | +import org.gradle.api.Project; |
29 | 30 | import org.gradle.api.Task;
|
30 | 31 | import org.gradle.api.artifacts.ComponentMetadataDetails;
|
31 | 32 | import org.gradle.api.artifacts.Configuration;
|
32 |
| -import org.gradle.api.artifacts.Dependency; |
33 | 33 | import org.gradle.api.artifacts.DependencyConstraint;
|
34 | 34 | import org.gradle.api.artifacts.DependencyConstraintMetadata;
|
35 | 35 | import org.gradle.api.artifacts.DependencyConstraintSet;
|
@@ -69,13 +69,15 @@ public ExtractVersionConstraints() {
|
69 | 69 | }
|
70 | 70 |
|
71 | 71 | public void enforcedPlatform(String projectPath) {
|
72 |
| - Dependency project = getProject().getDependencies().project(Map.of("path", projectPath)); |
73 |
| - Dependency dependency = getProject().getDependencies().enforcedPlatform(project); |
74 |
| - this.configuration.getDependencies().add(dependency); |
75 |
| - getProject().getPlugins().withType(BomPlugin.class).all((plugin) -> { |
76 |
| - this.boms.add(getProject().getExtensions().getByType(BomExtension.class)); |
| 72 | + this.configuration.getDependencies() |
| 73 | + .add(getProject().getDependencies() |
| 74 | + .enforcedPlatform( |
| 75 | + getProject().getDependencies().project(Collections.singletonMap("path", projectPath)))); |
| 76 | + Project project = getProject().project(projectPath); |
| 77 | + project.getPlugins().withType(BomPlugin.class).all((plugin) -> { |
| 78 | + this.boms.add(project.getExtensions().getByType(BomExtension.class)); |
77 | 79 | this.dependencyConstraintSets
|
78 |
| - .add(getProject().getConfigurations().getByName("apiElements").getAllDependencyConstraints()); |
| 80 | + .add(project.getConfigurations().getByName("apiElements").getAllDependencyConstraints()); |
79 | 81 | });
|
80 | 82 | }
|
81 | 83 |
|
|
0 commit comments