[gnome-builder] ide build: add -c option to clean the project



commit c382ab0c3781e681ae7a0b0ebecd74874b0b6283
Author: Christian Hergert <christian hergert me>
Date:   Sun Dec 27 17:50:08 2015 -0800

    ide build: add -c option to clean the project

 plugins/build-tools/gbp-build-tool.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plugins/build-tools/gbp-build-tool.c b/plugins/build-tools/gbp-build-tool.c
index 0ced2b1..934819f 100644
--- a/plugins/build-tools/gbp-build-tool.c
+++ b/plugins/build-tools/gbp-build-tool.c
@@ -179,10 +179,13 @@ gbp_build_tool_run_async (IdeApplicationTool  *tool,
   g_autoptr(GOptionContext) opt_context = NULL;
   g_autoptr(GKeyFile) config = NULL;
   g_auto(GStrv) strv = NULL;
+  gboolean clean = FALSE;
   gint parallel = -1;
   IdeBuilderBuildFlags flags = 0;
   GError *error = NULL;
   const GOptionEntry entries[] = {
+    { "clean", 'c', 0, G_OPTION_ARG_NONE, &clean,
+      N_("Clean the project") },
     { "device", 'd', 0, G_OPTION_ARG_STRING, &device_id,
       N_("The id of the device to build for"),
       N_("local") },
@@ -224,6 +227,9 @@ gbp_build_tool_run_async (IdeApplicationTool  *tool,
   if (parallel >= -1)
     g_key_file_set_integer (config, "parallel", "workers", parallel);
 
+  if (clean)
+    flags |= IDE_BUILDER_BUILD_FLAGS_CLEAN;
+
   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);
   g_object_set_data (G_OBJECT (task), "FLAGS", GINT_TO_POINTER (flags));


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