Skip to content

Commit b64ab47

Browse files
authored
Bump the min Gradle and Java requirements to 7.3 and 17 (#2540, first step towards #2375)
2 parents a7824c9 + 5949783 commit b64ab47

File tree

23 files changed

+52
-127
lines changed

23 files changed

+52
-127
lines changed

.github/workflows/changelog-print.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ jobs:
1010
name: changelogPrint
1111
steps:
1212
- uses: actions/checkout@v4
13-
- name: jdk 11
14-
uses: actions/setup-java@v4
13+
- uses: actions/setup-java@v4
1514
with:
16-
java-version: 11
15+
java-version: 21
1716
distribution: 'temurin'
1817
- name: gradle caching
1918
uses: gradle/actions/setup-gradle@v4

.github/workflows/ci.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ jobs:
2323
uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 0
26-
- name: Install JDK 11
27-
uses: actions/setup-java@v4
26+
- uses: actions/setup-java@v4
2827
with:
2928
distribution: "temurin"
30-
java-version: 11
29+
java-version: 21
3130
- name: gradle caching
3231
uses: gradle/actions/setup-gradle@v4
3332
- name: spotlessCheck
@@ -41,33 +40,25 @@ jobs:
4140
matrix:
4241
kind: [maven, gradle]
4342
# Test on the latest Java version once Gradle & Maven support it.
44-
jre: [11, 17, 21, 24]
45-
os: [ubuntu-latest]
43+
jre: [17, 21, 24]
44+
os: [ubuntu-latest, windows-latest]
4645
include:
47-
# test windows at the diagonals of the above matrix
48-
- kind: maven
49-
jre: 11
50-
os: windows-latest
51-
- kind: gradle
52-
jre: 17
53-
os: windows-latest
5446
# npm on linux only (crazy slow on windows)
5547
- kind: npm
56-
jre: 11
48+
jre: 17
5749
os: ubuntu-latest
5850
- kind: shfmt
59-
jre: 11
51+
jre: 17
6052
os: ubuntu-latest
6153
shfmt-version: v3.8.0
6254
- kind: idea
63-
jre: 11
55+
jre: 17
6456
os: ubuntu-latest
6557
runs-on: ${{ matrix.os }}
6658
steps:
6759
- name: Checkout
6860
uses: actions/checkout@v4
69-
- name: Install JDK ${{ matrix.distribution }} ${{ matrix.java_version }}
70-
uses: actions/setup-java@v4
61+
- uses: actions/setup-java@v4
7162
with:
7263
distribution: "temurin"
7364
java-version: ${{ matrix.jre }}

.github/workflows/deploy.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ jobs:
3838
ORG_GRADLE_PROJECT_gpg_key64: ${{ secrets.GPG_KEY64 }}
3939
steps:
4040
- uses: actions/checkout@v4
41-
- name: jdk 11
42-
uses: actions/setup-java@v4
41+
- uses: actions/setup-java@v4
4342
with:
44-
java-version: 17
43+
java-version: 21
4544
distribution: 'temurin'
4645
- name: gradle caching
4746
uses: gradle/actions/setup-gradle@v4

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This document is intended for Spotless developers.
1010
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
1111

1212
## [Unreleased]
13+
### Changes
14+
* **BREAKING** Bump the required Java to `17`. ([#2375](https://github.com/diffplug/spotless/issues/2375), [#2540](https://github.com/diffplug/spotless/pull/2540))
1315

1416
## [3.3.0] - 2025-07-20
1517
### Added

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1024m -Dfile.encoding=UTF-8
33
org.gradle.parallel=true
44
org.gradle.caching=true
55
org.gradle.configuration-cache=true
6+
org.gradle.configuration-cache.parallel=true
67

78
name=spotless
89
description=Spotless - keep your code spotless with Gradle
@@ -32,4 +33,4 @@ VER_JGIT=6.10.1.202505221210-r
3233
VER_JUNIT=5.13.3
3334
VER_ASSERTJ=3.27.3
3435
VER_MOCKITO=5.18.0
35-
VER_SELFIE=2.5.3
36+
VER_SELFIE=2.5.3

gradle/wrapper/gradle-wrapper.jar

1.65 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-rc-1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.

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[]) {}",

lib/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.gradle.util.GradleVersion
2+
13
plugins {
24
id 'java-library'
35
id 'io.github.davidburstrom.version-compatibility'
@@ -148,6 +150,11 @@ tasks.withType(Test).configureEach {
148150
// https://docs.gradle.org/7.5/userguide/upgrading_version_7.html#removes_implicit_add_opens_for_test_workers
149151
jvmArgs "--add-opens=java.base/java.lang=ALL-UNNAMED"
150152
}
153+
154+
if (GradleVersion.current() >= GradleVersion.version('9.0')) {
155+
// https://github.com/gradle/gradle/issues/33619
156+
failOnNoDiscoveredTests = false
157+
}
151158
}
152159

153160
jar {

0 commit comments

Comments
 (0)