Closed Bug 1408810 Opened 7 years ago Closed 7 years ago

Fix Eclipse project generation so that it sets up the formatter preferences again

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox58 fixed)

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: jwatt, Assigned: jwatt)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In bug 1060210, BenWa added some code to run eclipse to automate the step of importing the generated project into the generated workspace. As part of that he added a _write_noindex method to set a preference in 'org.eclipse.cdt.core.prefs' to disable the indexer (which takes a long time to run) while the import is running, and a method _remove_noindex to remove that preference file to re-enable the indexer once the import is done. Unfortunately the 'org.eclipse.cdt.core.prefs' file that _write_noindex overwrites and that _remove_noindex removes is the prefs file that the FORMATTER_SETTINGS were previously written to in consume_finished before consume_finished call _import_project(). In other words this change made us overwrite the formatter settings, which is why projects don't have that set up any more.
Attached patch patchSplinter Review
Attachment #8918703 - Flags: review?(botond)
Make sure you use Splinter Review to get the extended comment that explains what's going on here.
Comment on attachment 8918703 [details] [diff] [review] patch Review of attachment 8918703 [details] [diff] [review]: ----------------------------------------------------------------- ::: python/mozbuild/mozbuild/backend/cpp_eclipse.py @@ +113,5 @@ > > self._write_launch_files(launch_dir) > > + cdt_ui_prefs_path = os.path.join(workspace_settings_dir, 'org.eclipse.cdt.ui.prefs') > + cdt_ui_prefs = STATIC_CDT_UI_PREFS Maybe factor out the computation of cdt_ui_prefs into a function, to keep consume_finished() relatively short and more readable?
Attachment #8918703 - Flags: review?(botond) → review+
(In reply to Botond Ballo [:botond] from comment #3) > Maybe factor out the computation of cdt_ui_prefs into a function, to keep > consume_finished() relatively short and more readable? I'll pass on that for the moment since I want to think about how to structure this file a bit more, but don't have the time to do that right now.
Pushed by jwatt@jwatt.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/e32acd53fd26 Get the Eclipse CDT code formatter working again. r=botond
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: