Top | ![]() |
![]() |
![]() |
![]() |
gboolean | busy | Read / Write |
IdeConfiguration * | configuration | Read / Write / Construct Only |
IdeDevice * | device | Read / Write / Construct Only |
gchar * | message | Read |
IdeBuildPhase | phase | Read |
VtePty * | pty | Read |
#define | IDE_TYPE_BUILD_PIPELINE |
#define | IDE_BUILD_PHASE_MASK |
#define | IDE_BUILD_PHASE_WHENCE_MASK |
enum | IdeBuildPhase |
IdeBuildPipeline |
gboolean
ide_build_pipeline_is_native (IdeBuildPipeline *self
);
This is a helper to check if the triplet that we are compiling for matches the host system. That allows some plugins to do less work by avoiding some cross-compiling work.
Since: 3.30
gboolean
ide_build_pipeline_is_ready (IdeBuildPipeline *self
);
Checks to see if the pipeline has been loaded. Loading may be delayed due to various initialization routines that need to complete.
Since: 3.28
IdeConfiguration *
ide_build_pipeline_get_configuration (IdeBuildPipeline *self
);
Gets the IdeConfiguration to use for the pipeline.
IdeDevice *
ide_build_pipeline_get_device (IdeBuildPipeline *self
);
Gets the device that the pipeline is building for.
Since: 3.28
IdeTriplet *
ide_build_pipeline_get_host_triplet (IdeBuildPipeline *self
);
Gets the "host" triplet which specifies where the build results will run.
This is a convenience wrapper around getting the triplet from the device set for the build pipeline.
Since: 3.30
IdeRuntime *
ide_build_pipeline_get_runtime (IdeBuildPipeline *self
);
A convenience function to get the runtime for a build pipeline.
Since: 3.28
IdeToolchain *
ide_build_pipeline_get_toolchain (IdeBuildPipeline *self
);
A convenience function to get the toolchain for a build pipeline.
Since: 3.30
const gchar *
ide_build_pipeline_get_builddir (IdeBuildPipeline *self
);
Gets the "builddir" to be used for the build process. This is generally the location that build systems will use for out-of-tree builds.
const gchar *
ide_build_pipeline_get_srcdir (IdeBuildPipeline *self
);
Gets the "srcdir" of the project. This is equivalent to the IdeVcs:working-directory property as a string.
gchar *
ide_build_pipeline_get_message (IdeBuildPipeline *self
);
Gets the current message for the build pipeline. This can be shown to users in UI elements to signify progress in the build.
IdeBuildPhase
ide_build_pipeline_get_phase (IdeBuildPipeline *self
);
Gets the current phase that is executing. This is only useful during execution of the pipeline.
gboolean
ide_build_pipeline_get_can_export (IdeBuildPipeline *self
);
This function is useful to discover if there are any pipeline addins which implement the export phase. UI or GAction implementations may want to use this value to set the enabled state of the action or sensitivity of a button.
VtePty *
ide_build_pipeline_get_pty (IdeBuildPipeline *self
);
Gets the VtePty for the pipeline, if set.
This will not be set until the pipeline has been initialized. That is not guaranteed to happen at object creation time.
Since: 3.28
IdeSubprocessLauncher * ide_build_pipeline_create_launcher (IdeBuildPipeline *self
,GError **error
);
This is a convenience function to create a new IdeSubprocessLauncher using the configuration and runtime associated with the pipeline.
gchar * ide_build_pipeline_build_srcdir_path (IdeBuildPipeline *self
,const gchar *first_part
,...
);
This is a convenience function to create a new path that starts with the source directory of the project.
This is functionally equivalent to calling g_build_filename()
with the
working directory of the source tree.
gchar * ide_build_pipeline_build_builddir_path (IdeBuildPipeline *self
,const gchar *first_part
,...
);
This is a convenience function to create a new path that starts with the build directory for this build configuration.
This is functionally equivalent to calling g_build_filename()
with the
result of ide_build_pipeline_get_builddir()
as the first parameter.
void ide_build_pipeline_invalidate_phase (IdeBuildPipeline *self
,IdeBuildPhase phases
);
Invalidates the phases matching phases
flags.
If the requested phases include the phases invalidated here, the next execution of the pipeline will execute thse phases.
This should be used by plugins to ensure a particular phase is re-executed
upon discovering its state is no longer valid. Such an example might be
invalidating the IDE_BUILD_PHASE_AUTOGEN
phase when the an autotools
projects autogen.sh file has been changed.
gboolean ide_build_pipeline_request_phase (IdeBuildPipeline *self
,IdeBuildPhase phase
);
Requests that the next execution of the pipeline will build up to phase
including all stages that were previously invalidated.
guint ide_build_pipeline_connect (IdeBuildPipeline *self
,IdeBuildPhase phase
,gint priority
,IdeBuildStage *stage
);
Insert stage
into the pipeline as part of the phase denoted by phase
.
If priority is non-zero, it will be used to sort the stage among other stages that are part of the same phase.
guint ide_build_pipeline_connect_launcher (IdeBuildPipeline *self
,IdeBuildPhase phase
,gint priority
,IdeSubprocessLauncher *launcher
);
This creates a new stage that will spawn a process using launcher
and log
the output of stdin/stdout.
It is a programmer error to modify launcher
after passing it to this
function.
void ide_build_pipeline_disconnect (IdeBuildPipeline *self
,guint stage_id
);
This removes the stage matching stage_id
. You are returned a stage_id
when
inserting a stage with functions such as ide_build_pipeline_connect()
or ide_build_pipeline_connect_launcher()
.
Plugins should use this function to remove their stages when the plugin is unloading.
IdeBuildStage * ide_build_pipeline_get_stage_by_id (IdeBuildPipeline *self
,guint stage_id
);
Gets the stage matching the identifier stage_id
as returned from
ide_build_pipeline_connect()
.
guint ide_build_pipeline_add_log_observer (IdeBuildPipeline *self
,IdeBuildLogObserver observer
,gpointer observer_data
,GDestroyNotify observer_data_destroy
);
gboolean ide_build_pipeline_remove_log_observer (IdeBuildPipeline *self
,guint observer_id
);
void ide_build_pipeline_emit_diagnostic (IdeBuildPipeline *self
,IdeDiagnostic *diagnostic
);
guint ide_build_pipeline_add_error_format (IdeBuildPipeline *self
,const gchar *regex
,GRegexCompileFlags flags
);
This can be used to add a regex that will extract errors from standard output. This is similar to the "errorformat" feature of vim to extract warnings from standard output.
The regex should used named capture groups to pass information to the extraction process.
Supported group names are:
• filename (a string path) • line (an integer) • column (an integer) • level (a string) • message (a string)
For example, to extract warnings from GCC you might do something like the following:
"(?<filename>[a-zA-Z0-9\-\.\/_]+):" "(?<line>\d+):" "(?<column>\d+): " "(?<level>[\w\s]+): " "(?<message>.*)"
To remove the regex, use the ide_build_pipeline_remove_error_format()
function with the resulting format id returned from this function.
The resulting format id will be > 0 if successful.
gboolean ide_build_pipeline_remove_error_format (IdeBuildPipeline *self
,guint error_format_id
);
Removes an error format that was registered with
ide_build_pipeline_add_error_format()
.
void ide_build_pipeline_build_async (IdeBuildPipeline *self
,IdeBuildPhase phase
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously starts the build pipeline.
The phase
parameter should contain the IdeBuildPhase that is
necessary to complete. If you simply want to trigger a generic
build, you probably want IDE_BUILD_PHASE_BUILD
. If you only
need to configure the project (and necessarily the dependencies
up to that phase) you might want IDE_BUILD_PHASE_CONFIGURE
.
You may not specify IDE_BUILD_PHASE_AFTER
or
IDE_BUILD_PHASE_BEFORE
flags as those must always be processed
with the underlying phase they are attached to.
Upon completion, callback
will be executed and should call
ide_build_pipeline_execute_finish()
to get the status of the
operation.
self |
A |
|
phase |
the requested build phase |
|
cancellable |
a GCancellable or |
[nullable] |
callback |
a callback to execute upon completion |
|
user_data |
data for |
Since: 3.28
gboolean ide_build_pipeline_build_finish (IdeBuildPipeline *self
,GAsyncResult *result
,GError **error
);
This function completes the asynchronous request to build up to a particular phase of the build pipeline.
TRUE
if the build stages were executed successfully
up to the requested build phase provided to
ide_build_pipeline_build_async()
.
Since: 3.28
void ide_build_pipeline_execute_async (IdeBuildPipeline *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously starts the build pipeline.
Any phase that has been invalidated up to the requested phase will be executed until a stage has failed.
Upon completion, callback
will be executed and should call
ide_build_pipeline_execute_finish()
to get the status of the
operation.
self |
A |
|
cancellable |
a GCancellable or |
[nullable] |
callback |
a callback to execute upon completion |
|
user_data |
data for |
Since: 3.24
gboolean ide_build_pipeline_execute_finish (IdeBuildPipeline *self
,GAsyncResult *result
,GError **error
);
void ide_build_pipeline_foreach_stage (IdeBuildPipeline *self
,GFunc stage_callback
,gpointer user_data
);
This function will call stage_callback
for every IdeBuildStage registered
in the pipeline.
void ide_build_pipeline_clean_async (IdeBuildPipeline *self
,IdeBuildPhase phase
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean ide_build_pipeline_clean_finish (IdeBuildPipeline *self
,GAsyncResult *result
,GError **error
);
void ide_build_pipeline_rebuild_async (IdeBuildPipeline *self
,IdeBuildPhase phase
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean ide_build_pipeline_rebuild_finish (IdeBuildPipeline *self
,GAsyncResult *result
,GError **error
);
void ide_build_pipeline_attach_pty (IdeBuildPipeline *self
,IdeSubprocessLauncher *launcher
);
Attaches a PTY to stdin/stdout/stderr of the IdeSubprocessLauncher. This is useful if the application can take advantage of a PTY for features like colors and other escape sequences.
Since: 3.28
gboolean
ide_build_pipeline_has_configured (IdeBuildPipeline *self
);
Checks to see if the pipeline has advanced far enough to ensure that the configure stage has been reached.
Since: 3.28
IdeBuildPhase
ide_build_pipeline_get_requested_phase
(IdeBuildPipeline *self
);
Gets the phase that has been requested. This can be useful when you want to get an idea of where the build pipeline will attempt to advance.
Since: 3.28
#define IDE_BUILD_PHASE_WHENCE_MASK (IDE_BUILD_PHASE_BEFORE | IDE_BUILD_PHASE_AFTER)
“busy”
property “busy” gboolean
Gets the "busy" property. If TRUE
, the pipeline is busy executing.
Flags: Read / Write
Default value: FALSE
“configuration”
property“configuration” IdeConfiguration *
The configuration to use for the build pipeline.
Flags: Read / Write / Construct Only
“device”
property“device” IdeDevice *
The "device" property is the device we are compiling for.
Flags: Read / Write / Construct Only
Since: 3.28
“message”
property “message” gchar *
The "message" property is descriptive text about what the the pipeline is doing or it's readiness status.
Flags: Read
Default value: NULL
Since: 3.28
“phase”
property“phase” IdeBuildPhase
The current build phase during execution of the pipeline.
Flags: Read
“diagnostic”
signalvoid user_function (IdeBuildPipeline *self, IdeDiagnostic *diagnostic, gpointer user_data)
This signal is emitted when a plugin has detected a diagnostic while building the pipeline.
self |
||
diagnostic |
The newly created diagnostic |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“finished”
signalvoid user_function (IdeBuildPipeline *self, gboolean failed, gpointer user_data)
This signal is emitted when the build process has finished executing.
If the build failed to complete all requested stages, then failed
will
be set to TRUE
, otherwise FALSE
.
self |
||
failed |
If the build was a failure |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“started”
signalvoid user_function (IdeBuildPipeline *self, IdeBuildPhase phase, gpointer user_data)
This signal is emitted when the pipeline has started executing in
response to ide_build_pipeline_execute_async()
being called.
self |
||
phase |
the IdeBuildPhase for which we are advancing |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last