Bug 194414 - [IDE] [preferences] Set (or share) preferences for multiple projects
Summary: [IDE] [preferences] Set (or share) preferences for multiple projects
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 enhancement with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL: http://code9.com/2008/09/09/tip-proje...
Whiteboard:
Keywords:
: 200213 246755 290560 486978 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-26 09:44 EDT by James Synge CLA
Modified: 2019-01-31 08:46 EST (History)
24 users (show)

See Also:


Attachments
Multi-project properties (20.67 KB, image/gif)
2008-11-10 11:26 EST, Martin Oberhuber CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Synge CLA 2007-06-26 09:44:08 EDT
My workspace has 400+ projects in it, of which approximately 80 are "owned" by the group I'm a part of.  We want to be able to set the JDT compiler preferences (i.e. what's a warning and what's an error) on the 80 projects we own, but not on the other projects.  It gets pretty tedious editing the project preferences on 80 projects.  We'd like to be able to either:

* select N (i.e. multiple) projects from the Preferences > Java > Compiler > Errors/Warnings > Configure Project Specific Preferences... dialog, such that we're effectively editing N preferences files at once

* specify that N - 1 of our projects reference/inherit the preferences of 1 of our projects (it would be nice if a project could inherit preferences, and selectively override a subset)
Comment 1 Martin Aeschlimann CLA 2007-07-17 07:02:08 EDT
It would be great if preferences could inherit from other projects. This is however, in the current state a breaking change.
So what we can do is to
- offer compiler setting profiles
- offer functionality to copy settings to one or more other projects.
Comment 2 Dani Megert CLA 2008-09-02 02:26:46 EDT
This is not JDT specific.
Comment 3 Boris Bokowski CLA 2008-09-03 12:57:27 EDT
I agree this is a problem. The best workaround I know is to copy settings at the file level as opposed to going through the UI. For example, compiler settings are in <project>/.settings/org.eclipse.jdt.core.prefs
Comment 4 John Arthorne CLA 2008-09-10 13:58:43 EDT
*** Bug 246755 has been marked as a duplicate of this bug. ***
Comment 5 Martin Oberhuber CLA 2008-11-10 10:21:16 EST
It's interesting that the summary of this bug is "Set (or share) preferences" since multi-setting is actually VERY different than sharing.

Multi-setting Preferences is possible as a UI enhancement without changing the underlying functionality.

An infrastructure for "sharing" Preferences must be at the Core level before UI can adopt it. If done well, however, it's much more powerful: settings could be "shared" not only from a team-shared location, but also from a location that's shared across multiple workspaces (see also bug 70683) or by blending in user's private settings from a user-private location. The drawback of sharing settings is that it can become hard to understand where a particular setting comes from; that's perhaps another reason for keeping the sharing mechanics UI-less (such that only advanced users could use this feature).

"Sharing" could also be done without any UI at all. Consider Firefox, for instance, which provides UI for the "most important" settings only but stores all settings in user-editable files. It has well-known locations for the "installation settings" and the "user settings". If the sharing facility has no UI, this has the added advantage that shared Preferences are always read-only (since the only means of writing them is by editing a file). The workflow for admins could be 
  1. Create Preferences on a local project as needed
  2. Copy local prefs file into team-shared location
  3. Apply sharing to child projects

On a very superficial review, it might be possible to hack class ProjectPreferences such that it performs more work when reading the .settings directory: For instance, read file ".sharing" which contains workspace-relative paths of additional locations to search when reading Preferences. If an additional file ".sharing.user" exists, it could point to a place with user-private settings. Or, for each *.prefs file, a corresponding *.prefs.user file could contain user-specific non-shared settings. Needless to say, similar support for sharing might be possible in class InstancePreferences for supporting settings shared among multiple workspaces.
Comment 6 Martin Oberhuber CLA 2008-11-10 11:26:16 EST
Created attachment 117449 [details]
Multi-project properties

In order to be fair to the UI gang as well, here is a screenshot of the "multi project properties" dialog that we had in a former product of ours.

The project properties dialog is extended by a project tree on the right-hand side. Below the tree you see a "project set" dropdown which worked similar to Eclipse Working sets (in order to use pre-defined sets of projects). Selecting a particular project in the tree on the right-hand side showed the properties of that project. Using the "set for checkmarked projects" dropdown allowed applying a setting to all projects in the tree that were checkmarked.

I think that this UI was overly complex because of the unnecessarily fine granularity of settings:

 - Instead of specifying the scope of application by a dropdown beside each
   control, today I'd provide a simple "Apply to All" button that would apply
   all settings of the current page to all selected projects.

 - Instead of introducing a concept of "checkmarked projects", today I'd be
   using working sets to change the list of shown projects, and have the
   "Apply to All" button apply to all shown projects.

The list of shown projects would be initialized with a project multi-selection in the project explorer when the properties action is fired.

It seems, though that a change to the Eclipse Project Properties Dialog (i.e. adding a project tree to the right, and adding an "Apply to All" button) might allow for a multi-set operation in a backward compatible way, since the code would just need to iterate over all projects and perform the apply operation on each. Projects that don't support the displayed property page would get indicated gray in the project tree, and be skipped on an "Apply to All".
Comment 7 Martin Oberhuber CLA 2008-11-14 12:36:53 EST
FYI we discussed this today in the context of e4 and came up with a suggestion on bug 255371 which sounds very exciting. Comments and help are welcome though our bandwidth for this may be limited...
Comment 8 Martin Oberhuber CLA 2009-05-19 15:50:46 EDT
CQ:WIND00165398
Comment 9 Dani Megert CLA 2009-10-06 03:34:57 EDT
*** Bug 290560 has been marked as a duplicate of this bug. ***
Comment 10 Simon Archer CLA 2009-10-06 09:25:26 EDT
In addition to being able to more easily set the project-specific preferences for  existing projects I'd like to also be able to have the project-specific preference for a NEW project automatically set at the time the project is created... I could imagine the project inheriting its settings from either a template or the workspace's settings.

We often find that people create new projects, write a bunch of non-complying code, check in to the SCM, and then we realize late in the plan that we have a ton of non-externalized strings or other such problems that prevent us from shipping.
Comment 11 Thomas Hallgren CLA 2011-02-15 03:17:12 EST
(In reply to comment #10)
> ... I could imagine the project inheriting its settings from either a
> template or the workspace's settings.
> 
I like the idea of inheriting project specific settings. Especially if this inheritance is by reference rather than by copy so that a change to the template will be automatically applied to all projects that inherits from it.
Comment 12 Dani Megert CLA 2012-10-09 09:20:46 EDT
*** Bug 200213 has been marked as a duplicate of this bug. ***
Comment 13 Noopur Gupta CLA 2016-02-02 04:15:03 EST
*** Bug 486978 has been marked as a duplicate of this bug. ***