Skip to content

Commit

Permalink
Raise the minimum supported version of Gradle to 6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Jul 1, 2022
1 parent 69c92c6 commit 842b35b
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 107 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ honour any exclusions declared in the poms of your project's dependencies.

The Plugin has the following requirements:

- Gradle 2.x (2.9 or later), 3.x, 4.x, 5.x, 6.x, or 7.x. Gradle 2.8 and earlier are not supported.
- Gradle 6.x (6.8 or later) or 7.x. Gradle 6.7 and earlier are not supported.
- Java 8 or later

[[getting-started]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,9 @@ class ConfigurationModelResolver implements ModelResolver {

private final DependencyManagementConfigurationContainer configurationContainer;

private final PlatformCategoryAttributeConfigurer attributeConfigurer;

ConfigurationModelResolver(Project project, DependencyManagementConfigurationContainer configurationContainer,
PlatformCategoryAttributeConfigurer attributeConfigurer) {
ConfigurationModelResolver(Project project, DependencyManagementConfigurationContainer configurationContainer) {
this.project = project;
this.configurationContainer = configurationContainer;
this.attributeConfigurer = attributeConfigurer;
}

@Override
Expand All @@ -66,7 +62,6 @@ public ModelSource resolveModel(String groupId, String artifactId, String versio

private FileModelSource resolveModel(String coordinates) {
Dependency dependency = this.project.getDependencies().create(coordinates);
this.attributeConfigurer.configureCategoryAttribute(dependency);
Configuration configuration = this.configurationContainer.newConfiguration(dependency);
return new FileModelSource(configuration.resolve().iterator().next());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ final class EffectiveModelBuilder {

private final ModelResolver modelResolver;

EffectiveModelBuilder(Project project, DependencyManagementConfigurationContainer configurationContainer,
PlatformCategoryAttributeConfigurer attributeConfigurer) {
this.modelResolver = new ConfigurationModelResolver(project, configurationContainer, attributeConfigurer);
EffectiveModelBuilder(Project project, DependencyManagementConfigurationContainer configurationContainer) {
this.modelResolver = new ConfigurationModelResolver(project, configurationContainer);
}

List<Model> buildModels(List<ModelInput> inputs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
*/
public class MavenPomResolver implements PomResolver {

private final PlatformCategoryAttributeConfigurer attributeConfigurer = new PlatformCategoryAttributeConfigurer();

private final DependencyManagementConfigurationContainer configurationContainer;

private final EffectiveModelBuilder effectiveModelBuilder;
Expand All @@ -69,8 +67,7 @@ public class MavenPomResolver implements PomResolver {
*/
public MavenPomResolver(Project project, DependencyManagementConfigurationContainer configurationContainer) {
this.configurationContainer = configurationContainer;
this.effectiveModelBuilder = new EffectiveModelBuilder(project, configurationContainer,
this.attributeConfigurer);
this.effectiveModelBuilder = new EffectiveModelBuilder(project, configurationContainer);
this.dependencyHandler = project.getDependencies();
}

Expand Down Expand Up @@ -108,7 +105,6 @@ private Configuration createConfiguration(List<PomReference> pomReferences) {
Coordinates coordinates = pomReference.getCoordinates();
org.gradle.api.artifacts.Dependency dependency = this.dependencyHandler.create(coordinates.getGroupId()
+ ":" + coordinates.getArtifactId() + ":" + coordinates.getVersion() + "@pom");
this.attributeConfigurer.configureCategoryAttribute(dependency);
configuration.getDependencies().add(dependency);
}
return configuration;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,17 @@ class GradleVersionCompatibilityIntegrationTests {

@ParameterizedTest(name = "Gradle {0}")
@MethodSource("gradleVersions")
void pluginIsCompatible(String gradleVersion, String configuration) {
BuildResult result = this.gradleBuild.runner().withGradleVersion(gradleVersion)
.withArguments("-Pconfiguration=" + configuration, "resolve").build();
void pluginIsCompatible(String gradleVersion) {
BuildResult result = this.gradleBuild.runner().withGradleVersion(gradleVersion).withArguments("resolve")
.build();
assertThat(result.task(":resolve").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
}

static List<String[]> gradleVersions() {
List<String> compileVersions = Arrays.asList("2.9", "2.10", "2.11", "2.12", "2.13", "2.14.1", "3.0", "3.1",
"3.2", "3.3", "3.4.1", "3.5.1", "4.0", "4.1", "4.2.1", "4.3.1", "4.4.1", "4.5.1", "4.6", "4.7", "4.8",
"4.9", "4.10.3");
List<String> implementationVersions = Arrays.asList("5.0", "5.1.1", "5.2.1", "5.3.1", "5.4.1", "5.5.1", "5.6.4",
"6.0.1", "6.1.1", "6.2.2", "6.3", "6.4.1", "6.5.1", "6.6.1", "6.7.1", "6.8.3", "7.0.2", "7.1.1", "7.2",
"7.3.3", "7.4.2");
List<String> versions = Arrays.asList("6.8.3", "7.0.2", "7.1.1", "7.2", "7.3.3");
List<String[]> result = new ArrayList<>();
for (String version : compileVersions) {
result.add(new String[] { version, "compile" });
}
for (String version : implementationVersions) {
result.add(new String[] { version, "implementation" });
for (String version : versions) {
result.add(new String[] { version });
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.Collections;

import groovy.util.Node;
import groovy.util.XmlParser;
import groovy.xml.XmlParser;
import groovy.xml.XmlUtil;
import io.spring.gradle.dependencymanagement.NodeAssert;
import io.spring.gradle.dependencymanagement.internal.DependencyManagementSettings.PomCustomizationSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ dependencyManagement {
}

dependencies {
add(project.getProperty("configuration"), 'org.springframework.boot:spring-boot-starter')
implementation('org.springframework.boot:spring-boot-starter')
}

task resolve {
doFirst {
def configurationName = (project.getProperty("configuration") == "compile") ? "compile" : "runtimeClasspath"
def names = configurations.getByName(configurationName).resolve().collect { it.name }
def names = configurations.runtimeClasspath.resolve().collect { it.name }
if (!names.containsAll("spring-boot-starter-1.4.2.RELEASE.jar", "spring-boot-1.4.2.RELEASE.jar",
"spring-boot-autoconfigure-1.4.2.RELEASE.jar",
"spring-boot-starter-logging-1.4.2.RELEASE.jar", "spring-core-4.3.4.RELEASE.jar",
Expand Down

0 comments on commit 842b35b

Please sign in to comment.