views:

706

answers:

2

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.

A: 

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.

matt b
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.
sblundy
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.
matt b
+4  A: 

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.

Craig P. Motlin
Our system has about a dozen projects. But this is limited to the settings we want to synchronize...
sblundy
Not sure I understand the comment.
Craig P. Motlin