File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff 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+ }
5356for (needsP2 in NEEDS_P2_DEPS ) {
5457 sourceSets. register(needsP2) {
5558 compileClasspath + = sourceSets. main. output
@@ -74,11 +77,12 @@ tasks.withType(Test).configureEach {
7477
7578apply plugin : ' dev.equo.p2deps'
7679p2deps {
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/11.0/'
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/'
Original file line number Diff line number Diff line change @@ -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 , "11.0" ). 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 ();
Original file line number Diff line number Diff line change 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.
1515 */
1616package com .diffplug .spotless .extra .cpp ;
1717
18+ import static org .junit .jupiter .api .condition .JRE .JAVA_17 ;
19+
1820import java .util .stream .Stream ;
1921
22+ import org .junit .jupiter .api .condition .EnabledForJreRange ;
2023import org .junit .jupiter .params .ParameterizedTest ;
2124import 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>;\n int main(int argc, \n char *argv[]) {}" ,
3640 "#include <a.h>;\n int 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}
You can’t perform that action at this time.
0 commit comments