-
Notifications
You must be signed in to change notification settings - Fork 49
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
Rationalize and apply consistent project settings #2748
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
abe8246
Switch plugins, features, third_party to module projects
briandealwis d4051d1
Support applying canonical set of project settings
briandealwis 0d2aa5e
Fix compiler errors from new settings
briandealwis 37f7fcc
README tweaks
briandealwis 70b1b08
Merge remote-tracking branch 'origin/master' into HEAD
briandealwis 33163e7
Tweak README and mark $NON-NLS-x$ as to be ignored
briandealwis e9a1cf5
Apply settings
briandealwis 3ce90d6
Merge remote-tracking branch 'origin/master' into HEAD
briandealwis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Project Settings for Eclipse | ||
|
||
This project contains the canonical set of Eclipse `.settings/` | ||
files for Cloud Tools for Eclipse. These settings configure Eclipse | ||
to use the [Google Style for Java][google-style-java]. | ||
|
||
The settings currently reflect the following choices: | ||
|
||
- uses the [Google Java Format plugin for Eclipse](google-java-format), | ||
which requires developing with Eclipse Oxygen (4.7) or later | ||
- unnecessary declared checked exceptions on methods are _errors_ | ||
- switch missing default case are _warnings_ | ||
- resource leaks are _errors_ | ||
- potential resource leaks are _warnings_ | ||
- serializable classes without `serialVersionUID` are _ignored_ | ||
- redundant generic type argument are _errors_ | ||
- disable warnings on non-externalized strings / $NON-NLS-x$ due to | ||
https://github.com/google/google-java-format/issues/221 | ||
|
||
|
||
## Updating / Applying the Settings | ||
|
||
The settings require installing the [Google Java Format plugin for | ||
Eclipse][google-java-format]. Installing the format plugin requires | ||
downloading the [latest release][google-java-format-release] (named | ||
`google-java-format-eclipse-plugin_XXXX.jar`) and placing the jar | ||
in your Eclipse installation's `dropins/` directory (on MacOS, in | ||
`Eclipse.app/Content/Eclipse/dropins/`). | ||
|
||
Updating and applying the settings files is a two-step process based | ||
around the [`eclipse-settings-maven-plugin`][esmp] Maven plugin. | ||
|
||
[esmp]: https://github.com/BSI-Business-Systems-Integration-AG/eclipse-settings-maven-plugin | ||
[google-style-java]: https://google.github.io/styleguide/javaguide.html | ||
[google-java-format]: https://github.com/google/google-java-format | ||
[google-java-format-release]: https://github.com/google/google-java-format/releases | ||
|
||
### Step 0: Change the Canonical Settings (OPTIONAL) | ||
|
||
To update the settings, change the settings for one project and | ||
then copy in the changed files from its `.settings/` directory into | ||
`files/`. Note that if a new file is added, the new file must be | ||
reflected into the `eclipse-settings-maven-plugin`'s configuration | ||
(defined in `plugins/pom.xml`). | ||
|
||
### Step 1: Publishing the Settings Files | ||
|
||
This project (`eclipse/settings/`) publishes the settings files as | ||
a Maven `jar` artifact. This published jar is then used by the | ||
`eclipse-settings-maven-plugin` as the source for the settings files. | ||
The settings files themselves are found in in this project under | ||
[`files/`](files/). | ||
|
||
To publish the settings, run the following to assemble the jar and | ||
install it in your local repository (`~/.m2/repository/`) | ||
|
||
```sh | ||
$ cd eclipse/settings | ||
$ mvn install | ||
``` | ||
|
||
### Step 2: Applying the Settings | ||
|
||
Once the settings are available, the second step invokes the | ||
`eclipse-settings-maven-plugin`'s `eclipse-settings` goal to resolve | ||
the settings artifact and extract the contents to the appropriate | ||
locations. Run the following: | ||
|
||
``` | ||
$ cd plugins | ||
$ mvn --no-snapshot-updates -Dtycho.mode=maven eclipse-settings:eclipse-settings | ||
``` | ||
|
||
The `--no-snapshot-updates` is required to resolve the settings | ||
artifact from the local repository. The `-Dtycho.mode=maven` speeds | ||
up the process. | ||
|
||
### Step 3: Commit | ||
|
||
You should then commit the result. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding/<project>=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
line.separator=\n |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer direct inline links but up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me too, but the text was becoming hard to read :-/