Skip to content

Commit 62973f7

Browse files
committed
Bump the min Gradle and Java requirements to 7.3 and 17
1 parent 0a684ce commit 62973f7

File tree

9 files changed

+12
-104
lines changed

9 files changed

+12
-104
lines changed

.github/workflows/ci.yml

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

lib-extra/src/test/java/com/diffplug/spotless/extra/cpp/EclipseCdtFormatterStepTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@
1515
*/
1616
package com.diffplug.spotless.extra.cpp;
1717

18-
import static org.junit.jupiter.api.condition.JRE.JAVA_17;
19-
2018
import java.util.stream.Stream;
2119

22-
import org.junit.jupiter.api.condition.EnabledForJreRange;
2320
import org.junit.jupiter.params.ParameterizedTest;
2421
import org.junit.jupiter.params.provider.MethodSource;
2522

@@ -33,7 +30,6 @@ public EclipseCdtFormatterStepTest() {
3330

3431
@ParameterizedTest
3532
@MethodSource
36-
@EnabledForJreRange(min = JAVA_17)
3733
void formatWithVersion(String version) throws Exception {
3834
harnessFor(version).test("main.c",
3935
"#include <a.h>;\nint main(int argc, \nchar *argv[]) {}",

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
}

testlib/src/test/java/com/diffplug/spotless/java/GoogleJavaFormatStepTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,8 +15,6 @@
1515
*/
1616
package com.diffplug.spotless.java;
1717

18-
import static org.junit.jupiter.api.condition.JRE.JAVA_13;
19-
import static org.junit.jupiter.api.condition.JRE.JAVA_15;
2018
import static org.junit.jupiter.api.condition.JRE.JAVA_20;
2119
import static org.junit.jupiter.api.condition.JRE.JAVA_21;
2220

@@ -33,15 +31,13 @@
3331
class GoogleJavaFormatStepTest extends ResourceHarness {
3432

3533
@Test
36-
@EnabledForJreRange(min = JAVA_13)
3734
void jvm13Features() throws Exception {
3835
try (StepHarness step = StepHarness.forStep(GoogleJavaFormatStep.create(TestProvisioner.mavenCentral()))) {
3936
step.testResource("java/googlejavaformat/TextBlock.dirty", "java/googlejavaformat/TextBlock.clean");
4037
}
4138
}
4239

4340
@Test
44-
@EnabledForJreRange(max = JAVA_15) // google-java-format requires JRE 11+
4541
void behavior18() throws Exception {
4642
FormatterStep step = GoogleJavaFormatStep.create("1.8", TestProvisioner.mavenCentral());
4743
StepHarness.forStep(step)

testlib/src/test/java/com/diffplug/spotless/java/PalantirJavaFormatStepTest.java

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

18-
import static org.junit.jupiter.api.condition.JRE.JAVA_13;
19-
2018
import org.junit.jupiter.api.Test;
21-
import org.junit.jupiter.api.condition.EnabledForJreRange;
2219

2320
import com.diffplug.spotless.FormatterStep;
2421
import com.diffplug.spotless.ResourceHarness;
@@ -29,7 +26,6 @@
2926
class PalantirJavaFormatStepTest extends ResourceHarness {
3027

3128
@Test
32-
@EnabledForJreRange(min = JAVA_13)
3329
void jvm13Features() throws Exception {
3430
try (StepHarness step = StepHarness.forStep(PalantirJavaFormatStep.create(TestProvisioner.mavenCentral()))) {
3531
step.testResource("java/palantirjavaformat/TextBlock.dirty", "java/palantirjavaformat/TextBlock.clean");

testlib/src/test/java/com/diffplug/spotless/rdf/RdfFormatterTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 DiffPlug
2+
* Copyright 2024-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,8 +15,6 @@
1515
*/
1616
package com.diffplug.spotless.rdf;
1717

18-
import static org.junit.jupiter.api.condition.JRE.JAVA_17;
19-
2018
import java.io.IOException;
2119
import java.nio.file.Path;
2220
import java.util.ArrayList;
@@ -27,7 +25,6 @@
2725

2826
import org.jetbrains.annotations.NotNull;
2927
import org.junit.jupiter.api.Test;
30-
import org.junit.jupiter.api.condition.EnabledForJreRange;
3128
import org.junit.jupiter.params.provider.Arguments;
3229
import org.opentest4j.AssertionFailedError;
3330

@@ -52,15 +49,13 @@ private static FormatterStep forTurtleFormatterVersionAndStyle(String version, M
5249
public RdfFormatterTest() {}
5350

5451
@Test
55-
@EnabledForJreRange(min = JAVA_17)
5652
void testTurtleFormatter_1_2_12_DefaultStyle() throws IOException, ClassNotFoundException {
5753
String inputDir = "/rdf/ttl/input/";
5854
String expectedOutputDir = "/rdf/ttl/expected/v1.2.12-default/";
5955
testBeforeAfterFolders(inputDir, expectedOutputDir, StepHarness.forStep(forTurtleFormatterVersion("1.2.12")));
6056
}
6157

6258
@Test
63-
@EnabledForJreRange(min = JAVA_17)
6459
void testTurtleFormatter_1_2_12_style01() throws IOException, ClassNotFoundException {
6560
String inputDir = "/rdf/ttl/input/";
6661
String expectedOutputDir = "/rdf/ttl/expected/v1.2.12-style01/";

0 commit comments

Comments
 (0)