GNOME Bugzilla – Bug 777959
Add IdeConfigurationProvider interface
Last modified: 2017-02-15 01:27:25 UTC
This all seems to work and should be ready to commit.
Created attachment 344587 [details] [review] config-provider: Add IdeConfigurationProvider This interface will allow build configurations to come from any plugin, such as the flatpak one.
Created attachment 344588 [details] [review] config-manager: Use IdeConfigurationProvider interface This changes IdeConfigurationManager to load configurations via the IdeConfigurationProvider interface (which can be implemented by any plugin) rather than checking for a .buildconfig file. The IdeBuildconfigConfigurationProvider will provides backwards compatibility for that functionality.
Created attachment 344589 [details] [review] flatpak: Move flatpak manifests from runtimes to configurations Since flatpak manifests specify how to build a project, it makes more sense for them to be configurations rather than runtimes in Builder. Now that setup is possible since we have the IdeConfigurationProvider interface.
Created attachment 344590 [details] [review] Update .buildconfig to use the right flatpak runtime Now that flatpak manifests are configurations, we can go back to specifying the actual runtime in our buildconfig.
Created attachment 344591 [details] [review] configuration: Make IdeConfiguration derivable This will allow plugins that implement IdeConfigurationProvider to add their own properties to the configuration objects. It has yet to be determined if different types of configurations can have different UI elements.
Created attachment 344592 [details] [review] flatpak: Create GbpFlatpakConfiguration This class will allow GbpFlatpakConfigurationProvider to store more information about manifests than it could with IdeConfiguration, such as which module in a manifest is the primary one (rather than a dependency).
Created attachment 344593 [details] [review] flatpak: Make the flatpak manifest search recursive Some projects might want to put their flatpak manifest in a subdirectory rather than the project's root directory, and the performance hit seems negligible.
Created attachment 344594 [details] [review] buildui: Move build-tools plugin to libide Now that IdeConfiguration is derivable, it makes more sense to have the view for it in libide so it too can be subclassed.
Created attachment 344596 [details] [review] buildsystem: Create IdeBuildconfigConfigurationProvider This class provides the functionality that was previously in IdeConfigurationManager, reading and writing .buildconfig files.
Created attachment 344597 [details] [review] flatpak: Writeback manifest changes to disk When the user changes build preferences in the Builder UI, those changes should propagate back to the manifest file on the disk. This commit accomplishes that in a somewhat hack-ish way (by reading the file line-by-line and making changes where necessary) so that formatting, comments, etc. are preserved that would be lost if JsonBuilder and JsonGenerator were used instead.
Created attachment 344598 [details] [review] configuration: Mark config as dirty when IdeEnvironment changes This commit makes the IdeConfiguration mark itself as dirty when an environment variable (or its value) is changed by the user, rather than just when an env var is added or removed. That way such changes can be written back to the disk (almost) immediately.
Merged to master