[gnome-builder] plugins: move build systems and miners to plugins



commit cbbab04865d3ebf318a6ed79a0f260cc7070ec46
Author: Christian Hergert <christian hergert me>
Date:   Sat Aug 22 17:26:18 2015 -0700

    plugins: move build systems and miners to plugins
    
    This touches a lot of components, so splitting things up would not allow
    us to be in a buildable state.
    
    In particular:
    
     - IdeBuildSystem made an interface
     - IdeProjectMiner made an interface
     - Autotools plugin created, with build system and miner
     - Fallback plugin created, with directory fallback build system
     - Context updated to take this into account
     - IdeObject can now be used to create build systems from plugins
    
    We should follow this up by moving version control to plugins as well.

 configure.ac                                       |    2 +
 libide/Makefile.am                                 |   15 --
 libide/ide-build-system.c                          |  170 +++++++-------------
 libide/ide-build-system.h                          |   12 +-
 libide/ide-context.c                               |    6 +-
 libide/ide-project-miner.c                         |   17 +--
 libide/ide-project-miner.h                         |    9 +-
 libide/ide-recent-projects.c                       |   47 +++---
 libide/ide.c                                       |   20 ---
 libide/ide.h                                       |    4 +-
 plugins/Makefile.am                                |    2 +
 plugins/autotools/Makefile.am                      |   32 ++++
 .../autotools/autotools-plugin.c                   |   28 ++--
 plugins/autotools/autotools.plugin                 |    8 +
 .../autotools/ide-autotools-build-system.c         |   69 +++++++--
 .../autotools/ide-autotools-build-system.h         |    3 +-
 .../autotools/ide-autotools-build-task.c           |    0
 .../autotools/ide-autotools-build-task.h           |    0
 .../autotools/ide-autotools-builder.c              |    0
 .../autotools/ide-autotools-builder.h              |    0
 .../autotools/ide-autotools-project-miner.c        |   26 ++--
 .../autotools/ide-autotools-project-miner.h        |    6 +-
 .../autotools/ide-makecache-target.c               |    0
 .../autotools/ide-makecache-target.h               |    0
 {libide => plugins}/autotools/ide-makecache.c      |    8 +-
 {libide => plugins}/autotools/ide-makecache.h      |    0
 plugins/fallback/Makefile.am                       |   21 +++
 .../fallback/fallback-plugin.c                     |   26 +--
 plugins/fallback/fallback.plugin                   |    9 +
 .../fallback}/ide-directory-build-system.c         |   43 ++++--
 .../fallback}/ide-directory-build-system.h         |    8 +-
 31 files changed, 303 insertions(+), 288 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a81b5f3..9f06494 100644
--- a/configure.ac
+++ b/configure.ac
@@ -393,12 +393,14 @@ AC_CONFIG_FILES([
        libide/Makefile
 
        plugins/Makefile
+       plugins/autotools/Makefile
        plugins/clang/Makefile
        plugins/command-bar/Makefile
        plugins/c-pack/Makefile
        plugins/ctags/Makefile
        plugins/devhelp/Makefile
        plugins/device-manager/Makefile
+       plugins/fallback/Makefile
        plugins/file-search/Makefile
        plugins/gnome-code-assistance/Makefile
        plugins/html-completion/Makefile
diff --git a/libide/Makefile.am b/libide/Makefile.am
index 9324d4f..4a25409 100644
--- a/libide/Makefile.am
+++ b/libide/Makefile.am
@@ -7,8 +7,6 @@ pkglibdir = $(libdir)/gnome-builder
 pkglib_LTLIBRARIES = libide-1.0.la
 
 libide_1_0_la_public_sources = \
-       directory/ide-directory-build-system.c \
-       directory/ide-directory-build-system.h \
        directory/ide-directory-vcs.c \
        directory/ide-directory-vcs.h \
        doap/ide-doap-person.c \
@@ -182,18 +180,6 @@ libide_1_0_la_public_sources = \
 
 libide_1_0_la_SOURCES = \
        $(libide_1_0_la_public_sources) \
-       autotools/ide-autotools-build-system.c \
-       autotools/ide-autotools-build-system.h \
-       autotools/ide-autotools-build-task.c \
-       autotools/ide-autotools-build-task.h \
-       autotools/ide-autotools-builder.c \
-       autotools/ide-autotools-builder.h \
-       autotools/ide-autotools-project-miner.c \
-       autotools/ide-autotools-project-miner.h \
-       autotools/ide-makecache-target.c \
-       autotools/ide-makecache-target.h \
-       autotools/ide-makecache.c \
-       autotools/ide-makecache.h \
        editorconfig/editorconfig-glib.c \
        editorconfig/editorconfig-glib.h \
        editorconfig/ide-editorconfig-file-settings.c \
@@ -269,7 +255,6 @@ libide_1_0_la_includes = \
        -I$(top_srcdir)/contrib/search \
        -I$(top_srcdir)/contrib/xml \
        -I$(srcdir) \
-       -I$(srcdir)/autotools \
        -I$(srcdir)/directory \
        -I$(srcdir)/doap \
        -I$(srcdir)/editorconfig \
diff --git a/libide/ide-build-system.c b/libide/ide-build-system.c
index 725364d..9172a2d 100644
--- a/libide/ide-build-system.c
+++ b/libide/ide-build-system.c
@@ -22,22 +22,39 @@
 #include "ide-context.h"
 #include "ide-device.h"
 #include "ide-file.h"
+#include "ide-object.h"
 
 typedef struct
 {
   GFile *project_file;
 } IdeBuildSystemPrivate;
 
-G_DEFINE_TYPE_WITH_PRIVATE (IdeBuildSystem, ide_build_system, IDE_TYPE_OBJECT)
+G_DEFINE_INTERFACE (IdeBuildSystem, ide_build_system, IDE_TYPE_OBJECT)
 
 enum {
   PROP_0,
+  PROP_CONTEXT,
   PROP_PROJECT_FILE,
   LAST_PROP
 };
 
 static GParamSpec *gParamSpecs [LAST_PROP];
 
+gint
+ide_build_system_get_priority (IdeBuildSystem *self)
+{
+  IdeBuildSystemInterface *iface;
+
+  g_return_val_if_fail (IDE_IS_BUILD_SYSTEM (self), 0);
+
+  iface = IDE_BUILD_SYSTEM_GET_IFACE (self);
+
+  if (iface->get_priority != NULL)
+    return iface->get_priority (self);
+
+  return 0;
+}
+
 /**
  * ide_build_system_get_build_flags_async:
  *
@@ -58,8 +75,8 @@ ide_build_system_get_build_flags_async (IdeBuildSystem      *self,
   g_return_if_fail (IDE_IS_FILE (file));
   g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
 
-  if (IDE_BUILD_SYSTEM_GET_CLASS (self)->get_build_flags_async)
-    return IDE_BUILD_SYSTEM_GET_CLASS (self)->get_build_flags_async (self, file, cancellable,
+  if (IDE_BUILD_SYSTEM_GET_IFACE (self)->get_build_flags_async)
+    return IDE_BUILD_SYSTEM_GET_IFACE (self)->get_build_flags_async (self, file, cancellable,
                                                                      callback, user_data);
 
   task = g_task_new (self, cancellable, callback, user_data);
@@ -81,116 +98,41 @@ ide_build_system_get_build_flags_finish (IdeBuildSystem  *self,
 {
   g_return_val_if_fail (IDE_IS_BUILD_SYSTEM (self), NULL);
 
-  if (IDE_BUILD_SYSTEM_GET_CLASS (self)->get_build_flags_finish)
-    return IDE_BUILD_SYSTEM_GET_CLASS (self)->get_build_flags_finish (self, result, error);
+  if (IDE_BUILD_SYSTEM_GET_IFACE (self)->get_build_flags_finish)
+    return IDE_BUILD_SYSTEM_GET_IFACE (self)->get_build_flags_finish (self, result, error);
 
   return g_new0 (gchar*, 1);
 }
 
-/**
- * ide_build_system_get_project_file:
- * @self: (in): A #IdeBuildSystem.
- *
- * Gets the #IdeBuildSystem:project-file property.
- *
- * Returns: (transfer none): A #GFile.
- */
-GFile *
-ide_build_system_get_project_file (IdeBuildSystem *system)
-{
-  IdeBuildSystemPrivate *priv = ide_build_system_get_instance_private (system);
-
-  g_return_val_if_fail (IDE_IS_BUILD_SYSTEM (system), NULL);
-
-  return priv->project_file;
-}
-
-void
-_ide_build_system_set_project_file (IdeBuildSystem *system,
-                                    GFile          *project_file)
-{
-  IdeBuildSystemPrivate *priv = ide_build_system_get_instance_private (system);
-
-  g_return_if_fail (IDE_IS_BUILD_SYSTEM (system));
-  g_return_if_fail (G_IS_FILE (project_file));
-
-  if (g_set_object (&priv->project_file, project_file))
-    g_object_notify_by_pspec (G_OBJECT (system), gParamSpecs [PROP_PROJECT_FILE]);
-}
-
 static void
-ide_build_system_finalize (GObject *object)
+ide_build_system_default_init (IdeBuildSystemInterface *iface)
 {
-  IdeBuildSystem *self = (IdeBuildSystem *)object;
-  IdeBuildSystemPrivate *priv = ide_build_system_get_instance_private (self);
-
-  g_clear_object (&priv->project_file);
-
-  G_OBJECT_CLASS (ide_build_system_parent_class)->finalize (object);
-}
-
-static void
-ide_build_system_get_property (GObject    *object,
-                               guint       prop_id,
-                               GValue     *value,
-                               GParamSpec *pspec)
-{
-  IdeBuildSystem *self = IDE_BUILD_SYSTEM (object);
-
-  switch (prop_id)
-    {
-    case PROP_PROJECT_FILE:
-      g_value_set_object (value, ide_build_system_get_project_file (self));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-    }
-}
-
-static void
-ide_build_system_set_property (GObject      *object,
-                               guint         prop_id,
-                               const GValue *value,
-                               GParamSpec   *pspec)
-{
-  IdeBuildSystem *self = IDE_BUILD_SYSTEM (object);
-
-  switch (prop_id)
-    {
-    case PROP_PROJECT_FILE:
-      _ide_build_system_set_project_file (self, g_value_get_object (value));
-      break;
-
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-    }
-}
-
-static void
-ide_build_system_class_init (IdeBuildSystemClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-  object_class->finalize = ide_build_system_finalize;
-  object_class->get_property = ide_build_system_get_property;
-  object_class->set_property = ide_build_system_set_property;
-
   gParamSpecs [PROP_PROJECT_FILE] =
     g_param_spec_object ("project-file",
                          _("Project File"),
                          _("The project file."),
                          G_TYPE_FILE,
-                         (G_PARAM_READWRITE |
-                          G_PARAM_CONSTRUCT_ONLY |
-                          G_PARAM_STATIC_STRINGS));
-
-  g_object_class_install_properties (object_class, LAST_PROP, gParamSpecs);
+                         (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
+  g_object_interface_install_property (iface, gParamSpecs [PROP_PROJECT_FILE]);
+
+  gParamSpecs [PROP_CONTEXT] =
+    g_param_spec_object ("context",
+                         _("Context"),
+                         _("Context"),
+                         IDE_TYPE_CONTEXT,
+                         (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
+  g_object_interface_install_property (iface, gParamSpecs [PROP_CONTEXT]);
 }
 
-static void
-ide_build_system_init (IdeBuildSystem *self)
+static gint
+sort_priority (gconstpointer a,
+               gconstpointer b,
+               gpointer      data)
 {
+  IdeBuildSystem **as = (IdeBuildSystem **)a;
+  IdeBuildSystem **bs = (IdeBuildSystem **)b;
+
+  return ide_build_system_get_priority (*as) - ide_build_system_get_priority (*bs);
 }
 
 /**
@@ -218,16 +160,16 @@ ide_build_system_new_async (IdeContext          *context,
   g_return_if_fail (IDE_IS_CONTEXT (context));
   g_return_if_fail (G_IS_FILE (project_file));
   g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
-  g_return_if_fail (callback);
-
-  ide_object_new_async (IDE_BUILD_SYSTEM_EXTENSION_POINT,
-                        G_PRIORITY_DEFAULT,
-                        cancellable,
-                        callback,
-                        user_data,
-                        "context", context,
-                        "project-file", project_file,
-                        NULL);
+
+  ide_object_new_for_extension_async (IDE_TYPE_BUILD_SYSTEM,
+                                      sort_priority, NULL,
+                                      G_PRIORITY_DEFAULT,
+                                      cancellable,
+                                      callback,
+                                      user_data,
+                                      "context", context,
+                                      "project-file", project_file,
+                                      NULL);
 }
 
 /**
@@ -248,7 +190,7 @@ ide_build_system_new_finish (GAsyncResult  *result,
 
   ret = ide_object_new_finish (result, error);
 
-  return IDE_BUILD_SYSTEM (ret);
+  return ret ? IDE_BUILD_SYSTEM (ret) : NULL;
 }
 
 /**
@@ -269,17 +211,17 @@ ide_build_system_get_builder (IdeBuildSystem  *system,
                               IdeDevice       *device,
                               GError         **error)
 {
-  IdeBuildSystemClass *klass;
+  IdeBuildSystemInterface *iface;
   IdeBuilder *ret = NULL;
 
   g_return_val_if_fail (IDE_IS_BUILD_SYSTEM (system), NULL);
   g_return_val_if_fail (config, NULL);
   g_return_val_if_fail (IDE_IS_DEVICE (device), NULL);
 
-  klass = IDE_BUILD_SYSTEM_GET_CLASS (system);
+  iface = IDE_BUILD_SYSTEM_GET_IFACE (system);
 
-  if (klass->get_builder)
-    ret = klass->get_builder (system, config, device, error);
+  if (iface->get_builder)
+    ret = iface->get_builder (system, config, device, error);
   else
     g_set_error (error,
                  G_IO_ERROR,
diff --git a/libide/ide-build-system.h b/libide/ide-build-system.h
index 1d33028..ef286c6 100644
--- a/libide/ide-build-system.h
+++ b/libide/ide-build-system.h
@@ -25,15 +25,15 @@
 
 G_BEGIN_DECLS
 
-#define IDE_TYPE_BUILD_SYSTEM            (ide_build_system_get_type())
-#define IDE_BUILD_SYSTEM_EXTENSION_POINT "org.gnome.libide.extensions.build-system"
+#define IDE_TYPE_BUILD_SYSTEM (ide_build_system_get_type())
 
-G_DECLARE_DERIVABLE_TYPE (IdeBuildSystem, ide_build_system, IDE, BUILD_SYSTEM, IdeObject)
+G_DECLARE_INTERFACE (IdeBuildSystem, ide_build_system, IDE, BUILD_SYSTEM, IdeObject)
 
-struct _IdeBuildSystemClass
+struct _IdeBuildSystemInterface
 {
-  IdeObjectClass parent;
+  GTypeInterface parent_iface;
 
+  gint        (*get_priority)           (IdeBuildSystem       *system);
   IdeBuilder *(*get_builder)            (IdeBuildSystem       *system,
                                          GKeyFile             *config,
                                          IdeDevice            *device,
@@ -48,7 +48,7 @@ struct _IdeBuildSystemClass
                                          GError              **error);
 };
 
-GFile          *ide_build_system_get_project_file       (IdeBuildSystem       *self);
+gint            ide_build_system_get_priority           (IdeBuildSystem       *self);
 void            ide_build_system_get_build_flags_async  (IdeBuildSystem       *self,
                                                          IdeFile              *file,
                                                          GCancellable         *cancellable,
diff --git a/libide/ide-context.c b/libide/ide-context.c
index b21e167..6ce9e20 100644
--- a/libide/ide-context.c
+++ b/libide/ide-context.c
@@ -947,8 +947,8 @@ ide_context_init_build_system_cb (GObject      *object,
   g_autoptr(IdeBuildSystem) build_system = NULL;
   g_autoptr(GTask) task = user_data;
   IdeContext *self;
+  g_autoptr(GFile) project_file = NULL;
   GError *error = NULL;
-  GFile *project_file;
 
   self = g_task_get_source_object (task);
 
@@ -961,7 +961,9 @@ ide_context_init_build_system_cb (GObject      *object,
   self->build_system = g_object_ref (build_system);
 
   /* allow the build system to override the project file */
-  project_file = ide_build_system_get_project_file (self->build_system);
+  g_object_get (self->build_system,
+                "project-file", &project_file,
+                NULL);
   if (project_file != NULL)
     ide_context_set_project_file (self, project_file);
 
diff --git a/libide/ide-project-miner.c b/libide/ide-project-miner.c
index 9cc14c1..163711d 100644
--- a/libide/ide-project-miner.c
+++ b/libide/ide-project-miner.c
@@ -20,7 +20,7 @@
 
 #include "ide-project-miner.h"
 
-G_DEFINE_ABSTRACT_TYPE (IdeProjectMiner, ide_project_miner, G_TYPE_OBJECT)
+G_DEFINE_INTERFACE (IdeProjectMiner, ide_project_miner, G_TYPE_OBJECT)
 
 enum {
   DISCOVERED,
@@ -30,7 +30,7 @@ enum {
 static guint gSignals [LAST_SIGNAL];
 
 static void
-ide_project_miner_class_init (IdeProjectMinerClass *klass)
+ide_project_miner_default_init (IdeProjectMinerInterface *iface)
 {
   /**
    * IdeProjectMiner::discovered:
@@ -42,20 +42,15 @@ ide_project_miner_class_init (IdeProjectMinerClass *klass)
    * ide_project_miner_emit_discovered() was used to emit the signal.
    */
   gSignals [DISCOVERED] = g_signal_new ("discovered",
-                                        G_TYPE_FROM_CLASS (klass),
+                                        G_TYPE_FROM_INTERFACE (iface),
                                         G_SIGNAL_RUN_LAST,
-                                        G_STRUCT_OFFSET (IdeProjectMinerClass, discovered),
+                                        G_STRUCT_OFFSET (IdeProjectMinerInterface, discovered),
                                         NULL, NULL, NULL,
                                         G_TYPE_NONE,
                                         1,
                                         IDE_TYPE_PROJECT_INFO);
 }
 
-static void
-ide_project_miner_init (IdeProjectMiner *self)
-{
-}
-
 static gboolean
 emit_discovered_cb (gpointer user_data)
 {
@@ -95,7 +90,7 @@ ide_project_miner_mine_async (IdeProjectMiner     *self,
   g_return_if_fail (IDE_IS_PROJECT_MINER (self));
   g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
 
-  IDE_PROJECT_MINER_GET_CLASS (self)->mine_async (self, cancellable, callback, user_data);
+  IDE_PROJECT_MINER_GET_IFACE (self)->mine_async (self, cancellable, callback, user_data);
 }
 
 gboolean
@@ -106,5 +101,5 @@ ide_project_miner_mine_finish (IdeProjectMiner  *self,
   g_return_val_if_fail (IDE_IS_PROJECT_MINER (self), FALSE);
   g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
 
-  return IDE_PROJECT_MINER_GET_CLASS (self)->mine_finish (self, result, error);
+  return IDE_PROJECT_MINER_GET_IFACE (self)->mine_finish (self, result, error);
 }
diff --git a/libide/ide-project-miner.h b/libide/ide-project-miner.h
index 03f96b1..f0dc4d9 100644
--- a/libide/ide-project-miner.h
+++ b/libide/ide-project-miner.h
@@ -25,14 +25,13 @@
 
 G_BEGIN_DECLS
 
-#define IDE_TYPE_PROJECT_MINER            (ide_project_miner_get_type())
-#define IDE_PROJECT_MINER_EXTENSION_POINT "org.gnome.builder.extensions.project-miner"
+#define IDE_TYPE_PROJECT_MINER (ide_project_miner_get_type())
 
-G_DECLARE_DERIVABLE_TYPE (IdeProjectMiner, ide_project_miner, IDE, PROJECT_MINER, GObject)
+G_DECLARE_INTERFACE (IdeProjectMiner, ide_project_miner, IDE, PROJECT_MINER, GObject)
 
-struct _IdeProjectMinerClass
+struct _IdeProjectMinerInterface
 {
-  GObjectClass parent;
+  GTypeInterface parent_iface;
 
   void     (*discovered)  (IdeProjectMiner      *self,
                            IdeProjectInfo       *project_info);
diff --git a/libide/ide-recent-projects.c b/libide/ide-recent-projects.c
index c711238..decd50d 100644
--- a/libide/ide-recent-projects.c
+++ b/libide/ide-recent-projects.c
@@ -18,6 +18,7 @@
 
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
+#include <libpeas/peas.h>
 
 #include "ide-global.h"
 #include "ide-project-miner.h"
@@ -258,6 +259,22 @@ ide_recent_projects_get_item (GListModel *model,
 }
 
 static void
+foreach_miner_func (PeasExtensionSet *set,
+                    PeasPluginInfo   *plugin_info,
+                    PeasExtension    *exten,
+                    gpointer          user_data)
+{
+  IdeRecentProjects *self = user_data;
+
+  g_assert (PEAS_IS_EXTENSION_SET (set));
+  g_assert (plugin_info != NULL);
+  g_assert (IDE_IS_PROJECT_MINER (exten));
+  g_assert (IDE_IS_RECENT_PROJECTS (self));
+
+  ide_recent_projects_add_miner (self, IDE_PROJECT_MINER (exten));
+}
+
+static void
 ide_recent_projects_finalize (GObject *object)
 {
   IdeRecentProjects *self = (IdeRecentProjects *)object;
@@ -290,8 +307,8 @@ ide_recent_projects_class_init (IdeRecentProjectsClass *klass)
 static void
 ide_recent_projects_init (IdeRecentProjects *self)
 {
-  GIOExtensionPoint *extension_point;
-  GList *extensions;
+  PeasExtensionSet *set;
+  PeasEngine *engine;
 
   self->projects = g_sequence_new (g_object_unref);
   self->miners = g_ptr_array_new_with_free_func (g_object_unref);
@@ -302,28 +319,10 @@ ide_recent_projects_init (IdeRecentProjects *self)
                                      IDE_RECENT_PROJECTS_BOOKMARK_FILENAME,
                                      NULL);
 
-
-  extension_point = g_io_extension_point_lookup (IDE_PROJECT_MINER_EXTENSION_POINT);
-  extensions = g_io_extension_point_get_extensions (extension_point);
-
-  for (; extensions; extensions = extensions->next)
-    {
-      IdeProjectMiner *miner;
-      GIOExtension *extension = extensions->data;
-      GType type_id;
-
-      type_id = g_io_extension_get_type (extension);
-
-      if (!g_type_is_a (type_id, IDE_TYPE_PROJECT_MINER))
-        {
-          g_warning ("%s is not an IdeProjectMiner", g_type_name (type_id));
-          continue;
-        }
-
-      miner = g_object_new (type_id, NULL);
-      ide_recent_projects_add_miner (self, miner);
-      g_object_unref (miner);
-    }
+  engine = peas_engine_get_default ();
+  set = peas_extension_set_new (engine, IDE_TYPE_PROJECT_MINER, NULL);
+  peas_extension_set_foreach (set, foreach_miner_func, self);
+  g_clear_object (&set);
 }
 
 /**
diff --git a/libide/ide.c b/libide/ide.c
index 3e12ff4..70d5441 100644
--- a/libide/ide.c
+++ b/libide/ide.c
@@ -24,9 +24,6 @@
 #include "gconstructor.h"
 #include "ide.h"
 
-#include "ide-autotools-build-system.h"
-#include "ide-autotools-project-miner.h"
-#include "ide-directory-build-system.h"
 #include "ide-directory-vcs.h"
 #include "ide-editorconfig-file-settings.h"
 #include "ide-file-settings.h"
@@ -80,24 +77,12 @@ ide_init_ctor (void)
   g_irepository_prepend_search_path (LIBDIR"/gnome-builder/girepository-1.0");
 
   g_type_ensure (IDE_TYPE_CONTEXT);
-  g_type_ensure (IDE_TYPE_BUILD_SYSTEM);
   g_type_ensure (IDE_TYPE_VCS);
 
-  g_io_extension_point_register (IDE_BUILD_SYSTEM_EXTENSION_POINT);
   g_io_extension_point_register (IDE_FILE_SETTINGS_EXTENSION_POINT);
-  g_io_extension_point_register (IDE_PROJECT_MINER_EXTENSION_POINT);
   g_io_extension_point_register (IDE_SCRIPT_EXTENSION_POINT);
   g_io_extension_point_register (IDE_VCS_EXTENSION_POINT);
 
-  g_io_extension_point_implement (IDE_BUILD_SYSTEM_EXTENSION_POINT,
-                                  IDE_TYPE_AUTOTOOLS_BUILD_SYSTEM,
-                                  IDE_BUILD_SYSTEM_EXTENSION_POINT".autotools",
-                                  -100);
-  g_io_extension_point_implement (IDE_BUILD_SYSTEM_EXTENSION_POINT,
-                                  IDE_TYPE_DIRECTORY_BUILD_SYSTEM,
-                                  IDE_BUILD_SYSTEM_EXTENSION_POINT".directory",
-                                  -200);
-
   g_io_extension_point_implement (IDE_FILE_SETTINGS_EXTENSION_POINT,
                                   IDE_TYPE_MODELINES_FILE_SETTINGS,
                                   IDE_FILE_SETTINGS_EXTENSION_POINT".modelines",
@@ -111,11 +96,6 @@ ide_init_ctor (void)
                                   IDE_FILE_SETTINGS_EXTENSION_POINT".gsettings",
                                   -300);
 
-  g_io_extension_point_implement (IDE_PROJECT_MINER_EXTENSION_POINT,
-                                  IDE_TYPE_AUTOTOOLS_PROJECT_MINER,
-                                  IDE_PROJECT_MINER_EXTENSION_POINT".autotools",
-                                  0);
-
   g_io_extension_point_implement (IDE_SCRIPT_EXTENSION_POINT,
                                   IDE_TYPE_GJS_SCRIPT,
                                   IDE_SCRIPT_EXTENSION_POINT".gjs",
diff --git a/libide/ide.h b/libide/ide.h
index faea19c..e6689af 100644
--- a/libide/ide.h
+++ b/libide/ide.h
@@ -87,14 +87,13 @@ G_BEGIN_DECLS
 #include "ide-target.h"
 #include "ide-test-case.h"
 #include "ide-test-suite.h"
+#include "ide-thread-pool.h"
 #include "ide-types.h"
 #include "ide-unsaved-file.h"
 #include "ide-unsaved-files.h"
 #include "ide-vcs.h"
 #include "ide-vcs-uri.h"
 
-#include "autotools/ide-autotools-build-system.h"
-#include "directory/ide-directory-build-system.h"
 #include "directory/ide-directory-vcs.h"
 #include "doap/ide-doap-person.h"
 #include "doap/ide-doap.h"
@@ -102,6 +101,7 @@ G_BEGIN_DECLS
 #include "git/ide-git-vcs.h"
 #include "local/ide-local-device.h"
 #include "theatrics/ide-animation.h"
+#include "util/ide-line-reader.h"
 
 #undef IDE_INSIDE
 
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index bf85fba..9faf082 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -1,10 +1,12 @@
 SUBDIRS = \
+       autotools \
        clang \
        command-bar \
        c-pack \
        ctags \
        devhelp \
        device-manager \
+       fallback \
        file-search \
        gnome-code-assistance \
        html-completion \
diff --git a/plugins/autotools/Makefile.am b/plugins/autotools/Makefile.am
new file mode 100644
index 0000000..ba92340
--- /dev/null
+++ b/plugins/autotools/Makefile.am
@@ -0,0 +1,32 @@
+plugindir = $(libdir)/gnome-builder/plugins
+plugin_LTLIBRARIES = libautotools-plugin.la
+plugin_DATA = autotools.plugin
+
+libautotools_plugin_la_SOURCES = \
+       autotools-plugin.c \
+       ide-autotools-builder.c \
+       ide-autotools-builder.h \
+       ide-autotools-build-system.c \
+       ide-autotools-build-system.h \
+       ide-autotools-build-task.c \
+       ide-autotools-build-task.h \
+       ide-autotools-project-miner.c \
+       ide-autotools-project-miner.h \
+       ide-makecache.c \
+       ide-makecache.h \
+       ide-makecache-target.c \
+       ide-makecache-target.h \
+       $(NULL)
+
+libautotools_plugin_la_CFLAGS = \
+       $(BUILDER_CFLAGS) \
+       -I$(top_srcdir)/contrib/egg \
+       -I$(top_srcdir)/libide \
+       $(NULL)
+
+libautotools_plugin_la_LDFLAGS = \
+       -avoid-version \
+       -module \
+       $(NULL)
+
+-include $(top_srcdir)/git.mk
diff --git a/libide/directory/ide-directory-build-system.h b/plugins/autotools/autotools-plugin.c
similarity index 59%
copy from libide/directory/ide-directory-build-system.h
copy to plugins/autotools/autotools-plugin.c
index f21747d..cc26daf 100644
--- a/libide/directory/ide-directory-build-system.h
+++ b/plugins/autotools/autotools-plugin.c
@@ -1,4 +1,4 @@
-/* ide-directory-build-system.h
+/* autotools-plugin.c
  *
  * Copyright (C) 2015 Christian Hergert <christian hergert me>
  *
@@ -16,23 +16,15 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef IDE_DIRECTORY_BUILD_SYSTEM_H
-#define IDE_DIRECTORY_BUILD_SYSTEM_H
+#include <libpeas/peas.h>
+#include <ide.h>
 
-#include "ide-build-system.h"
+#include "ide-autotools-build-system.h"
+#include "ide-autotools-project-miner.h"
 
-G_BEGIN_DECLS
-
-#define IDE_TYPE_DIRECTORY_BUILD_SYSTEM (ide_directory_build_system_get_type())
-
-G_DECLARE_FINAL_TYPE (IdeDirectoryBuildSystem, ide_directory_build_system,
-                      IDE, DIRECTORY_BUILD_SYSTEM, IdeBuildSystem)
-
-struct _IdeDirectoryBuildSystem
+void
+peas_register_types (PeasObjectModule *module)
 {
-  IdeBuildSystem parent_instance;
-};
-
-G_END_DECLS
-
-#endif /* IDE_DIRECTORY_BUILD_SYSTEM_H */
+  peas_object_module_register_extension_type (module, IDE_TYPE_BUILD_SYSTEM, 
IDE_TYPE_AUTOTOOLS_BUILD_SYSTEM);
+  peas_object_module_register_extension_type (module, IDE_TYPE_PROJECT_MINER, 
IDE_TYPE_AUTOTOOLS_PROJECT_MINER);
+}
diff --git a/plugins/autotools/autotools.plugin b/plugins/autotools/autotools.plugin
new file mode 100644
index 0000000..29379e7
--- /dev/null
+++ b/plugins/autotools/autotools.plugin
@@ -0,0 +1,8 @@
+[Plugin]
+Module=autotools-plugin
+Name=Autotools
+Description=Provides integration with the Autotools build system
+Authors=Christian Hergert <christian hergert me>
+Copyright=Copyright © 2015 Christian Hergert
+Builtin=true
+Hidden=true
diff --git a/libide/autotools/ide-autotools-build-system.c b/plugins/autotools/ide-autotools-build-system.c
similarity index 92%
rename from libide/autotools/ide-autotools-build-system.c
rename to plugins/autotools/ide-autotools-build-system.c
index ef020d8..d86ed0b 100644
--- a/libide/autotools/ide-autotools-build-system.c
+++ b/plugins/autotools/ide-autotools-build-system.c
@@ -41,24 +41,27 @@
 
 struct _IdeAutotoolsBuildSystem
 {
-  IdeBuildSystem  parent_instance;
+  IdeObject     parent_instance;
 
-  EggTaskCache   *task_cache;
-  gchar          *tarball_name;
+  GFile        *project_file;
+  EggTaskCache *task_cache;
+  gchar        *tarball_name;
 };
 
 static void async_initable_iface_init (GAsyncInitableIface *iface);
+static void build_system_iface_init (IdeBuildSystemInterface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (IdeAutotoolsBuildSystem,
                          ide_autotools_build_system,
-                         IDE_TYPE_BUILD_SYSTEM,
-                         G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
-                                                async_initable_iface_init))
+                         IDE_TYPE_OBJECT,
+                         G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init)
+                         G_IMPLEMENT_INTERFACE (IDE_TYPE_BUILD_SYSTEM, build_system_iface_init))
 
 EGG_DEFINE_COUNTER (build_flags, "Autotools", "Flags Requests", "Requests count for build flags")
 
 enum {
   PROP_0,
+  PROP_PROJECT_FILE,
   PROP_TARBALL_NAME,
   LAST_PROP
 };
@@ -588,6 +591,12 @@ ide_autotools_build_system_constructed (GObject *object)
                            G_CONNECT_SWAPPED);
 }
 
+static gint
+ide_autotools_build_system_get_priority (IdeBuildSystem *system)
+{
+  return -100;
+}
+
 static void
 ide_autotools_build_system_finalize (GObject *object)
 {
@@ -609,6 +618,10 @@ ide_autotools_build_system_get_property (GObject    *object,
 
   switch (prop_id)
     {
+    case PROP_PROJECT_FILE:
+      g_value_set_object (value, self->project_file);
+      break;
+
     case PROP_TARBALL_NAME:
       g_value_set_string (value,
                           ide_autotools_build_system_get_tarball_name (self));
@@ -620,18 +633,43 @@ ide_autotools_build_system_get_property (GObject    *object,
 }
 
 static void
+ide_autotools_build_system_set_property (GObject      *object,
+                                         guint         prop_id,
+                                         const GValue *value,
+                                         GParamSpec   *pspec)
+{
+  IdeAutotoolsBuildSystem *self = IDE_AUTOTOOLS_BUILD_SYSTEM (object);
+
+  switch (prop_id)
+    {
+    case PROP_PROJECT_FILE:
+      g_clear_object (&self->project_file);
+      self->project_file = g_value_dup_object (value);
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+build_system_iface_init (IdeBuildSystemInterface *iface)
+{
+  iface->get_priority = ide_autotools_build_system_get_priority;
+  iface->get_builder = ide_autotools_build_system_get_builder;
+  iface->get_build_flags_async = ide_autotools_build_system_get_build_flags_async;
+  iface->get_build_flags_finish = ide_autotools_build_system_get_build_flags_finish;
+}
+
+static void
 ide_autotools_build_system_class_init (IdeAutotoolsBuildSystemClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  IdeBuildSystemClass *build_system_class = IDE_BUILD_SYSTEM_CLASS (klass);
 
   object_class->constructed = ide_autotools_build_system_constructed;
   object_class->finalize = ide_autotools_build_system_finalize;
   object_class->get_property = ide_autotools_build_system_get_property;
-
-  build_system_class->get_builder = ide_autotools_build_system_get_builder;
-  build_system_class->get_build_flags_async = ide_autotools_build_system_get_build_flags_async;
-  build_system_class->get_build_flags_finish = ide_autotools_build_system_get_build_flags_finish;
+  object_class->set_property = ide_autotools_build_system_set_property;
 
   gParamSpecs [PROP_TARBALL_NAME] =
     g_param_spec_string ("tarball-name",
@@ -640,6 +678,13 @@ ide_autotools_build_system_class_init (IdeAutotoolsBuildSystemClass *klass)
                          NULL,
                          (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
+  gParamSpecs [PROP_PROJECT_FILE] =
+    g_param_spec_object ("project-file",
+                         _("Project File"),
+                         _("The path of the project file."),
+                         G_TYPE_FILE,
+                         (G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
+
   g_object_class_install_properties (object_class, LAST_PROP, gParamSpecs);
 }
 
@@ -739,7 +784,7 @@ discover_file_cb (GObject      *object,
       return;
     }
 
-  _ide_build_system_set_project_file (IDE_BUILD_SYSTEM (self), file);
+  g_object_set (self, "project-file", file, NULL);
 
   ide_autotools_build_system_parse_async (self,
                                           file,
diff --git a/libide/autotools/ide-autotools-build-system.h b/plugins/autotools/ide-autotools-build-system.h
similarity index 93%
rename from libide/autotools/ide-autotools-build-system.h
rename to plugins/autotools/ide-autotools-build-system.h
index f800839..fd64727 100644
--- a/libide/autotools/ide-autotools-build-system.h
+++ b/plugins/autotools/ide-autotools-build-system.h
@@ -25,8 +25,7 @@ G_BEGIN_DECLS
 
 #define IDE_TYPE_AUTOTOOLS_BUILD_SYSTEM (ide_autotools_build_system_get_type())
 
-G_DECLARE_FINAL_TYPE (IdeAutotoolsBuildSystem, ide_autotools_build_system,
-                      IDE, AUTOTOOLS_BUILD_SYSTEM, IdeBuildSystem)
+G_DECLARE_FINAL_TYPE (IdeAutotoolsBuildSystem, ide_autotools_build_system, IDE, AUTOTOOLS_BUILD_SYSTEM, 
IdeObject)
 
 const gchar *ide_autotools_build_system_get_tarball_name (IdeAutotoolsBuildSystem *self);
 
diff --git a/libide/autotools/ide-autotools-build-task.c b/plugins/autotools/ide-autotools-build-task.c
similarity index 100%
rename from libide/autotools/ide-autotools-build-task.c
rename to plugins/autotools/ide-autotools-build-task.c
diff --git a/libide/autotools/ide-autotools-build-task.h b/plugins/autotools/ide-autotools-build-task.h
similarity index 100%
rename from libide/autotools/ide-autotools-build-task.h
rename to plugins/autotools/ide-autotools-build-task.h
diff --git a/libide/autotools/ide-autotools-builder.c b/plugins/autotools/ide-autotools-builder.c
similarity index 100%
rename from libide/autotools/ide-autotools-builder.c
rename to plugins/autotools/ide-autotools-builder.c
diff --git a/libide/autotools/ide-autotools-builder.h b/plugins/autotools/ide-autotools-builder.h
similarity index 100%
rename from libide/autotools/ide-autotools-builder.h
rename to plugins/autotools/ide-autotools-builder.h
diff --git a/libide/autotools/ide-autotools-project-miner.c b/plugins/autotools/ide-autotools-project-miner.c
similarity index 95%
rename from libide/autotools/ide-autotools-project-miner.c
rename to plugins/autotools/ide-autotools-project-miner.c
index 68e8c9c..1353be7 100644
--- a/libide/autotools/ide-autotools-project-miner.c
+++ b/plugins/autotools/ide-autotools-project-miner.c
@@ -19,21 +19,22 @@
 #define G_LOG_DOMAIN "ide-autotools-project-miner"
 
 #include <glib/gi18n.h>
+#include <ide.h>
 
 #include "ide-autotools-project-miner.h"
-#include "ide-debug.h"
-#include "ide-doap.h"
-#include "ide-macros.h"
 
 #define MAX_MINE_DEPTH 5
 
 struct _IdeAutotoolsProjectMiner
 {
-  IdeProjectMiner  parent_instance;
-  GFile           *root_directory;
+  GObject  parent_instance;
+  GFile   *root_directory;
 };
 
-G_DEFINE_TYPE (IdeAutotoolsProjectMiner, ide_autotools_project_miner, IDE_TYPE_PROJECT_MINER)
+static void project_miner_iface_init (IdeProjectMinerInterface *iface);
+
+G_DEFINE_TYPE_EXTENDED (IdeAutotoolsProjectMiner, ide_autotools_project_miner, G_TYPE_OBJECT, 0,
+                        G_IMPLEMENT_INTERFACE (IDE_TYPE_PROJECT_MINER, project_miner_iface_init))
 
 enum {
   PROP_0,
@@ -162,7 +163,7 @@ ide_autotools_project_miner_discovered (IdeAutotoolsProjectMiner *self,
                                "last-modified-at", last_modified_at,
                                "languages", languages,
                                "name", name,
-                               "priority", IDE_AUTOTOOLS_PROJECT_MINER_PRIORITY,
+                               "priority", 100,
                                NULL);
 
   ide_project_miner_emit_discovered (IDE_PROJECT_MINER (self), project_info);
@@ -371,18 +372,21 @@ ide_autotools_project_miner_set_property (GObject      *object,
 }
 
 static void
+project_miner_iface_init (IdeProjectMinerInterface *iface)
+{
+  iface->mine_async = ide_autotools_project_miner_mine_async;
+  iface->mine_finish = ide_autotools_project_miner_mine_finish;
+}
+
+static void
 ide_autotools_project_miner_class_init (IdeAutotoolsProjectMinerClass *klass)
 {
-  IdeProjectMinerClass *miner_class = IDE_PROJECT_MINER_CLASS (klass);
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->finalize = ide_autotools_project_miner_finalize;
   object_class->get_property = ide_autotools_project_miner_get_property;
   object_class->set_property = ide_autotools_project_miner_set_property;
 
-  miner_class->mine_async = ide_autotools_project_miner_mine_async;
-  miner_class->mine_finish = ide_autotools_project_miner_mine_finish;
-
   gParamSpecs [PROP_ROOT_DIRECTORY] =
     g_param_spec_object ("root-directory",
                          _("Root Directory"),
diff --git a/libide/autotools/ide-autotools-project-miner.h b/plugins/autotools/ide-autotools-project-miner.h
similarity index 85%
rename from libide/autotools/ide-autotools-project-miner.h
rename to plugins/autotools/ide-autotools-project-miner.h
index 1c9b905..86a5d61 100644
--- a/libide/autotools/ide-autotools-project-miner.h
+++ b/plugins/autotools/ide-autotools-project-miner.h
@@ -23,11 +23,9 @@
 
 G_BEGIN_DECLS
 
-#define IDE_TYPE_AUTOTOOLS_PROJECT_MINER     (ide_autotools_project_miner_get_type())
-#define IDE_AUTOTOOLS_PROJECT_MINER_PRIORITY 100
+#define IDE_TYPE_AUTOTOOLS_PROJECT_MINER (ide_autotools_project_miner_get_type())
 
-G_DECLARE_FINAL_TYPE (IdeAutotoolsProjectMiner, ide_autotools_project_miner,
-                      IDE, AUTOTOOLS_PROJECT_MINER, IdeProjectMiner)
+G_DECLARE_FINAL_TYPE (IdeAutotoolsProjectMiner, ide_autotools_project_miner, IDE, AUTOTOOLS_PROJECT_MINER, 
GObject)
 
 GFile *ide_autotools_project_miner_get_root_directory (IdeAutotoolsProjectMiner *self);
 void   ide_autotools_project_miner_set_root_directory (IdeAutotoolsProjectMiner *self,
diff --git a/libide/autotools/ide-makecache-target.c b/plugins/autotools/ide-makecache-target.c
similarity index 100%
rename from libide/autotools/ide-makecache-target.c
rename to plugins/autotools/ide-makecache-target.c
diff --git a/libide/autotools/ide-makecache-target.h b/plugins/autotools/ide-makecache-target.h
similarity index 100%
rename from libide/autotools/ide-makecache-target.h
rename to plugins/autotools/ide-makecache-target.h
diff --git a/libide/autotools/ide-makecache.c b/plugins/autotools/ide-makecache.c
similarity index 99%
rename from libide/autotools/ide-makecache.c
rename to plugins/autotools/ide-makecache.c
index cd6dbad..e04099d 100644
--- a/libide/autotools/ide-makecache.c
+++ b/plugins/autotools/ide-makecache.c
@@ -33,16 +33,10 @@
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
 #include <unistd.h>
+#include <ide.h>
 
-#include "ide-context.h"
-#include "ide-debug.h"
-#include "ide-global.h"
 #include "ide-makecache.h"
 #include "ide-makecache-target.h"
-#include "ide-project.h"
-#include "ide-line-reader.h"
-#include "ide-thread-pool.h"
-#include "ide-vcs.h"
 
 #define FAKE_CC  "__LIBIDE_FAKE_CC__"
 #define FAKE_CXX "__LIBIDE_FAKE_CXX__"
diff --git a/libide/autotools/ide-makecache.h b/plugins/autotools/ide-makecache.h
similarity index 100%
rename from libide/autotools/ide-makecache.h
rename to plugins/autotools/ide-makecache.h
diff --git a/plugins/fallback/Makefile.am b/plugins/fallback/Makefile.am
new file mode 100644
index 0000000..11e8637
--- /dev/null
+++ b/plugins/fallback/Makefile.am
@@ -0,0 +1,21 @@
+plugindir = $(libdir)/gnome-builder/plugins
+plugin_LTLIBRARIES = libfallback-plugin.la
+plugin_DATA = fallback.plugin
+
+libfallback_plugin_la_SOURCES = \
+       fallback-plugin.c \
+       ide-directory-build-system.c \
+       ide-directory-build-system.h \
+       $(NULL)
+
+libfallback_plugin_la_CFLAGS = \
+       $(BUILDER_CFLAGS) \
+       -I$(top_srcdir)/libide \
+       $(NULL)
+
+libfallback_plugin_la_LDFLAGS = \
+       -avoid-version \
+       -module \
+       $(NULL)
+
+-include $(top_srcdir)/git.mk
diff --git a/libide/directory/ide-directory-build-system.h b/plugins/fallback/fallback-plugin.c
similarity index 59%
copy from libide/directory/ide-directory-build-system.h
copy to plugins/fallback/fallback-plugin.c
index f21747d..126c1f1 100644
--- a/libide/directory/ide-directory-build-system.h
+++ b/plugins/fallback/fallback-plugin.c
@@ -1,4 +1,4 @@
-/* ide-directory-build-system.h
+/* fallback-plugin.c
  *
  * Copyright (C) 2015 Christian Hergert <christian hergert me>
  *
@@ -16,23 +16,13 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef IDE_DIRECTORY_BUILD_SYSTEM_H
-#define IDE_DIRECTORY_BUILD_SYSTEM_H
+#include <libpeas/peas.h>
+#include <ide.h>
 
-#include "ide-build-system.h"
+#include "ide-directory-build-system.h"
 
-G_BEGIN_DECLS
-
-#define IDE_TYPE_DIRECTORY_BUILD_SYSTEM (ide_directory_build_system_get_type())
-
-G_DECLARE_FINAL_TYPE (IdeDirectoryBuildSystem, ide_directory_build_system,
-                      IDE, DIRECTORY_BUILD_SYSTEM, IdeBuildSystem)
-
-struct _IdeDirectoryBuildSystem
+void
+peas_register_types (PeasObjectModule *module)
 {
-  IdeBuildSystem parent_instance;
-};
-
-G_END_DECLS
-
-#endif /* IDE_DIRECTORY_BUILD_SYSTEM_H */
+  peas_object_module_register_extension_type (module, IDE_TYPE_BUILD_SYSTEM, 
IDE_TYPE_DIRECTORY_BUILD_SYSTEM);
+}
diff --git a/plugins/fallback/fallback.plugin b/plugins/fallback/fallback.plugin
new file mode 100644
index 0000000..c733bee
--- /dev/null
+++ b/plugins/fallback/fallback.plugin
@@ -0,0 +1,9 @@
+[Plugin]
+Module=fallback-plugin
+Name=Fallback
+Description=Provides fallback implementations for Builder subsystems.
+Authors=Christian Hergert <christian hergert me>
+Copyright=Copyright © 2015 Christian Hergert
+Builtin=true
+Hidden=true
+X-Build-System-Priority=10000000
diff --git a/libide/directory/ide-directory-build-system.c b/plugins/fallback/ide-directory-build-system.c
similarity index 76%
rename from libide/directory/ide-directory-build-system.c
rename to plugins/fallback/ide-directory-build-system.c
index 26a4e17..08b5d9f 100644
--- a/libide/directory/ide-directory-build-system.c
+++ b/plugins/fallback/ide-directory-build-system.c
@@ -24,27 +24,28 @@
 #include "ide-project-file.h"
 #include "ide-project-item.h"
 
-typedef struct
+struct _IdeDirectoryBuildSystem
 {
-  gpointer dummy;
-} IdeDirectoryBuildSystemPrivate;
+  IdeObject  parent_instance;
+  GFile     *project_file;
+};
 
 static void async_initiable_init (GAsyncInitableIface *iface);
 
 G_DEFINE_TYPE_EXTENDED (IdeDirectoryBuildSystem,
                         ide_directory_build_system,
-                        IDE_TYPE_BUILD_SYSTEM,
+                        IDE_TYPE_OBJECT,
                         0,
-                        G_ADD_PRIVATE (IdeDirectoryBuildSystem)
-                        G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
-                                               async_initiable_init))
+                        G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initiable_init)
+                        G_IMPLEMENT_INTERFACE (IDE_TYPE_BUILD_SYSTEM, NULL))
 
 enum {
   PROP_0,
+  PROP_PROJECT_FILE,
   LAST_PROP
 };
 
-//static GParamSpec *gParamSpecs [LAST_PROP];
+static GParamSpec *gParamSpecs [LAST_PROP];
 
 IdeDirectoryBuildSystem *
 ide_directory_build_system_new (void)
@@ -55,6 +56,10 @@ ide_directory_build_system_new (void)
 static void
 ide_directory_build_system_finalize (GObject *object)
 {
+  IdeDirectoryBuildSystem *self = (IdeDirectoryBuildSystem *)object;
+
+  g_clear_object (&self->project_file);
+
   G_OBJECT_CLASS (ide_directory_build_system_parent_class)->finalize (object);
 }
 
@@ -64,10 +69,14 @@ ide_directory_build_system_get_property (GObject    *object,
                                          GValue     *value,
                                          GParamSpec *pspec)
 {
-  //IdeDirectoryBuildSystem *self = IDE_DIRECTORY_BUILD_SYSTEM (object);
+  IdeDirectoryBuildSystem *self = IDE_DIRECTORY_BUILD_SYSTEM (object);
 
   switch (prop_id)
     {
+    case PROP_PROJECT_FILE:
+      g_value_set_object (value, self->project_file);
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -79,10 +88,15 @@ ide_directory_build_system_set_property (GObject      *object,
                                          const GValue *value,
                                          GParamSpec   *pspec)
 {
-  //IdeDirectoryBuildSystem *self = IDE_DIRECTORY_BUILD_SYSTEM (object);
+  IdeDirectoryBuildSystem *self = IDE_DIRECTORY_BUILD_SYSTEM (object);
 
   switch (prop_id)
     {
+    case PROP_PROJECT_FILE:
+      g_clear_object (&self->project_file);
+      self->project_file = g_value_dup_object (value);
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
     }
@@ -96,6 +110,15 @@ ide_directory_build_system_class_init (IdeDirectoryBuildSystemClass *klass)
   object_class->finalize = ide_directory_build_system_finalize;
   object_class->get_property = ide_directory_build_system_get_property;
   object_class->set_property = ide_directory_build_system_set_property;
+
+  gParamSpecs [PROP_PROJECT_FILE] =
+    g_param_spec_object ("project-file",
+                         _("Project File"),
+                         _("The path of the project file."),
+                         G_TYPE_FILE,
+                         (G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
+
+  g_object_class_install_properties (object_class, LAST_PROP, gParamSpecs);
 }
 
 static void
diff --git a/libide/directory/ide-directory-build-system.h b/plugins/fallback/ide-directory-build-system.h
similarity index 87%
rename from libide/directory/ide-directory-build-system.h
rename to plugins/fallback/ide-directory-build-system.h
index f21747d..db18864 100644
--- a/libide/directory/ide-directory-build-system.h
+++ b/plugins/fallback/ide-directory-build-system.h
@@ -25,13 +25,7 @@ G_BEGIN_DECLS
 
 #define IDE_TYPE_DIRECTORY_BUILD_SYSTEM (ide_directory_build_system_get_type())
 
-G_DECLARE_FINAL_TYPE (IdeDirectoryBuildSystem, ide_directory_build_system,
-                      IDE, DIRECTORY_BUILD_SYSTEM, IdeBuildSystem)
-
-struct _IdeDirectoryBuildSystem
-{
-  IdeBuildSystem parent_instance;
-};
+G_DECLARE_FINAL_TYPE (IdeDirectoryBuildSystem, ide_directory_build_system, IDE, DIRECTORY_BUILD_SYSTEM, 
IdeObject)
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]