[gnome-builder] build-stage: stash pipeline phase in stage
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] build-stage: stash pipeline phase in stage
- Date: Tue, 19 Dec 2017 04:04:30 +0000 (UTC)
commit c0ef6361f843c856e1179cbd9ee3b0e3e3faf41c
Author: Christian Hergert <chergert redhat com>
Date: Mon Dec 18 20:00:32 2017 -0800
build-stage: stash pipeline phase in stage
This is useful for internal components that want to know the placement of
the stage in the pipeline. Technically, you could add the stage multiple
times, but we don't really support that in any other way.
src/libide/buildsystem/ide-build-pipeline.c | 2 ++
src/libide/buildsystem/ide-build-stage-private.h | 21 ++++++++++++---------
src/libide/buildsystem/ide-build-stage.c | 22 ++++++++++++++++++++++
3 files changed, 36 insertions(+), 9 deletions(-)
---
diff --git a/src/libide/buildsystem/ide-build-pipeline.c b/src/libide/buildsystem/ide-build-pipeline.c
index 0e97937..25f8085 100644
--- a/src/libide/buildsystem/ide-build-pipeline.c
+++ b/src/libide/buildsystem/ide-build-pipeline.c
@@ -1908,6 +1908,8 @@ ide_build_pipeline_connect (IdeBuildPipeline *self,
{
PipelineEntry entry = { 0 };
+ _ide_build_stage_set_phase (stage, phase);
+
IDE_TRACE_MSG ("Adding stage to pipeline with phase %s and priority %d",
value->value_nick, priority);
diff --git a/src/libide/buildsystem/ide-build-stage-private.h
b/src/libide/buildsystem/ide-build-stage-private.h
index f173ca5..a82793a 100644
--- a/src/libide/buildsystem/ide-build-stage-private.h
+++ b/src/libide/buildsystem/ide-build-stage-private.h
@@ -23,14 +23,17 @@
G_BEGIN_DECLS
-gboolean _ide_build_stage_has_query (IdeBuildStage *self);
-void _ide_build_stage_execute_with_query_async (IdeBuildStage *self,
- IdeBuildPipeline *pipeline,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-gboolean _ide_build_stage_execute_with_query_finish (IdeBuildStage *self,
- GAsyncResult *result,
- GError **error);
+gboolean _ide_build_stage_has_query (IdeBuildStage *self);
+IdeBuildPhase _ide_build_stage_get_phase (IdeBuildStage *self);
+void _ide_build_stage_set_phase (IdeBuildStage *self,
+ IdeBuildPhase phase);
+void _ide_build_stage_execute_with_query_async (IdeBuildStage *self,
+ IdeBuildPipeline *pipeline,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean _ide_build_stage_execute_with_query_finish (IdeBuildStage *self,
+ GAsyncResult *result,
+ GError **error);
G_END_DECLS
diff --git a/src/libide/buildsystem/ide-build-stage.c b/src/libide/buildsystem/ide-build-stage.c
index ec47569..e8799f1 100644
--- a/src/libide/buildsystem/ide-build-stage.c
+++ b/src/libide/buildsystem/ide-build-stage.c
@@ -36,6 +36,7 @@ typedef struct
gchar *stdout_path;
GOutputStream *stdout_stream;
gint n_pause;
+ IdeBuildPhase phase;
guint completed : 1;
guint disabled : 1;
guint transient : 1;
@@ -1118,3 +1119,24 @@ ide_build_stage_set_active (IdeBuildStage *self,
ide_object_notify_in_main (IDE_OBJECT (self), properties [PROP_ACTIVE]);
}
}
+
+IdeBuildPhase
+_ide_build_stage_get_phase (IdeBuildStage *self)
+{
+ IdeBuildStagePrivate *priv = ide_build_stage_get_instance_private (self);
+
+ g_return_val_if_fail (IDE_IS_BUILD_STAGE (self), 0);
+
+ return priv->phase;
+}
+
+void
+_ide_build_stage_set_phase (IdeBuildStage *self,
+ IdeBuildPhase phase)
+{
+ IdeBuildStagePrivate *priv = ide_build_stage_get_instance_private (self);
+
+ g_return_if_fail (IDE_IS_BUILD_STAGE (self));
+
+ priv->phase = phase;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]