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 = [
50
50
' groovy' ,
51
51
' jdt'
52
52
]
53
+ if (! JavaVersion . current(). isCompatibleWith(JavaVersion . VERSION_17 )) {
54
+ NEEDS_P2_DEPS . remove(' cdt' )
55
+ }
53
56
for (needsP2 in NEEDS_P2_DEPS ) {
54
57
sourceSets. register(needsP2) {
55
58
compileClasspath + = sourceSets. main. output
@@ -74,11 +77,12 @@ tasks.withType(Test).configureEach {
74
77
75
78
apply plugin : ' dev.equo.p2deps'
76
79
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/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
+ }
82
86
}
83
87
into ' groovyCompileOnly' , {
84
88
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 {
38
38
private EclipseCdtFormatterStep () {}
39
39
40
40
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" );
42
42
43
43
public static String defaultVersion () {
44
44
return JVM_SUPPORT .getRecommendedFormatterVersion ();
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2016-2024 DiffPlug
2
+ * Copyright 2016-2025 DiffPlug
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
15
15
*/
16
16
package com .diffplug .spotless .extra .cpp ;
17
17
18
+ import static org .junit .jupiter .api .condition .JRE .JAVA_17 ;
19
+
18
20
import java .util .stream .Stream ;
19
21
22
+ import org .junit .jupiter .api .condition .EnabledForJreRange ;
20
23
import org .junit .jupiter .params .ParameterizedTest ;
21
24
import org .junit .jupiter .params .provider .MethodSource ;
22
25
@@ -30,13 +33,14 @@ public EclipseCdtFormatterStepTest() {
30
33
31
34
@ ParameterizedTest
32
35
@ MethodSource
36
+ @ EnabledForJreRange (min = JAVA_17 )
33
37
void formatWithVersion (String version ) throws Exception {
34
38
harnessFor (version ).test ("main.c" ,
35
39
"#include <a.h>;\n int main(int argc, \n char *argv[]) {}" ,
36
40
"#include <a.h>;\n int main(int argc, char *argv[]) {\n }\n " );
37
41
}
38
42
39
43
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 ());
41
45
}
42
46
}
You can’t perform that action at this time.
0 commit comments