Skip to content

Commit 534e924

Browse files
authored
Remove support for Eclipse CDT 10.7, new minimum is 11.0 (#2373)
2 parents 4c97e1c + aab831c commit 534e924

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1717
* Bump default `jackson` version to latest `2.18.0` -> `2.18.1`. ([#2319](https://github.com/diffplug/spotless/pull/2319))
1818
* Bump default `ktfmt` version to latest `0.52` -> `0.53`. ([#2320](https://github.com/diffplug/spotless/pull/2320))
1919
* Bump default `ktlint` version to latest `1.4.0` -> `1.5.0`. ([#2354](https://github.com/diffplug/spotless/pull/2354))
20+
* Bump minimum `eclipse-cdt` version to `11.0` (removed support for `10.7`). ([#2373](https://github.com/diffplug/spotless/pull/2373))
2021
### Fixed
2122
* You can now use `removeUnusedImports` and `googleJavaFormat` at the same time again. (fixes [#2159](https://github.com/diffplug/spotless/issues/2159))
2223
* The default list of type annotations used by `formatAnnotations` now includes Jakarta Validation's `Valid` and constraints validations (fixes [#2334](https://github.com/diffplug/spotless/issues/2334))
2324

25+
2426
## [3.0.0.BETA4] - 2024-10-24
2527
### Added
2628
* APIs to support linting. (implemented in [#2148](https://github.com/diffplug/spotless/pull/2148), [#2149](https://github.com/diffplug/spotless/pull/2149), [#2307](https://github.com/diffplug/spotless/pull/2307))

lib-extra/build.gradle

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ def NEEDS_P2_DEPS = [
5050
'groovy',
5151
'jdt'
5252
]
53+
if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
54+
NEEDS_P2_DEPS.remove('cdt')
55+
}
5356
for (needsP2 in NEEDS_P2_DEPS) {
5457
sourceSets.register(needsP2) {
5558
compileClasspath += sourceSets.main.output
@@ -74,11 +77,12 @@ tasks.withType(Test).configureEach {
7477

7578
apply plugin: 'dev.equo.p2deps'
7679
p2deps {
77-
// (alphabetic order please)
78-
into 'cdtCompileOnly', {
79-
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
80-
p2repo 'https://download.eclipse.org/tools/cdt/releases/10.7/'
81-
install 'org.eclipse.cdt.core'
80+
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
81+
into 'cdtCompileOnly', {
82+
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
83+
p2repo 'https://download.eclipse.org/tools/cdt/releases/11.0/'
84+
install 'org.eclipse.cdt.core'
85+
}
8286
}
8387
into 'groovyCompileOnly', {
8488
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'

lib-extra/src/main/java/com/diffplug/spotless/extra/cpp/EclipseCdtFormatterStep.java

Lines changed: 2 additions & 2 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.
@@ -38,7 +38,7 @@ public final class EclipseCdtFormatterStep {
3838
private EclipseCdtFormatterStep() {}
3939

4040
private static final String NAME = "eclipse cdt formatter";
41-
private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(11, "10.7").add(17, "11.6");
41+
private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(17, "11.6");
4242

4343
public static String defaultVersion() {
4444
return JVM_SUPPORT.getRecommendedFormatterVersion();

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

Lines changed: 6 additions & 2 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,11 @@
1515
*/
1616
package com.diffplug.spotless.extra.cpp;
1717

18+
import static org.junit.jupiter.api.condition.JRE.JAVA_17;
19+
1820
import java.util.stream.Stream;
1921

22+
import org.junit.jupiter.api.condition.EnabledForJreRange;
2023
import org.junit.jupiter.params.ParameterizedTest;
2124
import org.junit.jupiter.params.provider.MethodSource;
2225

@@ -30,13 +33,14 @@ public EclipseCdtFormatterStepTest() {
3033

3134
@ParameterizedTest
3235
@MethodSource
36+
@EnabledForJreRange(min = JAVA_17)
3337
void formatWithVersion(String version) throws Exception {
3438
harnessFor(version).test("main.c",
3539
"#include <a.h>;\nint main(int argc, \nchar *argv[]) {}",
3640
"#include <a.h>;\nint main(int argc, char *argv[]) {\n}\n");
3741
}
3842

3943
private static Stream<String> formatWithVersion() {
40-
return Stream.of("10.6", "10.7", EclipseCdtFormatterStep.defaultVersion());
44+
return Stream.of("11.0", "11.6", EclipseCdtFormatterStep.defaultVersion());
4145
}
4246
}

plugin-gradle/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
99
* Bump default `jackson` version to latest `2.18.0` -> `2.18.1`. ([#2319](https://github.com/diffplug/spotless/pull/2319))
1010
* Bump default `ktfmt` version to latest `0.52` -> `0.53`. ([#2320](https://github.com/diffplug/spotless/pull/2320))
1111
* Bump default `ktlint` version to latest `1.4.0` -> `1.5.0`. ([#2354](https://github.com/diffplug/spotless/pull/2354))
12+
* Bump minimum `eclipse-cdt` version to `11.0` (removed support for `10.7`). ([#2373](https://github.com/diffplug/spotless/pull/2373))
1213
### Fixed
1314
* You can now use `removeUnusedImports` and `googleJavaFormat` at the same time again. (fixes [#2159](https://github.com/diffplug/spotless/issues/2159))
1415
* The default list of type annotations used by `formatAnnotations` now includes Jakarta Validation's `Valid` and constraints validations (fixes [#2334](https://github.com/diffplug/spotless/issues/2334))

plugin-maven/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
88
* Bump default `jackson` version to latest `2.18.0` -> `2.18.1`. ([#2319](https://github.com/diffplug/spotless/pull/2319))
99
* Bump default `ktfmt` version to latest `0.52` -> `0.53`. ([#2320](https://github.com/diffplug/spotless/pull/2320))
1010
* Bump default `ktlint` version to latest `1.4.0` -> `1.5.0`. ([#2354](https://github.com/diffplug/spotless/pull/2354))
11+
* Bump minimum `eclipse-cdt` version to `11.0` (removed support for `10.7`). ([#2373](https://github.com/diffplug/spotless/pull/2373))
1112
### Fixed
1213
* You can now use `removeUnusedImports` and `googleJavaFormat` at the same time again. (fixes [#2159](https://github.com/diffplug/spotless/issues/2159))
1314
* The default list of type annotations used by `formatAnnotations` now includes Jakarta Validation's `Valid` and constraints validations (fixes [#2334](https://github.com/diffplug/spotless/issues/2334))

0 commit comments

Comments
 (0)