Skip to content

Commit d3e013e

Browse files
committed
Bump the min Gradle and Java requirements to 7.3 and 17
1 parent 3b66bf0 commit d3e013e

File tree

5 files changed

+10
-85
lines changed

5 files changed

+10
-85
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -109,37 +109,3 @@ jobs:
109109
check_name: JUnit ${{ matrix.kind }} ${{ matrix.jre }} ${{ matrix.os }}
110110
report_paths: '*/build/test-results/*/TEST-*.xml'
111111
check_retries: true
112-
113-
# Gradle 9 requires Java 17 or higher, we use Gradle 8.14 (instead of gradlew) to build on Java 11.
114-
build-on-java-11:
115-
needs: sanityCheck
116-
strategy:
117-
fail-fast: false
118-
matrix:
119-
kind: [maven, gradle]
120-
jre: [11]
121-
os: [ubuntu-latest]
122-
runs-on: ${{ matrix.os }}
123-
steps:
124-
- name: Checkout
125-
uses: actions/checkout@v4
126-
- uses: actions/setup-java@v4
127-
with:
128-
distribution: "temurin"
129-
java-version: ${{ matrix.jre }}
130-
- uses: gradle/actions/setup-gradle@v4
131-
with:
132-
gradle-version: 8.14.2
133-
- name: build (maven-only)
134-
if: matrix.kind == 'maven'
135-
run: gradle :plugin-maven:build -x spotlessCheck
136-
- name: build (everything-but-maven)
137-
if: matrix.kind == 'gradle'
138-
run: gradle build -x spotlessCheck -PSPOTLESS_EXCLUDE_MAVEN=true
139-
- name: junit result
140-
uses: mikepenz/action-junit-report@v5
141-
if: always() # always run even if the previous step fails
142-
with:
143-
check_name: JUnit ${{ matrix.kind }} ${{ matrix.jre }} ${{ matrix.os }}
144-
report_paths: '*/build/test-results/*/TEST-*.xml'
145-
check_retries: true

plugin-gradle/CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
55
## [Unreleased]
66

77
### Changed
8-
* Bump the min Gradle requirement from `6.1.1` to `7.1`. ([#2540](https://github.com/diffplug/spotless/pull/2540))
8+
* Bump the min Gradle and Java requirements to `7.3` and `17`. ([#2540](https://github.com/diffplug/spotless/pull/2540))
99

1010
## [7.1.0] - 2025-07-07
1111
### Added

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/SpotlessPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828
public class SpotlessPlugin implements Plugin<Project> {
2929
static final String SPOTLESS_MODERN = "spotlessModern";
30-
static final String VER_GRADLE_min = "7.1";
30+
static final String VER_GRADLE_min = "7.3";
3131
static final String VER_GRADLE_minVersionForCustom = "8.4";
32-
private static final int MINIMUM_JRE = 11;
32+
private static final int MINIMUM_JRE = 17;
3333

3434
@Override
3535
public void apply(Project project) {

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/GradleIntegrationHarness.java

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@
4343

4444
public class GradleIntegrationHarness extends ResourceHarness {
4545
public enum GradleVersionSupport {
46-
JRE_11("5.0"), MINIMUM(SpotlessPlugin.VER_GRADLE_min), CUSTOM_STEPS(SpotlessPlugin.VER_GRADLE_minVersionForCustom),
46+
MINIMUM(SpotlessPlugin.VER_GRADLE_min),
47+
4748
// https://docs.gradle.org/7.5/userguide/configuration_cache.html#config_cache:stable
48-
STABLE_CONFIGURATION_CACHE("7.5");
49+
STABLE_CONFIGURATION_CACHE("7.5"),
50+
51+
CUSTOM_STEPS(SpotlessPlugin.VER_GRADLE_minVersionForCustom),
52+
53+
;
4954

5055
final String version;
5156

@@ -72,18 +77,6 @@ public enum GradleVersionSupport {
7277
case 18:
7378
minVersionForRunningJRE = "7.5";
7479
break;
75-
case 17:
76-
minVersionForRunningJRE = "7.3";
77-
break;
78-
case 16:
79-
minVersionForRunningJRE = "7.0";
80-
break;
81-
case 15:
82-
minVersionForRunningJRE = "6.7";
83-
break;
84-
case 14:
85-
minVersionForRunningJRE = "6.3";
86-
break;
8780
default:
8881
minVersionForRunningJRE = null;
8982
break;

plugin-gradle/src/test/java/com/diffplug/gradle/spotless/SpotlessPluginRedirectTest.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@
1515
*/
1616
package com.diffplug.gradle.spotless;
1717

18-
import static org.junit.jupiter.api.condition.JRE.JAVA_11;
19-
2018
import java.io.IOException;
2119

2220
import org.assertj.core.api.Assertions;
2321
import org.junit.jupiter.api.Test;
24-
import org.junit.jupiter.api.condition.EnabledForJreRange;
2522

2623
import com.diffplug.common.base.StringPrinter;
2724

@@ -39,35 +36,4 @@ void redirectPluginModernGradle() throws IOException {
3936
" To migrate:",
4037
" - Test your build with: id 'com.diffplug.gradle.spotless' version '4.5.1'"));
4138
}
42-
43-
@Test
44-
@EnabledForJreRange(max = JAVA_11)
45-
void redirectPluginOldGradle() throws IOException {
46-
setFile("build.gradle").toLines(
47-
"plugins {",
48-
" id 'com.diffplug.gradle.spotless'",
49-
"}");
50-
Assertions.assertThat(gradleRunner().withGradleVersion(GradleVersionSupport.JRE_11.version)
51-
.buildAndFail().getOutput().replace("\r", ""))
52-
.contains(StringPrinter.buildStringFromLines(
53-
"> Failed to apply plugin [id 'com.diffplug.gradle.spotless']",
54-
" > We have moved from 'com.diffplug.gradle.spotless'",
55-
" to 'com.diffplug.spotless'",
56-
" To migrate:",
57-
" - Upgrade Gradle to 7.1 or newer (you're on 5.0)",
58-
" - Test your build with: id 'com.diffplug.gradle.spotless' version '4.5.1'"));
59-
}
60-
61-
@Test
62-
@EnabledForJreRange(max = JAVA_11)
63-
void realPluginOldGradle() throws IOException {
64-
setFile("build.gradle").toLines(
65-
"plugins {",
66-
" id 'com.diffplug.spotless'",
67-
"}");
68-
Assertions.assertThat(gradleRunner().withGradleVersion(GradleVersionSupport.JRE_11.version)
69-
.buildAndFail().getOutput().replace("\r", ""))
70-
.contains(StringPrinter.buildStringFromLines(
71-
"Spotless requires Gradle 7.1 or newer, this was 5.0"));
72-
}
7339
}

0 commit comments

Comments
 (0)