Commit 9d8f41a3 authored by Christian Hergert's avatar Christian Hergert

foundry: rename IdeBuildPipeline and IdeBuildStage

This renames IdeBuildPipeline to IdePipeline and IdeBuildStage to
IdePipelineStage. Additionally, IdeBuildPhase is now IdePipelinePhase.

This should help in contributors understanding the difference between
the IdeBuildSystem components and the production pipeline and it's
components.

I didn't try very hard to keep whitespace nice, because we'll probably
do a large round of that with automation tools later and I'd rather do
that as a single pass.

Also, I renamed the execute APIs to build since execute didn't really
make sense in the concepts of a build pipeline that can
build/rebuild/clean.

I would not be surprised if there is a bit of fallout from this, so better
to get it in now than later.
parent 4b491943
......@@ -5,7 +5,7 @@ Extending the Build Pipeline
Builder uses the concept of a "Build Pipeline" to build a project. The build
pipeline consistes of multiple "phases" and build "stages" run in a given phase.
For example, in the ``Ide.BuildPhase.DOWNLAODS`` phase, you might have a stage
For example, in the ``Ide.PipelinePhase.DOWNLAODS`` phase, you might have a stage
that downloads and installs the dependencies for your project. The Flatpak
extension does this when building Flatpak-based project configurations.
......@@ -15,21 +15,21 @@ executed in exactly this sequence up to the requested phase.
Build Phases
============
- ``Ide.BuildPhase.PREPARE`` is the first phase of the build pipeline. Use this to create necessary directories and other preparation steps.
- ``Ide.BuildPhase.DOWNLOADS`` should be used to download and cache any build artifacts that are needed during the build.
- ``Ide.BuildPhase.DEPENDENCIES`` should build any dependencies that are needed to successfully build the project.
- ``Ide.BuildPhase.AUTOGEN`` should generate any necessary project files. Contrast this with the ``Ide.BuildPhase.CONFIGURE`` phase which runs the configuration scripts.
- ``Ide.BuildPhase.CONFIGURE`` should run configuration scripts such as ``./configure``, ``meson``, or ``cmake``.
- ``Ide.BuildPhase.BUILD`` should perform the incremental build process such as ``make`` or ``ninja``.
- ``Ide.BuildPhase.INSTALL`` should install the project to the configured prefix.
- ``Ide.BuildPhase.EXPORT`` should be used to attach export hooks such as buliding a Flatpak bundle, Debian, or RPM package.
- ``Ide.PipelinePhase.PREPARE`` is the first phase of the build pipeline. Use this to create necessary directories and other preparation steps.
- ``Ide.PipelinePhase.DOWNLOADS`` should be used to download and cache any build artifacts that are needed during the build.
- ``Ide.PipelinePhase.DEPENDENCIES`` should build any dependencies that are needed to successfully build the project.
- ``Ide.PipelinePhase.AUTOGEN`` should generate any necessary project files. Contrast this with the ``Ide.PipelinePhase.CONFIGURE`` phase which runs the configuration scripts.
- ``Ide.PipelinePhase.CONFIGURE`` should run configuration scripts such as ``./configure``, ``meson``, or ``cmake``.
- ``Ide.PipelinePhase.BUILD`` should perform the incremental build process such as ``make`` or ``ninja``.
- ``Ide.PipelinePhase.INSTALL`` should install the project to the configured prefix.
- ``Ide.PipelinePhase.EXPORT`` should be used to attach export hooks such as buliding a Flatpak bundle, Debian, or RPM package.
Additionally, there are phases which have special meaning.
- ``Ide.BuildPhase.BEFORE`` can be XOR'd with any previous phase to indicate it should run as part of the phase, but before the phase has started.
- ``Ide.BuildPhase.AFTER`` can be XOR'd with any previous phase to indicate it should run as part of the phase, but after the phase has completed.
- ``Ide.BuildPhase.FINISHED`` indicates that a previous build request has finished.
- ``Ide.BuildPhase.FAILED`` indicates that a previous build request has failed.
- ``Ide.PipelinePhase.BEFORE`` can be XOR'd with any previous phase to indicate it should run as part of the phase, but before the phase has started.
- ``Ide.PipelinePhase.AFTER`` can be XOR'd with any previous phase to indicate it should run as part of the phase, but after the phase has completed.
- ``Ide.PipelinePhase.FINISHED`` indicates that a previous build request has finished.
- ``Ide.PipelinePhase.FAILED`` indicates that a previous build request has failed.
Creating a Build Stage
======================
......@@ -104,7 +104,7 @@ loads we will register our stage in the appropriate phase.
def do_load(self, pipeline):
stage = MyBuildStage()
phase = Ide.BuildPhase.BUILD | Ide.BuildPhase.AFTER
phase = Ide.PipelinePhase.BUILD | Ide.PipelinePhase.AFTER
stage_id = pipeline.connect(phase, 100, stage)
# track() can be used to auto-unregister the phase when
......
This diff is collapsed.
......@@ -26,7 +26,7 @@
#include <libide-core.h>
#include "ide-build-pipeline.h"
#include "ide-pipeline.h"
G_BEGIN_DECLS
......@@ -58,12 +58,12 @@ void ide_build_manager_invalidate (IdeBuildManager *s
IDE_AVAILABLE_IN_3_32
void ide_build_manager_cancel (IdeBuildManager *self);
IDE_AVAILABLE_IN_3_32
IdeBuildPipeline *ide_build_manager_get_pipeline (IdeBuildManager *self);
IdePipeline *ide_build_manager_get_pipeline (IdeBuildManager *self);
IDE_AVAILABLE_IN_3_32
IdeBuildPipeline *ide_build_manager_ref_pipeline (IdeBuildManager *self);
IdePipeline *ide_build_manager_ref_pipeline (IdeBuildManager *self);
IDE_AVAILABLE_IN_3_32
void ide_build_manager_rebuild_async (IdeBuildManager *self,
IdeBuildPhase phase,
IdePipelinePhase phase,
GPtrArray *targets,
GCancellable *cancellable,
GAsyncReadyCallback callback,
......@@ -74,7 +74,7 @@ gboolean ide_build_manager_rebuild_finish (IdeBuildManager *s
GError **error);
IDE_AVAILABLE_IN_3_32
void ide_build_manager_execute_async (IdeBuildManager *self,
IdeBuildPhase phase,
IdePipelinePhase phase,
GPtrArray *targets,
GCancellable *cancellable,
GAsyncReadyCallback callback,
......@@ -85,7 +85,7 @@ gboolean ide_build_manager_execute_finish (IdeBuildManager *s
GError **error);
IDE_AVAILABLE_IN_3_32
void ide_build_manager_clean_async (IdeBuildManager *self,
IdeBuildPhase phase,
IdePipelinePhase phase,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
......
This diff is collapsed.
......@@ -26,21 +26,21 @@
G_BEGIN_DECLS
guint8 *_ide_build_utils_filter_color_codes (const guint8 *data,
gsize len,
gsize *out_len);
void _ide_build_pipeline_cancel (IdeBuildPipeline *self);
void _ide_build_pipeline_set_runtime (IdeBuildPipeline *self,
IdeRuntime *runtime);
void _ide_build_pipeline_set_toolchain (IdeBuildPipeline *self,
IdeToolchain *toolchain);
void _ide_build_pipeline_set_message (IdeBuildPipeline *self,
const gchar *message);
void _ide_build_pipeline_mark_broken (IdeBuildPipeline *self);
void _ide_build_pipeline_check_toolchain (IdeBuildPipeline *self,
IdeDeviceInfo *info);
void _ide_build_pipeline_set_pty_size (IdeBuildPipeline *self,
guint rows,
guint columns);
guint8 *_ide_build_utils_filter_color_codes (const guint8 *data,
gsize len,
gsize *out_len);
void _ide_pipeline_cancel (IdePipeline *self);
void _ide_pipeline_set_runtime (IdePipeline *self,
IdeRuntime *runtime);
void _ide_pipeline_set_toolchain (IdePipeline *self,
IdeToolchain *toolchain);
void _ide_pipeline_set_message (IdePipeline *self,
const gchar *message);
void _ide_pipeline_mark_broken (IdePipeline *self);
void _ide_pipeline_check_toolchain (IdePipeline *self,
IdeDeviceInfo *info);
void _ide_pipeline_set_pty_size (IdePipeline *self,
guint rows,
guint columns);
G_END_DECLS
......@@ -29,7 +29,7 @@
#include <string.h>
#include "ide-build-manager.h"
#include "ide-build-pipeline.h"
#include "ide-pipeline.h"
#include "ide-build-system.h"
#include "ide-config.h"
#include "ide-device.h"
......@@ -245,7 +245,7 @@ ide_build_system_default_init (IdeBuildSystemInterface *iface)
static gchar *
ide_build_system_translate (IdeBuildSystem *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
const gchar *prefix,
const gchar *path)
{
......@@ -256,16 +256,16 @@ ide_build_system_translate (IdeBuildSystem *self,
IdeRuntime *runtime;
g_assert (IDE_IS_BUILD_SYSTEM (self));
g_assert (!pipeline || IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (!pipeline || IDE_IS_PIPELINE (pipeline));
g_assert (prefix != NULL);
g_assert (path != NULL);
if (NULL == pipeline ||
NULL == (runtime = ide_build_pipeline_get_runtime (pipeline)))
NULL == (runtime = ide_pipeline_get_runtime (pipeline)))
return g_strdup_printf ("%s%s", prefix, path);
if (!g_path_is_absolute (path))
path = freeme = ide_build_pipeline_build_builddir_path (pipeline, path, NULL);
path = freeme = ide_pipeline_build_builddir_path (pipeline, path, NULL);
file = g_file_new_for_path (path);
translated = ide_runtime_translate_file (runtime, file);
......@@ -278,7 +278,7 @@ static void
ide_build_system_post_process_build_flags (IdeBuildSystem *self,
gchar **flags)
{
IdeBuildPipeline *pipeline;
IdePipeline *pipeline;
IdeBuildManager *build_manager;
IdeContext *context;
......@@ -449,14 +449,14 @@ ide_build_system_get_build_flags_for_files_finish (IdeBuildSystem *self,
gchar *
ide_build_system_get_builddir (IdeBuildSystem *self,
IdeBuildPipeline *pipeline)
IdePipeline *pipeline)
{
gchar *ret = NULL;
IDE_ENTRY;
g_return_val_if_fail (IDE_IS_BUILD_SYSTEM (self), NULL);
g_return_val_if_fail (IDE_IS_BUILD_PIPELINE (pipeline), NULL);
g_return_val_if_fail (IDE_IS_PIPELINE (pipeline), NULL);
if (IDE_BUILD_SYSTEM_GET_IFACE (self)->get_builddir)
ret = IDE_BUILD_SYSTEM_GET_IFACE (self)->get_builddir (self, pipeline);
......@@ -474,9 +474,9 @@ ide_build_system_get_builddir (IdeBuildSystem *self,
context = ide_object_get_context (IDE_OBJECT (self));
vcs = ide_vcs_from_context (context);
config = ide_build_pipeline_get_config (pipeline);
config = ide_pipeline_get_config (pipeline);
config_id = ide_config_get_id (config);
runtime = ide_build_pipeline_get_runtime (pipeline);
runtime = ide_pipeline_get_runtime (pipeline);
runtime_id = ide_runtime_get_id (runtime);
branch = ide_vcs_get_branch_name (vcs);
......
......@@ -58,7 +58,7 @@ struct _IdeBuildSystemInterface
GAsyncResult *result,
GError **error);
gchar *(*get_builddir) (IdeBuildSystem *self,
IdeBuildPipeline *pipeline);
IdePipeline *pipeline);
gchar *(*get_id) (IdeBuildSystem *self);
gchar *(*get_display_name) (IdeBuildSystem *self);
gboolean (*supports_toolchain) (IdeBuildSystem *self,
......@@ -76,7 +76,7 @@ IDE_AVAILABLE_IN_3_32
gint ide_build_system_get_priority (IdeBuildSystem *self);
IDE_AVAILABLE_IN_3_32
gchar *ide_build_system_get_builddir (IdeBuildSystem *self,
IdeBuildPipeline *pipeline);
IdePipeline *pipeline);
IDE_AVAILABLE_IN_3_32
gchar *ide_build_system_get_project_version (IdeBuildSystem *self);
IDE_AVAILABLE_IN_3_32
......
......@@ -24,14 +24,14 @@
#include "ide-debug.h"
#include "ide-build-pipeline.h"
#include "ide-pipeline.h"
#include "ide-deploy-strategy.h"
G_DEFINE_ABSTRACT_TYPE (IdeDeployStrategy, ide_deploy_strategy, IDE_TYPE_OBJECT)
static void
ide_deploy_strategy_real_load_async (IdeDeployStrategy *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
......@@ -58,7 +58,7 @@ ide_deploy_strategy_real_load_finish (IdeDeployStrategy *self,
static void
ide_deploy_strategy_real_deploy_async (IdeDeployStrategy *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
GFileProgressCallback progress,
gpointer progress_data,
GDestroyNotify progress_data_destroy,
......@@ -103,7 +103,7 @@ ide_deploy_strategy_init (IdeDeployStrategy *self)
/**
* ide_deploy_strategy_load_async:
* @self: an #IdeDeployStrategy
* @pipeline: an #IdeBuildPipeline
* @pipeline: an #IdePipeline
* @cancellable: (nullable): a #GCancellable, or %NULL
* @callback: a callback to execute upon completion
* @user_data: closure data for @callback
......@@ -123,7 +123,7 @@ ide_deploy_strategy_init (IdeDeployStrategy *self)
*/
void
ide_deploy_strategy_load_async (IdeDeployStrategy *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
......@@ -131,7 +131,7 @@ ide_deploy_strategy_load_async (IdeDeployStrategy *self,
IDE_ENTRY;
g_assert (IDE_IS_DEPLOY_STRATEGY (self));
g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (IDE_IS_PIPELINE (pipeline));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
IDE_DEPLOY_STRATEGY_GET_CLASS (self)->load_async (self, pipeline, cancellable, callback, user_data);
......@@ -172,7 +172,7 @@ ide_deploy_strategy_load_finish (IdeDeployStrategy *self,
/**
* ide_deploy_strategy_deploy_async:
* @self: a #IdeDeployStrategy
* @pipeline: an #IdeBuildPipeline
* @pipeline: an #IdePipeline
* @progress: (nullable) (closure progress_data) (scope notified):
* a #GFileProgressCallback or %NULL
* @progress_data: (nullable): closure data for @progress or %NULL
......@@ -191,7 +191,7 @@ ide_deploy_strategy_load_finish (IdeDeployStrategy *self,
*/
void
ide_deploy_strategy_deploy_async (IdeDeployStrategy *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
GFileProgressCallback progress,
gpointer progress_data,
GDestroyNotify progress_data_destroy,
......@@ -202,7 +202,7 @@ ide_deploy_strategy_deploy_async (IdeDeployStrategy *self,
IDE_ENTRY;
g_assert (IDE_IS_DEPLOY_STRATEGY (self));
g_assert (IDE_IS_BUILD_PIPELINE (pipeline));
g_assert (IDE_IS_PIPELINE (pipeline));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
IDE_DEPLOY_STRATEGY_GET_CLASS (self)->deploy_async (self,
......
......@@ -38,7 +38,7 @@ struct _IdeDeployStrategyClass
IdeObjectClass parent;
void (*load_async) (IdeDeployStrategy *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
......@@ -46,7 +46,7 @@ struct _IdeDeployStrategyClass
GAsyncResult *result,
GError **error);
void (*deploy_async) (IdeDeployStrategy *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
GFileProgressCallback progress,
gpointer progress_data,
GDestroyNotify progress_data_destroy,
......@@ -62,7 +62,7 @@ struct _IdeDeployStrategyClass
IDE_AVAILABLE_IN_3_32
void ide_deploy_strategy_load_async (IdeDeployStrategy *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
......@@ -72,7 +72,7 @@ gboolean ide_deploy_strategy_load_finish (IdeDeployStrategy *self,
GError **error);
IDE_AVAILABLE_IN_3_32
void ide_deploy_strategy_deploy_async (IdeDeployStrategy *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
GFileProgressCallback progress,
gpointer progress_data,
GDestroyNotify progress_data_destroy,
......
......@@ -28,7 +28,7 @@
#include <libpeas/peas.h>
#include "ide-build-manager.h"
#include "ide-build-pipeline.h"
#include "ide-pipeline.h"
#include "ide-deploy-strategy.h"
#include "ide-device-manager.h"
#include "ide-device-private.h"
......@@ -78,7 +78,7 @@ struct _IdeDeviceManager
typedef struct
{
IdeObjectArray *strategies;
IdeBuildPipeline *pipeline;
IdePipeline *pipeline;
} DeployState;
typedef struct
......@@ -689,7 +689,7 @@ static void
ide_device_manager_action_deploy (IdeDeviceManager *self,
GVariant *param)
{
IdeBuildPipeline *pipeline;
IdePipeline *pipeline;
IdeBuildManager *build_manager;
IdeContext *context;
......@@ -699,7 +699,7 @@ ide_device_manager_action_deploy (IdeDeviceManager *self,
build_manager = ide_build_manager_from_context (context);
pipeline = ide_build_manager_get_pipeline (build_manager);
if (!ide_build_pipeline_is_ready (pipeline))
if (!ide_pipeline_is_ready (pipeline))
ide_context_warning (context, _("Cannot deploy to device, build pipeline is not initialized"));
else
ide_device_manager_deploy_async (self, pipeline, NULL, log_deploy_error, NULL);
......@@ -797,7 +797,7 @@ ide_device_manager_deploy_load_cb (GObject *object,
g_assert (IDE_IS_DEVICE_MANAGER (self));
g_assert (state != NULL);
g_assert (state->strategies != NULL);
g_assert (IDE_IS_BUILD_PIPELINE (state->pipeline));
g_assert (IDE_IS_PIPELINE (state->pipeline));
ide_deploy_strategy_deploy_async (strategy,
state->pipeline,
......@@ -825,7 +825,7 @@ ide_device_manager_deploy_tick (IdeTask *task)
g_assert (state != NULL);
g_assert (state->strategies != NULL);
g_assert (IDE_IS_BUILD_PIPELINE (state->pipeline));
g_assert (IDE_IS_PIPELINE (state->pipeline));
if (state->strategies->len == 0)
{
......@@ -867,7 +867,7 @@ ide_device_manager_deploy_completed (IdeDeviceManager *self,
/**
* ide_device_manager_deploy_async:
* @self: a #IdeDeviceManager
* @pipeline: an #IdeBuildPipeline
* @pipeline: an #IdePipeline
* @cancellable: a #GCancellable, or %NULL
* @callback: a #GAsyncReadyCallback
* @user_data: closure data for @callback
......@@ -880,7 +880,7 @@ ide_device_manager_deploy_completed (IdeDeviceManager *self,
*/
void
ide_device_manager_deploy_async (IdeDeviceManager *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
......@@ -893,7 +893,7 @@ ide_device_manager_deploy_async (IdeDeviceManager *self,
IDE_ENTRY;
g_return_if_fail (IDE_IS_DEVICE_MANAGER (self));
g_return_if_fail (IDE_IS_BUILD_PIPELINE (pipeline));
g_return_if_fail (IDE_IS_PIPELINE (pipeline));
g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
self->progress = 0.0;
......@@ -910,7 +910,7 @@ ide_device_manager_deploy_async (IdeDeviceManager *self,
self,
G_CONNECT_SWAPPED);
if (!(device = ide_build_pipeline_get_device (pipeline)))
if (!(device = ide_pipeline_get_device (pipeline)))
{
ide_task_return_new_error (task,
G_IO_ERROR,
......
......@@ -49,7 +49,7 @@ IdeDevice *ide_device_manager_get_device_by_id (IdeDeviceManager *sel
const gchar *device_id);
IDE_AVAILABLE_IN_3_32
void ide_device_manager_deploy_async (IdeDeviceManager *self,
IdeBuildPipeline *pipeline,
IdePipeline *pipeline,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
......
......@@ -30,20 +30,14 @@ G_BEGIN_DECLS
typedef struct _IdeBuildLog IdeBuildLog;
typedef struct _IdeBuildManager IdeBuildManager;
typedef struct _IdeBuildPipeline IdeBuildPipeline;
typedef struct _IdeBuildPipelineAddin IdeBuildPipelineAddin;
typedef struct _IdeBuildStage IdeBuildStage;
typedef struct _IdeBuildStageLauncher IdeBuildStageLauncher;
typedef struct _IdeBuildStageMkdirs IdeBuildStageMkdirs;
typedef struct _IdeBuildStageTransfer IdeBuildStageTransfer;
typedef struct _IdeBuildSystem IdeBuildSystem;
typedef struct _IdeBuildSystemDiscovery IdeBuildSystemDiscovery;
typedef struct _IdeBuildTarget IdeBuildTarget;
typedef struct _IdeBuildTargetProvider IdeBuildTargetProvider;
typedef struct _IdeCompileCommands IdeCompileCommands;
typedef struct _IdeConfig IdeConfig;
typedef struct _IdeConfigProvider IdeConfigProvider;
typedef struct _IdeConfigManager IdeConfigManager;
typedef struct _IdeConfigProvider IdeConfigProvider;
typedef struct _IdeDependencyUpdater IdeDependencyUpdater;
typedef struct _IdeDeployStrategy IdeDeployStrategy;
typedef struct _IdeDevice IdeDevice;
......@@ -51,6 +45,12 @@ typedef struct _IdeDeviceInfo IdeDeviceInfo;
typedef struct _IdeDeviceManager IdeDeviceManager;
typedef struct _IdeDeviceProvider IdeDeviceProvider;
typedef struct _IdeLocalDevice IdeLocalDevice;
typedef struct _IdePipeline IdePipeline;
typedef struct _IdePipelineAddin IdePipelineAddin;
typedef struct _IdePipelineStage IdePipelineStage;
typedef struct _IdePipelineStageLauncher IdePipelineStageLauncher;
typedef struct _IdePipelineStageMkdirs IdePipelineStageMkdirs;
typedef struct _IdePipelineStageTransfer IdePipelineStageTransfer;
typedef struct _IdeRunButton IdeRunButton;
typedef struct _IdeRunManager IdeRunManager;
typedef struct _IdeRunner IdeRunner;
......@@ -60,12 +60,12 @@ typedef struct _IdeRuntimeManager IdeRuntimeManager;
typedef struct _IdeRuntimeProvider IdeRuntimeProvider;
typedef struct _IdeSimpleBuildTarget IdeSimpleBuildTarget;
typedef struct _IdeSimpleToolchain IdeSimpleToolchain;
typedef struct _IdeTriplet IdeTriplet;
typedef struct _IdeTest IdeTest;
typedef struct _IdeTestManager IdeTestManager;
typedef struct _IdeTestProvider IdeTestProvider;
typedef struct _IdeToolchain IdeToolchain;
typedef struct _IdeToolchainManager IdeToolchainManager;
typedef struct _IdeToolchainProvider IdeToolchainProvider;
typedef struct _IdeTriplet IdeTriplet;
G_END_DECLS
/* ide-build-pipeline-addin.c
/* ide-pipeline-addin.c
*
* Copyright 2016-2019 Christian Hergert <chergert@redhat.com>
*
......@@ -18,45 +18,45 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#define G_LOG_DOMAIN "ide-build-pipeline-addin"
#define G_LOG_DOMAIN "ide-pipeline-addin"
#include "config.h"
#include "ide-build-pipeline.h"
#include "ide-build-pipeline-addin.h"
#include "ide-pipeline.h"
#include "ide-pipeline-addin.h"
G_DEFINE_INTERFACE (IdeBuildPipelineAddin, ide_build_pipeline_addin, IDE_TYPE_OBJECT)
G_DEFINE_INTERFACE (IdePipelineAddin, ide_pipeline_addin, IDE_TYPE_OBJECT)
static void
ide_build_pipeline_addin_default_init (IdeBuildPipelineAddinInterface *iface)
ide_pipeline_addin_default_init (IdePipelineAddinInterface *iface)
{
}
void
ide_build_pipeline_addin_load (IdeBuildPipelineAddin *self,
IdeBuildPipeline *pipeline)
ide_pipeline_addin_load (IdePipelineAddin *self,
IdePipeline *pipeline)
{
g_return_if_fail (IDE_IS_BUILD_PIPELINE_ADDIN (self));
g_return_if_fail (IDE_IS_BUILD_PIPELINE (pipeline));
g_return_if_fail (IDE_IS_PIPELINE_ADDIN (self));
g_return_if_fail (IDE_IS_PIPELINE (pipeline));
if (IDE_BUILD_PIPELINE_ADDIN_GET_IFACE (self)->load)
IDE_BUILD_PIPELINE_ADDIN_GET_IFACE (self)->load (self, pipeline);
if (IDE_PIPELINE_ADDIN_GET_IFACE (self)->load)
IDE_PIPELINE_ADDIN_GET_IFACE (self)->load (self, pipeline);
}
void
ide_build_pipeline_addin_unload (IdeBuildPipelineAddin *self,
IdeBuildPipeline *pipeline)
ide_pipeline_addin_unload (IdePipelineAddin *self,
IdePipeline *pipeline)
{
GArray *ar;
g_return_if_fail (IDE_IS_BUILD_PIPELINE_ADDIN (self));
g_return_if_fail (IDE_IS_BUILD_PIPELINE (pipeline));
g_return_if_fail (IDE_IS_PIPELINE_ADDIN (self));
g_return_if_fail (IDE_IS_PIPELINE (pipeline));
if (IDE_BUILD_PIPELINE_ADDIN_GET_IFACE (self)->unload)
IDE_BUILD_PIPELINE_ADDIN_GET_IFACE (self)->unload (self, pipeline);
if (IDE_PIPELINE_ADDIN_GET_IFACE (self)->unload)
IDE_PIPELINE_ADDIN_GET_IFACE (self)->unload (self, pipeline);
/* Unload any stages that are tracked by the addin */
ar = g_object_get_data (G_OBJECT (self), "IDE_BUILD_PIPELINE_ADDIN_STAGES");
ar = g_object_get_data (G_OBJECT (self), "IDE_PIPELINE_ADDIN_STAGES");
if G_LIKELY (ar != NULL)
{
......@@ -64,21 +64,21 @@ ide_build_pipeline_addin_unload (IdeBuildPipelineAddin *self,
{
guint stage_id = g_array_index (ar, guint, i);
ide_build_pipeline_detach (pipeline, stage_id);
ide_pipeline_detach (pipeline, stage_id);
}
}
}
/**
* ide_build_pipeline_addin_track:
* @self: An #IdeBuildPipelineAddin
* @stage_id: a stage id returned from ide_build_pipeline_attach()
* ide_pipeline_addin_track:
* @self: An #IdePipelineAddin
* @stage_id: a stage id returned from ide_pipeline_attach()
*
* This function will track the stage_id that was returned from
* ide_build_pipeline_attach() or similar functions. Doing so results in
* ide_pipeline_attach() or similar functions. Doing so results in
* the stage being automatically disconnected when the addin is unloaded.
*
* This means that many #IdeBuildPipelineAddin implementations do not need
* This means that many #IdePipelineAddin implementations do not need
* an unload vfunc if they track all registered stages.
*
* You should not mix this function with manual pipeline disconnections.
......@@ -87,20 +87,20 @@ ide_build_pipeline_addin_unload (IdeBuildPipelineAddin *self,
* Since: 3.32
*/
void
ide_build_pipeline_addin_track (IdeBuildPipelineAddin *self,
ide_pipeline_addin_track (IdePipelineAddin *self,
guint stage_id)
{
GArray *ar;
g_return_if_fail (IDE_IS_BUILD_PIPELINE_ADDIN (self));
g_return_if_fail (IDE_IS_PIPELINE_ADDIN (self));
g_return_if_fail (stage_id > 0);
ar = g_object_get_data (G_OBJECT (self), "IDE_BUILD_PIPELINE_ADDIN_STAGES");
ar = g_object_get_data (G_OBJECT (self), "IDE_PIPELINE_ADDIN_STAGES");
if (ar == NULL)
{
ar = g_array_new (FALSE, FALSE, sizeof (guint));
g_object_set_data_full (G_OBJECT (self), "IDE_BUILD_PIPELINE_ADDIN_STAGES",
g_object_set_data_full (G_OBJECT (self), "IDE_PIPELINE_ADDIN_STAGES",
ar, (GDestroyNotify)g_array_unref);
}
......
/* ide-build-pipeline-addin.h
/* ide-pipeline-addin.h
*
* Copyright 2016-2019 Christian Hergert <chergert@redhat.com>
*
......@@ -26,33 +26,33 @@
#include <libide-core.h>
#include "ide-build-pipeline.h"
#include "ide-pipeline.h"
G_BEGIN_DECLS
#define IDE_TYPE_BUILD_PIPELINE_ADDIN (ide_build_pipeline_addin_get_type())
#define IDE_TYPE_PIPELINE_ADDIN (ide_pipeline_addin_get_type())
IDE_AVAILABLE_IN_3_32
G_DECLARE_INTERFACE (IdeBuildPipelineAddin, ide_build_pipeline_addin, IDE, BUILD_PIPELINE_ADDIN, IdeObject)
G_DECLARE_INTERFACE (IdePipelineAddin, ide_pipeline_addin, IDE, PIPELINE_ADDIN, IdeObject)
struct _IdeBuildPipelineAddinInterface
struct _IdePipelineAddinInterface
{
GTypeInterface type_interface;
void (*load) (IdeBuildPipelineAddin *self,
IdeBuildPipeline *pipeline);
void (*unload) (IdeBuildPipelineAddin *self,
IdeBuildPipeline *pipeline);
void (*load) (IdePipelineAddin *self,
IdePipeline *pipeline);
void (*unload) (IdePipelineAddin *self,
IdePipeline *pipeline);
};
IDE_AVAILABLE_IN_3_32
void ide_build_pipeline_addin_load (IdeBuildPipelineAddin *self,
IdeBuildPipeline *pipeline);
void ide_pipeline_addin_load (IdePipelineAddin *self,
IdePipeline *pipeline);
IDE_AVAILABLE_IN_3_32
void ide_build_pipeline_addin_unload (IdeBuildPipelineAddin *self,
IdeBuildPipeline *pipeline);
void ide_pipeline_addin_unload (IdePipelineAddin *self,
IdePipeline *pipeline);
IDE_AVAILABLE_IN_3_32
void ide_build_pipeline_addin_track (IdeBuildPipelineAddin *self,
void ide_pipeline_addin_track (IdePipelineAddin *self,
guint stage_id);
G_END_DECLS
/* ide-build-stage-launcher.h
/* ide-pipeline-stage-launcher.h
*
* Copyright 2016-2019 Christian Hergert <chergert@redhat.com>
*
......@@ -27,45 +27,45 @@
#include <libide-core.h>
#include <libide-threading.h>
#include "ide-build-stage.h"
#include "ide-pipeline-stage.h"
G_BEGIN_DECLS
#define IDE_TYPE_BUILD_STAGE_LAUNCHER (ide_build_stage_launcher_get_type())
#define IDE_TYPE_PIPELINE_STAGE_LAUNCHER (ide_pipeline_stage_launcher_get_type())
IDE_AVAILABLE_IN_3_32
G_DECLARE_DERIVABLE_TYPE (IdeBuildStageLauncher, ide_build_stage_launcher, IDE, BUILD_STAGE_LAUNCHER, IdeBuildStage)
G_DECLARE_DERIVABLE_TYPE (IdePipelineStageLauncher, ide_pipeline_stage_launcher, IDE, PIPELINE_STAGE_LAUNCHER, IdePipelineStage)
struct _IdeBuildStageLauncherClass
struct _IdePipelineStageLauncherClass
{
IdeBuildStageClass parent_class</