Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename eclipse to eclipseCdt #636

Merged
merged 3 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
### Deprecated
* The default targets for `C/C++`, `freshmark`, `sql`, and `typescript` now generate a warning, asking the user to specify a target manually. There is no well-established convention for these languages in the gradle ecosystem, and the performance of the default target is far worse than a user-provided one. If you dislike this change, please complain in [#634](https://github.com/diffplug/spotless/pull/634).
* `customLazy` and `customLazyGroovy` now generate a warning, asking the user to migrate to `custom`. There is no longer a performance advantage to `customLazy` in the new modern plugin. See [#635](https://github.com/diffplug/spotless/pull/635/files) for example migrations.
* inside the `cpp { }` block, the `eclipse` step now generates a warning, asking you to switch to `eclipseCdt`. It is the same underlying step, but the new name clears up any confusion with the more common Java `eclipse`. [#636](https://github.com/diffplug/spotless/pull/635/files)

## [4.4.0] - 2020-06-19
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,25 @@ public CppExtension(SpotlessExtensionBase spotless) {
super(spotless);
}

public EclipseConfig eclipseCdt() {
return new EclipseConfig(EclipseCdtFormatterStep.defaultVersion());
}

public EclipseConfig eclipseCdt(String version) {
return new EclipseConfig(version);
}

/** Use {@link #eclipseCdt} instead. */
@Deprecated
public EclipseConfig eclipse() {
getProject().getLogger().warn("Spotless: in the `cpp { }` block, use `eclipseCdt()` instead of `eclipse()`");
return new EclipseConfig(EclipseCdtFormatterStep.defaultVersion());
}

/** Use {@link #eclipseCdt} instead. */
@Deprecated
public EclipseConfig eclipse(String version) {
getProject().getLogger().warn("Spotless: in the `cpp { }` block, use `eclipseCdt('" + version + "')` instead of `eclipse('" + version + "')`");
return new EclipseConfig(version);
}

Expand All @@ -53,7 +67,6 @@ public void configFile(Object... configFiles) {
builder.setPreferences(project.files(configFiles).getFiles());
replaceStep(builder.build());
}

}

@Override
Expand Down
3 changes: 2 additions & 1 deletion plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
* Added ANTLR4 support ([#326](https://github.com/diffplug/spotless/issues/326)).
### Removed
* **BREAKING** the default includes for `<typescript>` and `<cpp>` were removed, and will now generate an error if an `<include>` is not specified. There is no well-established convention for these languages in the maven ecosystem, and the performance of the default includes is far worse than a user-provided one. If you dislike this change, please complain in [#634](https://github.com/diffplug/spotless/pull/634), it would not be a breaking change to bring the defaults back.
* **BREAKING** the long-deprecated `<xml>` and `<css>` formats have been removed, in favor of the long-available [`<eclipseWtp>`](https://github.com/diffplug/spotless/tree/main/plugin-maven#eclipse-wtp) step which is available in every generic format.
* **BREAKING** inside the `<cpp>` block, `<eclipse>` has been renamed to `<eclipseCdt>` to avoid any confusion with the java `<eclipse>` ([#636](https://github.com/diffplug/spotless/pull/636)).
* **BREAKING** the long-deprecated `<xml>` and `<css>` formats have been removed, in favor of the long-available [`<eclipseWtp>`](https://github.com/diffplug/spotless/tree/main/plugin-maven#eclipse-wtp) step which is available in every generic format ([#630](https://github.com/diffplug/spotless/pull/630)).
* This probably doesn't affect you, but if it does, you just need to change `<xml>...` into `<formats><format><eclipseWtp><type>XML</type>...`
* In [`1.15.0` (released 2018-09-23)](#1150---2018-09-23), we added support for `xml` and `css` formats using the Eclipse WTP.
* In [`1.18.0` (released 2019-02-11)](#1180---2019-02-11), we deprecated these, in favor of the generic `eclipseWtp` step which is available for all generic formats. This allows you to have multiple XML and CSS formats, rather than just one.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
* A {@link FormatterFactory} implementation that corresponds to {@code <cpp>...</cpp>} configuration element.
* <p>
* It defines a formatter for java source files that can execute both language agnostic (e.g. {@link LicenseHeader})
* and cpp-specific (e.g. {@link Eclipse}) steps.
* and cpp-specific (e.g. {@link EclipseCdt}) steps.
*/
public class Cpp extends FormatterFactory {
@Override
public Set<String> defaultIncludes() {
return Collections.emptySet();
}

public void addEclipse(Eclipse eclipse) {
public void addEclipseCdt(EclipseCdt eclipse) {
addStepFactory(eclipse);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016 DiffPlug
* Copyright 2016-2020 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 @@ -26,7 +26,7 @@
import com.diffplug.spotless.maven.FormatterStepConfig;
import com.diffplug.spotless.maven.FormatterStepFactory;

public class Eclipse implements FormatterStepFactory {
public class EclipseCdt implements FormatterStepFactory {

@Parameter
private String file;
Expand Down