After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777959 - Add IdeConfigurationProvider interface
Add IdeConfigurationProvider interface
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-31 00:25 UTC by Matthew Leeds
Modified: 2017-02-15 01:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
config-provider: Add IdeConfigurationProvider (10.49 KB, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review
config-manager: Use IdeConfigurationProvider interface (23.31 KB, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review
flatpak: Move flatpak manifests from runtimes to configurations (69.57 KB, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review
Update .buildconfig to use the right flatpak runtime (873 bytes, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review
configuration: Make IdeConfiguration derivable (29.32 KB, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review
flatpak: Create GbpFlatpakConfiguration (7.98 KB, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review
flatpak: Make the flatpak manifest search recursive (4.22 KB, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review
buildui: Move build-tools plugin to libide (102.47 KB, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review
buildsystem: Create IdeBuildconfigConfigurationProvider (64.98 KB, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review
flatpak: Writeback manifest changes to disk (25.54 KB, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review
configuration: Mark config as dirty when IdeEnvironment changes (5.22 KB, patch)
2017-01-31 00:26 UTC, Matthew Leeds
none Details | Review

Description Matthew Leeds 2017-01-31 00:25:57 UTC
This all seems to work and should be ready to commit.
Comment 1 Matthew Leeds 2017-01-31 00:26:01 UTC
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.
Comment 2 Matthew Leeds 2017-01-31 00:26:04 UTC
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.
Comment 3 Matthew Leeds 2017-01-31 00:26:08 UTC
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.
Comment 4 Matthew Leeds 2017-01-31 00:26:11 UTC
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.
Comment 5 Matthew Leeds 2017-01-31 00:26:15 UTC
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.
Comment 6 Matthew Leeds 2017-01-31 00:26:18 UTC
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).
Comment 7 Matthew Leeds 2017-01-31 00:26:21 UTC
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.
Comment 8 Matthew Leeds 2017-01-31 00:26:24 UTC
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.
Comment 9 Matthew Leeds 2017-01-31 00:26:28 UTC
Created attachment 344596 [details] [review]
buildsystem: Create IdeBuildconfigConfigurationProvider

This class provides the functionality that was previously in
IdeConfigurationManager, reading and writing .buildconfig files.
Comment 10 Matthew Leeds 2017-01-31 00:26:32 UTC
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.
Comment 11 Matthew Leeds 2017-01-31 00:26:35 UTC
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.
Comment 12 Matthew Leeds 2017-02-15 01:27:25 UTC
Merged to master