Skip to content

Commit e7e52fc

Browse files
authored
Merge branch 'main' into bump-ktfmt-046
2 parents 21c9090 + 7717dba commit e7e52fc

File tree

28 files changed

+116
-59
lines changed

28 files changed

+116
-59
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ jobs:
4242
fail-fast: false
4343
matrix:
4444
kind: [maven, gradle]
45-
jre: [11, 17]
45+
# Test on the latest Java version once Gradle & Maven support it.
46+
jre: [11, 17, 21]
4647
os: [ubuntu-latest]
4748
include:
4849
# test windows at the diagonals of the above matrix

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1111

1212
## [Unreleased]
1313
### Changes
14+
* Use palantir-java-format `2.38.0` on Java 21. ([#1920](https://github.com/diffplug/spotless/pull/1920))
1415
* Bump default `ktfmt` version to latest `0.44` -> `0.46`. ([#1927](https://github.com/diffplug/spotless/pull/1927))
16+
* Bump default `googleJavaFormat` version to latest `1.17.0` -> `1.18.1`. ([#1920](https://github.com/diffplug/spotless/pull/1920))
1517

1618
## [2.43.0] - 2023-11-27
1719
### Added

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ VER_SLF4J=[1.6,2.0[
2929
# Used in multiple places
3030
VER_DURIAN=1.2.0
3131
VER_JGIT=6.7.0.202309050840-r
32-
VER_JUNIT=5.10.0
32+
VER_JUNIT=5.10.1
3333
VER_ASSERTJ=3.24.2
34-
VER_MOCKITO=5.6.0
34+
VER_MOCKITO=5.8.0

gradle/java-setup.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ tasks.withType(JavaCompile).configureEach {
1515
apply plugin: 'com.github.spotbugs'
1616
spotbugs {
1717
ignoreFailures = false // bug free or it doesn't ship!
18-
reportLevel = 'medium' // low|medium|high (low = sensitive to even minor mistakes)
18+
// LOW|MEDIUM|DEFAULT|HIGH (low = sensitive to even minor mistakes).
19+
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('MEDIUM')
1920
omitVisitors = [
2021
// https://spotbugs.readthedocs.io/en/latest/detectors.html#constructorthrow
2122
'ConstructorThrow',

gradle/wrapper/gradle-wrapper.jar

-19.8 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.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

lib-extra/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,8 @@ p2deps {
9191
}
9292

9393
// we'll hold the core lib to a high standard
94-
spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even minor mistakes)
94+
spotbugs {
95+
// LOW|MEDIUM|DEFAULT|HIGH (low = sensitive to even minor mistakes).
96+
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('LOW')
97+
}
9598

lib/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ dependencies {
8484
gherkinCompileOnly 'io.cucumber:gherkin-utils:8.0.2'
8585
gherkinCompileOnly 'org.slf4j:slf4j-api:2.0.0'
8686
// googleJavaFormat
87-
googleJavaFormatCompileOnly 'com.google.googlejavaformat:google-java-format:1.17.0'
87+
googleJavaFormatCompileOnly 'com.google.googlejavaformat:google-java-format:1.18.1'
8888
// gson
8989
gsonCompileOnly 'com.google.code.gson:gson:2.10.1'
9090
// jackson
@@ -126,7 +126,10 @@ dependencies {
126126
}
127127

128128
// we'll hold the core lib to a high standard
129-
spotbugs { reportLevel = 'low' } // low|medium|high (low = sensitive to even minor mistakes)
129+
spotbugs {
130+
// LOW|MEDIUM|DEFAULT|HIGH (low = sensitive to even minor mistakes).
131+
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('LOW')
132+
}
130133

131134
apply from: rootProject.file('gradle/special-tests.gradle')
132135
tasks.withType(Test).configureEach {

lib/src/main/java/com/diffplug/spotless/java/GoogleJavaFormatStep.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private GoogleJavaFormatStep() {}
3535
private static final boolean DEFAULT_REORDER_IMPORTS = false;
3636
private static final boolean DEFAULT_FORMAT_JAVADOC = true;
3737
static final String NAME = "google-java-format";
38-
static final String MAVEN_COORDINATE = "com.google.googlejavaformat:google-java-format";
38+
public static final String MAVEN_COORDINATE = "com.google.googlejavaformat:google-java-format";
3939

4040
/** Creates a step which formats everything - code, import order, and unused imports. */
4141
public static FormatterStep create(Provisioner provisioner) {
@@ -83,7 +83,7 @@ public static FormatterStep create(String groupArtifact, String version, String
8383
.addMin(11, "1.8") // we only support google-java-format >= 1.8 due to api changes
8484
.addMin(16, "1.10.0") // java 16 requires at least 1.10.0 due to jdk api changes in JavaTokenizer
8585
.addMin(21, "1.17.0") // java 21 requires at least 1.17.0 due to https://github.com/google/google-java-format/issues/898
86-
.add(11, "1.17.0"); // default version
86+
.add(11, "1.18.1"); // default version
8787

8888
public static String defaultGroupArtifact() {
8989
return MAVEN_COORDINATE;

lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ private PalantirJavaFormatStep() {}
2929

3030
private static final String DEFAULT_STYLE = "PALANTIR";
3131
private static final String NAME = "palantir-java-format";
32-
private static final String MAVEN_COORDINATE = "com.palantir.javaformat:palantir-java-format:";
33-
private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(8, "1.1.0").add(11, "2.28.0");
32+
public static final String MAVEN_COORDINATE = "com.palantir.javaformat:palantir-java-format:";
33+
private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(8, "1.1.0").add(11, "2.28.0").add(21, "2.38.0");
3434

3535
/** Creates a step which formats everything - code, import order, and unused imports. */
3636
public static FormatterStep create(Provisioner provisioner) {

0 commit comments

Comments
 (0)