[gnome-builder] ide build: add -jN option to specify number of workers



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

    ide build: add -jN option to specify number of workers

 plugins/build-tools/gbp-build-tool.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/plugins/build-tools/gbp-build-tool.c b/plugins/build-tools/gbp-build-tool.c
index 70f2d7b..d56fb8b 100644
--- a/plugins/build-tools/gbp-build-tool.c
+++ b/plugins/build-tools/gbp-build-tool.c
@@ -177,11 +177,15 @@ gbp_build_tool_run_async (IdeApplicationTool  *tool,
   g_autoptr(GOptionContext) opt_context = NULL;
   g_autoptr(GKeyFile) config = NULL;
   g_auto(GStrv) strv = NULL;
+  gint parallel = -1;
   GError *error = NULL;
   const GOptionEntry entries[] = {
     { "device", 'd', 0, G_OPTION_ARG_STRING, &device_id,
       N_("The id of the device to build for"),
       N_("local") },
+    { "parallel", 'j', 0, G_OPTION_ARG_INT, &parallel,
+      N_("Number of workers to use when building"),
+      N_("N") },
     { "project", 'p', 0, G_OPTION_ARG_FILENAME, &project_path,
       N_("Path to project file, defaults to current directory"),
       N_("PATH") },
@@ -214,6 +218,9 @@ gbp_build_tool_run_async (IdeApplicationTool  *tool,
 
   config = g_key_file_new ();
 
+  if (parallel >= -1)
+    g_key_file_set_integer (config, "parallel", "workers", parallel);
+
   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);
 


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