[gnome-builder/gnome-builder-41] flatpak: set cargo buildsystem
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-41] flatpak: set cargo buildsystem
- Date: Mon, 4 Oct 2021 18:23:24 +0000 (UTC)
commit c4db5cd181ae29ba07fe3dd47ebbd0667d25080b
Author: Günther Wagner <info gunibert de>
Date: Sun Oct 3 18:27:09 2021 +0200
flatpak: set cargo buildsystem
In case the rust-stable sdk extension is set and we didn't found a fitting buildsystem besides the
generic 'directory' we set the cargo buildsystem in order to allow language server features kick in.
.../flatpak/gbp-flatpak-build-system-discovery.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-build-system-discovery.c
b/src/plugins/flatpak/gbp-flatpak-build-system-discovery.c
index a94328c25..4308f9aaf 100644
--- a/src/plugins/flatpak/gbp-flatpak-build-system-discovery.c
+++ b/src/plugins/flatpak/gbp-flatpak-build-system-discovery.c
@@ -205,7 +205,25 @@ gbp_flatpak_build_system_discovery_discover (IdeBuildSystemDiscovery *discovery
if (dzl_str_equal0 (buildsystem, "cmake-ninja"))
buildsystem = "cmake";
else if (dzl_str_equal0 (buildsystem, "simple"))
- buildsystem = "directory";
+ {
+ JsonNode *sdk_extensions;
+ JsonArray *sdk_extensions_array;
+
+ buildsystem = "directory";
+
+ /* Check for a cargo project */
+ sdk_extensions = json_object_get_member (root_object, "sdk-extensions");
+ sdk_extensions_array = json_node_get_array (sdk_extensions);
+ len = json_array_get_length (sdk_extensions_array);
+ for (guint j = 0; j < len; j++)
+ {
+ const gchar *extension;
+ extension = json_array_get_string_element (sdk_extensions_array, j);
+ if (ide_str_equal0 (extension, "org.freedesktop.Sdk.Extension.rust-stable") ||
+ ide_str_equal0 (extension, "org.freedesktop.Sdk.Extension.rust-nightly"))
+ buildsystem = "cargo_plugin";
+ }
+ }
/* Set priority higher than normal discoveries */
if (priority != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]