Skip to content

Commit

Permalink
Remove support for Eclipse CDT 10.7, new minimum is 11.0 (#2373)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg authored Jan 1, 2025
2 parents 4c97e1c + aab831c commit 534e924
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
* Bump default `jackson` version to latest `2.18.0` -> `2.18.1`. ([#2319](https://github.com/diffplug/spotless/pull/2319))
* Bump default `ktfmt` version to latest `0.52` -> `0.53`. ([#2320](https://github.com/diffplug/spotless/pull/2320))
* Bump default `ktlint` version to latest `1.4.0` -> `1.5.0`. ([#2354](https://github.com/diffplug/spotless/pull/2354))
* Bump minimum `eclipse-cdt` version to `11.0` (removed support for `10.7`). ([#2373](https://github.com/diffplug/spotless/pull/2373))
### Fixed
* You can now use `removeUnusedImports` and `googleJavaFormat` at the same time again. (fixes [#2159](https://github.com/diffplug/spotless/issues/2159))
* 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))


## [3.0.0.BETA4] - 2024-10-24
### Added
* 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))
Expand Down
14 changes: 9 additions & 5 deletions lib-extra/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def NEEDS_P2_DEPS = [
'groovy',
'jdt'
]
if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
NEEDS_P2_DEPS.remove('cdt')
}
for (needsP2 in NEEDS_P2_DEPS) {
sourceSets.register(needsP2) {
compileClasspath += sourceSets.main.output
Expand All @@ -74,11 +77,12 @@ tasks.withType(Test).configureEach {

apply plugin: 'dev.equo.p2deps'
p2deps {
// (alphabetic order please)
into 'cdtCompileOnly', {
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
p2repo 'https://download.eclipse.org/tools/cdt/releases/10.7/'
install 'org.eclipse.cdt.core'
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
into 'cdtCompileOnly', {
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
p2repo 'https://download.eclipse.org/tools/cdt/releases/11.0/'
install 'org.eclipse.cdt.core'
}
}
into 'groovyCompileOnly', {
p2repo 'https://download.eclipse.org/eclipse/updates/4.26/'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2024 DiffPlug
* Copyright 2016-2025 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,7 +38,7 @@ public final class EclipseCdtFormatterStep {
private EclipseCdtFormatterStep() {}

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

public static String defaultVersion() {
return JVM_SUPPORT.getRecommendedFormatterVersion();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2024 DiffPlug
* Copyright 2016-2025 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,8 +15,11 @@
*/
package com.diffplug.spotless.extra.cpp;

import static org.junit.jupiter.api.condition.JRE.JAVA_17;

import java.util.stream.Stream;

import org.junit.jupiter.api.condition.EnabledForJreRange;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

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

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

private static Stream<String> formatWithVersion() {
return Stream.of("10.6", "10.7", EclipseCdtFormatterStep.defaultVersion());
return Stream.of("11.0", "11.6", EclipseCdtFormatterStep.defaultVersion());
}
}
1 change: 1 addition & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
* Bump default `jackson` version to latest `2.18.0` -> `2.18.1`. ([#2319](https://github.com/diffplug/spotless/pull/2319))
* Bump default `ktfmt` version to latest `0.52` -> `0.53`. ([#2320](https://github.com/diffplug/spotless/pull/2320))
* Bump default `ktlint` version to latest `1.4.0` -> `1.5.0`. ([#2354](https://github.com/diffplug/spotless/pull/2354))
* Bump minimum `eclipse-cdt` version to `11.0` (removed support for `10.7`). ([#2373](https://github.com/diffplug/spotless/pull/2373))
### Fixed
* You can now use `removeUnusedImports` and `googleJavaFormat` at the same time again. (fixes [#2159](https://github.com/diffplug/spotless/issues/2159))
* 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))
Expand Down
1 change: 1 addition & 0 deletions plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
* Bump default `jackson` version to latest `2.18.0` -> `2.18.1`. ([#2319](https://github.com/diffplug/spotless/pull/2319))
* Bump default `ktfmt` version to latest `0.52` -> `0.53`. ([#2320](https://github.com/diffplug/spotless/pull/2320))
* Bump default `ktlint` version to latest `1.4.0` -> `1.5.0`. ([#2354](https://github.com/diffplug/spotless/pull/2354))
* Bump minimum `eclipse-cdt` version to `11.0` (removed support for `10.7`). ([#2373](https://github.com/diffplug/spotless/pull/2373))
### Fixed
* You can now use `removeUnusedImports` and `googleJavaFormat` at the same time again. (fixes [#2159](https://github.com/diffplug/spotless/issues/2159))
* 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))
Expand Down

0 comments on commit 534e924

Please sign in to comment.