Skip to content

Commit 2e16d9c

Browse files
authored
Merge pull request #389 from diffplug/eclipse-cdt-upgrade
Upgrade to CTD 9.7. Include SLF4J log service.
2 parents 2ec61ea + 13eb8ef commit 2e16d9c

File tree

5 files changed

+29
-468
lines changed

5 files changed

+29
-468
lines changed

_ext/eclipse-cdt/CHANGES.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# spotless-eclipse-cdt
2+
3+
### Version 9.7.0 - March 31st 2019 ([artifact]([jcenter](https://bintray.com/diffplug/opensource/spotless-eclipse-cdt)))
4+
5+
* Switch to Eclipse CTD release 9.7 for Eclipse 4.11 ([#389](https://github.com/diffplug/spotless/pull/389)).
6+
* Include Eclipse logging allowing formatter warnings/errors to be logged via SLF4J ([#236](https://github.com/diffplug/spotless/issues/236)).
7+
8+
### Version 9.4.5 - February 25th 2019 ([artifact]([jcenter](https://bintray.com/diffplug/opensource/spotless-eclipse-cdt)))
9+
10+
* Replaced `http` update-site with `https` ([#360](https://github.com/diffplug/spotless/issues/360)).
11+
12+
### Version 9.4.4 - September 04th 2018 ([artifact]([jcenter](https://bintray.com/diffplug/opensource/spotless-eclipse-cdt)))
13+
14+
* Added missing log service, which caused exceptions on AST warnings ([#286](https://github.com/diffplug/spotless/pull/286)).
15+
16+
### Version 9.4.3 - August 8th 2018 ([artifact]([jcenter](https://bintray.com/diffplug/opensource/spotless-eclipse-cdt)))
17+
18+
* Initial release!

_ext/eclipse-cdt/build.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ dependencies {
2525
compile "com.ibm.icu:icu4j:${VER_IBM_ICU}"
2626
// Required to by CCorePlugin calling PositionTrackerManager
2727
compile "org.eclipse.platform:org.eclipse.core.filebuffers:${VER_ECLISPE_PLATFORM}"
28+
29+
testCompile("org.slf4j:slf4j-simple:${VER_SLF4J}")
2830
}
2931

3032

3133
//////////
3234
// Test //
3335
//////////
3436
sourceSets {
35-
// Use JAR file with all resources for Eclipse-XML integration-tests
37+
// Use JAR file with all resources for Eclipse-CDT integration-tests
3638
test.runtimeClasspath = jar.outputs.files + sourceSets.test.output + sourceSets.test.compileClasspath
3739
}

_ext/eclipse-cdt/gradle.properties

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Versions correspond to the Eclipse-CDT version used for the fat-JAR.
22
# See https://www.eclipse.org/cdt/ for further information about Eclipse-CDT versions.
33
# Patch version can be incremented independently for backward compatible patches of this library.
4-
ext_version=9.4.5
4+
ext_version=9.7.0
55
ext_artifactId=spotless-eclipse-cdt
66
ext_description=Eclipse's CDT C/C++ formatter bundled for Spotless
77
ext_org=diffplug
@@ -11,8 +11,12 @@ ext_group=com.diffplug.spotless
1111
ext_VER_JAVA=1.8
1212

1313
# Compile dependencies
14-
VER_ECLIPSE_CDT=9.4
15-
VER_SPOTLESS_ECLISPE_BASE=[3.0.0,4.0.0[
14+
VER_ECLIPSE_CDT=9.7
15+
VER_SPOTLESS_ECLISPE_BASE=[3.1.0,4.0.0[
1616
VER_ECLISPE_JFACE=[3.12.0,4.0.0[
17+
VER_ECLISPE_WORKBENCH=[3.11.0,4.0.0[
1718
VER_ECLISPE_PLATFORM=[3.6.0,4.0.0[
1819
VER_IBM_ICU=[61,62[
20+
21+
# Provided dependencies
22+
VER_SLF4J=[1.6,2.0[

_ext/eclipse-cdt/src/main/java/com/diffplug/spotless/extra/eclipse/cdt/EclipseCdtFormatterStepImpl.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import org.eclipse.cdt.core.CCorePlugin;
2525
import org.eclipse.cdt.core.formatter.CodeFormatter;
2626
import org.eclipse.core.internal.filebuffers.FileBuffersPlugin;
27-
import org.eclipse.equinox.log.ExtendedLogReaderService;
28-
import org.eclipse.equinox.log.ExtendedLogService;
2927
import org.eclipse.jface.text.Document;
3028
import org.eclipse.jface.text.IDocument;
3129
import org.eclipse.text.edits.TextEdit;
@@ -37,12 +35,10 @@ public class EclipseCdtFormatterStepImpl {
3735
private final CodeFormatter codeFormatter;
3836

3937
public EclipseCdtFormatterStepImpl(Properties settings) throws Exception {
40-
LogErrorService logService = new LogErrorService();
4138
SpotlessEclipseFramework.setup(
4239
config -> {
4340
config.applyDefault();
44-
config.add(ExtendedLogService.class, logService);
45-
config.add(ExtendedLogReaderService.class, logService);
41+
config.useSlf4J(EclipseCdtFormatterStepImpl.class.getPackage().getName());
4642
},
4743
plugins -> {
4844
plugins.applyDefault();
@@ -68,5 +64,4 @@ public String format(String raw) throws Exception {
6864
return doc.get();
6965
}
7066
}
71-
7267
}

0 commit comments

Comments
 (0)