Synchronizing eclipse save action rules
Asked Answered
G

3

18

My team has a fairly rich set of formatting rules and save actions and these rules are evolving. We're looking for a mechanism to define the centrally and propagate them automatically. We don't want to reformat the code base, but we expect the formatting to improve incrementally over time. We're using Subversion for source control, though we'd like to limit the stored configuration to the rules and actions.

Golliner answered 5/1, 2009 at 20:11 Comment(0)
G
17

If you check the box "Enable project specific settings" a file will be created containing the settings that you can check in. That's all. Then you just have to make sure the team knows that you can only change that file with the agreement of the team. This works for several settings windows including Clean Up, Formatter, and Save Actions.

The eclipse files will be in the .settings/ directory with names like org.eclipse.jdt.core.prefs.

EDIT: You'll need a copy of .settings in the root of each directory that you check out as a project. Once you create one through the IDE, you can check in a copy in additional project.

Guitar answered 5/1, 2009 at 21:32 Comment(2)
Our system has about a dozen projects. But this is limited to the settings we want to synchronize...Golliner
Not sure I understand the comment.Guitar
K
3

As of Eclipse 4.4.1 there is no native functionality for importing/exporting the "save action settings".

What you can do is to copy the file containing the "save action settings" manually.

See this Question: eclipse save actions in source control

I tried it and it worked for me but i'm not sure if i want to put my prefs under source control.

Kronstadt answered 4/11, 2014 at 16:29 Comment(0)
U
-1

Have you tried to export your preferences? File --> Export --> Preferences.

You should also be able to export/import the settings for the Formatter (Window --> Preferences --> Java --> Code Style --> Formatter --> Edit button --> Export button).

Then you could have a standard set of save actions / preferences / formatting rules, which can be conveniently imported from a file.

Unasked answered 5/1, 2009 at 20:30 Comment(2)
Hmm, the File -> Export can't export just the formatting/save action settings and exporting from the Format edit pane, doesn't get the save actions.Golliner
How about exporting all preferences on a fresh workspace/profile in which you've made ONLY the save action changes? Perhaps this will give you a "baseline profile" to use for your team.Unasked

© 2022 - 2024 — McMap. All rights reserved.