Skip to content

Commit

Permalink
Remove support for Gradle 6 and 7
Browse files Browse the repository at this point in the history
Closes gh-1586
  • Loading branch information
mhalbritter committed Nov 19, 2024
1 parent 445a1ce commit 89acacd
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 822 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public BuildCustomizer<GradleBuild> warPluginContributor() {
}

@Bean
@ConditionalOnGradleVersion({ "6", "7", "8" })
@ConditionalOnBuildSystem(id = GradleBuildSystem.ID)
BuildCustomizer<GradleBuild> springBootPluginContributor(ProjectDescription description,
ObjectProvider<DependencyManagementPluginVersionResolver> versionResolver, InitializrMetadata metadata) {
return new SpringBootPluginBuildCustomizer(description, versionResolver
Expand All @@ -134,37 +134,6 @@ public GradleBuildProjectContributor gradleKtsBuildProjectContributor(KotlinDslG
return new GradleBuildProjectContributor(buildWriter, build, this.indentingWriterFactory, "build.gradle.kts");
}

/**
* Configuration specific to projects using Gradle 6.
*
* @deprecated Gradle 6 support is deprecated
*/
@Configuration
@ConditionalOnGradleVersion("6")
@Deprecated
static class Gradle6ProjectGenerationConfiguration {

@Bean
GradleWrapperContributor gradle6WrapperContributor() {
return new GradleWrapperContributor("6");
}

}

/**
* Configuration specific to projects using Gradle 7.
*/
@Configuration
@ConditionalOnGradleVersion("7")
static class Gradle7ProjectGenerationConfiguration {

@Bean
GradleWrapperContributor gradle7WrapperContributor() {
return new GradleWrapperContributor("7");
}

}

/**
* Configuration specific to projects using Gradle 8.
*/
Expand All @@ -184,7 +153,6 @@ GradleWrapperContributor gradle8WrapperContributor() {
*/
@Configuration
@ConditionalOnBuildSystem(id = GradleBuildSystem.ID, dialect = GradleBuildSystem.DIALECT_GROOVY)
@ConditionalOnGradleVersion({ "6", "7", "8" })
static class GradleGroovyProjectGenerationConfiguration {

@Bean
Expand Down Expand Up @@ -218,7 +186,6 @@ GradleAnnotationProcessorScopeBuildCustomizer gradleAnnotationProcessorScopeBuil
*/
@Configuration
@ConditionalOnBuildSystem(id = GradleBuildSystem.ID, dialect = GradleBuildSystem.DIALECT_KOTLIN)
@ConditionalOnGradleVersion({ "6", "7", "8" })
static class GradleKtsProjectGenerationConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import io.spring.initializr.generator.condition.ProjectGenerationCondition;
import io.spring.initializr.generator.project.ProjectDescription;
import io.spring.initializr.generator.version.Version;
import io.spring.initializr.generator.version.VersionParser;
import io.spring.initializr.generator.version.VersionRange;

import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
Expand All @@ -36,13 +34,6 @@
*/
public class OnGradleVersionCondition extends ProjectGenerationCondition {

private static final VersionRange GRADLE_6_VERSION_RANGE = VersionParser.DEFAULT
.parseRange("[2.2.2.RELEASE,2.5.0-RC1)");

private static final VersionRange GRADLE_7_VERSION_RANGE = VersionParser.DEFAULT.parseRange("[2.5.0-RC1,2.7.10)");

private static final VersionRange GRADLE_8_VERSION_RANGE = VersionParser.DEFAULT.parseRange("2.7.10");

@Override
protected boolean matches(ProjectDescription description, ConditionContext context,
AnnotatedTypeMetadata metadata) {
Expand All @@ -59,18 +50,7 @@ private String determineGradleGeneration(Version platformVersion) {
if (platformVersion == null) {
return null;
}
else if (GRADLE_6_VERSION_RANGE.match(platformVersion)) {
return "6";
}
else if (GRADLE_7_VERSION_RANGE.match(platformVersion)) {
return "7";
}
else if (GRADLE_8_VERSION_RANGE.match(platformVersion)) {
return "8";
}
else {
return null;
}
return "8";
}

}
Binary file not shown.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 89acacd

Please sign in to comment.