[gnome-builder] foundry: add API to get project version
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] foundry: add API to get project version
- Date: Fri, 11 Jan 2019 20:45:01 +0000 (UTC)
commit 098536493c5eb76bd3020d44b07adeea44ab724c
Author: Christian Hergert <chergert redhat com>
Date: Fri Jan 11 12:36:03 2019 -0800
foundry: add API to get project version
src/libide/foundry/ide-build-system.c | 23 +++++++++++++++++++++++
src/libide/foundry/ide-build-system.h | 3 +++
2 files changed, 26 insertions(+)
---
diff --git a/src/libide/foundry/ide-build-system.c b/src/libide/foundry/ide-build-system.c
index 831b43f7b..940faba2e 100644
--- a/src/libide/foundry/ide-build-system.c
+++ b/src/libide/foundry/ide-build-system.c
@@ -672,3 +672,26 @@ ide_build_system_supports_toolchain (IdeBuildSystem *self,
return FALSE;
}
+
+/**
+ * ide_build_system_get_project_version:
+ * @self: a #IdeBuildSystem
+ *
+ * If the build system supports it, gets the project version as configured
+ * in the build system's configuration files.
+ *
+ * Returns: (transfer full) (nullable): a string containing the project version
+ *
+ * Since: 3.32
+ */
+gchar *
+ide_build_system_get_project_version (IdeBuildSystem *self)
+{
+ g_return_val_if_fail (IDE_IS_MAIN_THREAD (), NULL);
+ g_return_val_if_fail (IDE_IS_BUILD_SYSTEM (self), NULL);
+
+ if (IDE_BUILD_SYSTEM_GET_IFACE (self)->get_project_version)
+ return IDE_BUILD_SYSTEM_GET_IFACE (self)->get_project_version (self);
+
+ return NULL;
+}
diff --git a/src/libide/foundry/ide-build-system.h b/src/libide/foundry/ide-build-system.h
index 271aee267..4b4d6e8c3 100644
--- a/src/libide/foundry/ide-build-system.h
+++ b/src/libide/foundry/ide-build-system.h
@@ -63,6 +63,7 @@ struct _IdeBuildSystemInterface
gchar *(*get_display_name) (IdeBuildSystem *self);
gboolean (*supports_toolchain) (IdeBuildSystem *self,
IdeToolchain *toolchain);
+ gchar *(*get_project_version) (IdeBuildSystem *self);
};
IDE_AVAILABLE_IN_3_32
@@ -77,6 +78,8 @@ IDE_AVAILABLE_IN_3_32
gchar *ide_build_system_get_builddir (IdeBuildSystem *self,
IdeBuildPipeline *pipeline);
IDE_AVAILABLE_IN_3_32
+gchar *ide_build_system_get_project_version (IdeBuildSystem *self);
+IDE_AVAILABLE_IN_3_32
void ide_build_system_get_build_flags_async (IdeBuildSystem *self,
GFile *file,
GCancellable *cancellable,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]