[gnome-builder] autotools: remove build targets from build system



commit 8825ac657f925ed765aa2788d5caf839cb6019f8
Author: Christian Hergert <chergert redhat com>
Date:   Sun Nov 19 22:19:49 2017 -0800

    autotools: remove build targets from build system
    
    We no longer need this now that we have the targets provider.

 src/plugins/autotools/ide-autotools-build-system.c |  140 --------------------
 1 files changed, 0 insertions(+), 140 deletions(-)
---
diff --git a/src/plugins/autotools/ide-autotools-build-system.c 
b/src/plugins/autotools/ide-autotools-build-system.c
index 5067249..23b9626 100644
--- a/src/plugins/autotools/ide-autotools-build-system.c
+++ b/src/plugins/autotools/ide-autotools-build-system.c
@@ -472,144 +472,6 @@ ide_autotools_build_system_get_build_flags_finish (IdeBuildSystem  *build_system
   return g_task_propagate_pointer (G_TASK (result), error);
 }
 
-static void
-ide_autotools_build_system_get_build_targets_cb (GObject      *object,
-                                                 GAsyncResult *result,
-                                                 gpointer      user_data)
-{
-  IdeMakecache *makecache = (IdeMakecache *)object;
-  g_autoptr(GTask) task = user_data;
-  g_autoptr(GError) error = NULL;
-  g_autoptr(GPtrArray) ret = NULL;
-
-  IDE_ENTRY;
-
-  g_assert (IDE_IS_MAKECACHE (makecache));
-  g_assert (G_IS_ASYNC_RESULT (result));
-  g_assert (G_IS_TASK (task));
-
-  ret = ide_makecache_get_build_targets_finish (makecache, result, &error);
-
-  if (ret == NULL)
-    g_task_return_error (task, g_steal_pointer (&error));
-  else
-    g_task_return_pointer (task, g_steal_pointer (&ret), (GDestroyNotify)g_ptr_array_unref);
-
-  IDE_EXIT;
-}
-
-static void
-ide_autotools_build_system_get_build_targets_execute_cb (GObject      *object,
-                                                         GAsyncResult *result,
-                                                         gpointer      user_data)
-{
-  IdeBuildManager *build_manager = (IdeBuildManager *)object;
-  g_autoptr(GTask) task = user_data;
-  g_autoptr(GError) error = NULL;
-  g_autoptr(GFile) builddir_file = NULL;
-  IdeMakecache *makecache = NULL;
-  IdeBuildPipeline *pipeline;
-  GCancellable *cancellable;
-  const gchar *builddir;
-
-  IDE_ENTRY;
-
-  g_assert (IDE_IS_BUILD_MANAGER (build_manager));
-  g_assert (G_IS_ASYNC_RESULT (result));
-  g_assert (G_IS_TASK (task));
-
-  cancellable = g_task_get_cancellable (task);
-  g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
-
-  if (!ide_build_manager_execute_finish (build_manager, result, &error))
-    {
-      g_task_return_error (task, g_steal_pointer (&error));
-      IDE_EXIT;
-    }
-
-  pipeline = ide_build_manager_get_pipeline (build_manager);
-
-  builddir = ide_build_pipeline_get_builddir (pipeline);
-  builddir_file = g_file_new_for_path (builddir);
-
-  /*
-   * Locate our makecache by finding the makecache stage (which should have
-   * successfully executed by now) and get makecache object. Then we can
-   * locate the build flags for the file (which makecache will translate
-   * into the appropriate build target).
-   */
-
-  ide_build_pipeline_foreach_stage (pipeline, find_makecache_stage, &makecache);
-
-  if (makecache != NULL)
-    {
-      ide_makecache_get_build_targets_async (makecache,
-                                             builddir_file,
-                                             cancellable,
-                                             ide_autotools_build_system_get_build_targets_cb,
-                                             g_steal_pointer (&task));
-      IDE_EXIT;
-    }
-
-  /*
-   * We failed to locate anything, so just return an empty array of
-   * of flags.
-   */
-
-  g_task_return_pointer (task, g_ptr_array_new (), (GDestroyNotify)g_ptr_array_unref);
-
-  IDE_EXIT;
-}
-
-static void
-ide_autotools_build_system_get_build_targets_async (IdeBuildSystem      *build_system,
-                                                    GCancellable        *cancellable,
-                                                    GAsyncReadyCallback  callback,
-                                                    gpointer             user_data)
-{
-  IdeAutotoolsBuildSystem *self = (IdeAutotoolsBuildSystem *)build_system;
-  IdeBuildManager *build_manager;
-  IdeContext *context;
-  g_autoptr(GTask) task = NULL;
-
-  IDE_ENTRY;
-
-  g_assert (IDE_IS_AUTOTOOLS_BUILD_SYSTEM (self));
-  g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
-
-  task = g_task_new (self, cancellable, callback, user_data);
-  g_task_set_source_tag (task, ide_autotools_build_system_get_build_targets_async);
-
-  /*
-   * To get the build targets we first need to get the makecache for the
-   * current build pipeline. That requires advancing the pipeline to at least
-   * the CONFIGURE stage so that our CONFIGURE|AFTER step has executed to
-   * generate the Makecache file in $builddir.
-   */
-
-  context = ide_object_get_context (IDE_OBJECT (self));
-  build_manager = ide_context_get_build_manager (context);
-
-  ide_build_manager_execute_async (build_manager,
-                                   IDE_BUILD_PHASE_CONFIGURE,
-                                   cancellable,
-                                   ide_autotools_build_system_get_build_targets_execute_cb,
-                                   g_steal_pointer (&task));
-
-  IDE_EXIT;
-}
-
-static GPtrArray *
-ide_autotools_build_system_get_build_targets_finish (IdeBuildSystem  *build_system,
-                                                     GAsyncResult    *result,
-                                                     GError         **error)
-{
-  g_assert (IDE_IS_AUTOTOOLS_BUILD_SYSTEM (build_system));
-  g_assert (G_IS_TASK (result));
-
-  return g_task_propagate_pointer (G_TASK (result), error);
-}
-
 static gchar *
 ide_autotools_build_system_get_builddir (IdeBuildSystem   *build_system,
                                          IdeConfiguration *configuration)
@@ -718,8 +580,6 @@ build_system_iface_init (IdeBuildSystemInterface *iface)
   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;
   iface->get_builddir = ide_autotools_build_system_get_builddir;
-  iface->get_build_targets_async = ide_autotools_build_system_get_build_targets_async;
-  iface->get_build_targets_finish = ide_autotools_build_system_get_build_targets_finish;
   iface->get_id = ide_autotools_build_system_get_id;
   iface->get_display_name = ide_autotools_build_system_get_display_name;
 }


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