[gnome-builder] ide build: propagate config when creating IdeBuilder



commit a386943917c4042a2891355bd75df84ab9e67d2d
Author: Christian Hergert <christian hergert me>
Date:   Sun Dec 27 17:45:09 2015 -0800

    ide build: propagate config when creating IdeBuilder

 plugins/build-tools/gbp-build-tool.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/plugins/build-tools/gbp-build-tool.c b/plugins/build-tools/gbp-build-tool.c
index 83d68e1..70f2d7b 100644
--- a/plugins/build-tools/gbp-build-tool.c
+++ b/plugins/build-tools/gbp-build-tool.c
@@ -98,6 +98,7 @@ gbp_build_tool_new_context_cb (GObject      *object,
   g_autoptr(IdeDevice) device = NULL;
   IdeDeviceManager *device_manager;
   IdeBuildSystem *build_system;
+  GKeyFile *config;
   const gchar *device_id;
   GError *error = NULL;
 
@@ -111,6 +112,8 @@ gbp_build_tool_new_context_cb (GObject      *object,
       return;
     }
 
+  config = g_object_get_data (G_OBJECT (task), "CONFIG");
+
   device_id = g_object_get_data (G_OBJECT (task), "DEVICE_ID");
   device_manager = ide_context_get_device_manager (context);
   device = ide_device_manager_get_device (device_manager, device_id);
@@ -129,7 +132,7 @@ gbp_build_tool_new_context_cb (GObject      *object,
   /* TODO: Support custom configs */
 
   build_system = ide_context_get_build_system (context);
-  builder = ide_build_system_get_builder (build_system, NULL, device, &error);
+  builder = ide_build_system_get_builder (build_system, config, device, &error);
 
   if (builder == NULL)
     {
@@ -172,6 +175,7 @@ gbp_build_tool_run_async (IdeApplicationTool  *tool,
   g_autofree gchar *device_id = NULL;
   g_autoptr(GFile) project_file = NULL;
   g_autoptr(GOptionContext) opt_context = NULL;
+  g_autoptr(GKeyFile) config = NULL;
   g_auto(GStrv) strv = NULL;
   GError *error = NULL;
   const GOptionEntry entries[] = {
@@ -208,7 +212,10 @@ gbp_build_tool_run_async (IdeApplicationTool  *tool,
   if (device_id == NULL)
     device_id = g_strdup ("local");
 
+  config = g_key_file_new ();
+
   g_object_set_data_full (G_OBJECT (task), "DEVICE_ID", g_strdup (device_id), g_free);
+  g_object_set_data_full (G_OBJECT (task), "CONFIG", g_key_file_ref (config), 
(GDestroyNotify)g_key_file_unref);
 
   ide_context_new_async (project_file,
                          cancellable,


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