[gnome-builder: 82/139] gcc: port to libide-foundry



commit 78c82b8264ec293c971d01057298850234f1d770
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 9 17:20:52 2019 -0800

    gcc: port to libide-foundry

 src/plugins/gcc/gbp-gcc-pipeline-addin.c           |  4 ++++
 src/plugins/gcc/gbp-gcc-pipeline-addin.h           |  2 +-
 src/plugins/gcc/gbp-gcc-toolchain-provider.c       |  5 ++---
 src/plugins/gcc/gbp-gcc-toolchain-provider.h       |  2 +-
 src/plugins/gcc/{gbp-gcc-plugin.c => gcc-plugin.c} | 16 ++++++++++-----
 src/plugins/gcc/gcc.gresource.xml                  |  2 +-
 src/plugins/gcc/gcc.plugin                         | 11 ++++++-----
 src/plugins/gcc/meson.build                        | 23 +++++++++-------------
 8 files changed, 35 insertions(+), 30 deletions(-)
---
diff --git a/src/plugins/gcc/gbp-gcc-pipeline-addin.c b/src/plugins/gcc/gbp-gcc-pipeline-addin.c
index 4f4cfc4bd..65766f0d3 100644
--- a/src/plugins/gcc/gbp-gcc-pipeline-addin.c
+++ b/src/plugins/gcc/gbp-gcc-pipeline-addin.c
@@ -20,6 +20,10 @@
 
 #define G_LOG_DOMAIN "gbp-gcc-pipeline-addin"
 
+#include "config.h"
+
+#include "libide-foundry.h"
+
 #include "gbp-gcc-pipeline-addin.h"
 
 #define ERROR_FORMAT_REGEX                  \
diff --git a/src/plugins/gcc/gbp-gcc-pipeline-addin.h b/src/plugins/gcc/gbp-gcc-pipeline-addin.h
index be25db1f7..f54189204 100644
--- a/src/plugins/gcc/gbp-gcc-pipeline-addin.h
+++ b/src/plugins/gcc/gbp-gcc-pipeline-addin.h
@@ -20,7 +20,7 @@
 
 #pragma once
 
-#include <ide.h>
+#include <libide-core.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/plugins/gcc/gbp-gcc-toolchain-provider.c b/src/plugins/gcc/gbp-gcc-toolchain-provider.c
index 9be84b56c..564245c75 100644
--- a/src/plugins/gcc/gbp-gcc-toolchain-provider.c
+++ b/src/plugins/gcc/gbp-gcc-toolchain-provider.c
@@ -23,6 +23,7 @@
 #define G_LOG_DOMAIN "gbp-gcc-toolchain-provider"
 
 #include <glib/gi18n.h>
+#include <libide-foundry.h>
 
 #include "gbp-gcc-toolchain-provider.h"
 
@@ -82,13 +83,11 @@ gbp_gcc_toolchain_provider_get_toolchain_from_file (GbpGccToolchainProvider *sel
   g_autofree gchar *sdk_ld_path = NULL;
   g_autofree gchar *sdk_strip_path = NULL;
   g_autofree gchar *sdk_pkg_config_path = NULL;
-  IdeContext *context;
 
   gcc_path = g_file_get_path (file);
   toolchain_id = g_strdup_printf ("gcc:%s", gcc_path);
   display_name = g_strdup_printf (_("GCC %s Cross-Compiler (System)"), arch);
-  context = ide_object_get_context (IDE_OBJECT (self));
-  toolchain = ide_simple_toolchain_new (context, toolchain_id, display_name);
+  toolchain = ide_simple_toolchain_new (toolchain_id, display_name);
   ide_toolchain_set_host_triplet (IDE_TOOLCHAIN (toolchain), triplet);
   ide_simple_toolchain_set_tool_for_language (toolchain, IDE_TOOLCHAIN_LANGUAGE_C, IDE_TOOLCHAIN_TOOL_CC, 
gcc_path);
 
diff --git a/src/plugins/gcc/gbp-gcc-toolchain-provider.h b/src/plugins/gcc/gbp-gcc-toolchain-provider.h
index 2d7718a42..c3c350811 100644
--- a/src/plugins/gcc/gbp-gcc-toolchain-provider.h
+++ b/src/plugins/gcc/gbp-gcc-toolchain-provider.h
@@ -22,7 +22,7 @@
 
 #pragma once
 
-#include <ide.h>
+#include <libide-core.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/plugins/gcc/gbp-gcc-plugin.c b/src/plugins/gcc/gcc-plugin.c
similarity index 62%
rename from src/plugins/gcc/gbp-gcc-plugin.c
rename to src/plugins/gcc/gcc-plugin.c
index f83c4556a..87deae432 100644
--- a/src/plugins/gcc/gbp-gcc-plugin.c
+++ b/src/plugins/gcc/gcc-plugin.c
@@ -18,15 +18,21 @@
  * SPDX-License-Identifier: GPL-3.0-or-later
  */
 
-#include <ide.h>
+#include "config.h"
+
+#include <libide-foundry.h>
 #include <libpeas/peas.h>
 
 #include "gbp-gcc-pipeline-addin.h"
 #include "gbp-gcc-toolchain-provider.h"
 
-void
-gbp_gcc_register_types (PeasObjectModule *module)
+_IDE_EXTERN void
+_gbp_gcc_register_types (PeasObjectModule *module)
 {
-  peas_object_module_register_extension_type (module, IDE_TYPE_BUILD_PIPELINE_ADDIN, 
GBP_TYPE_GCC_PIPELINE_ADDIN);
-  peas_object_module_register_extension_type (module, IDE_TYPE_TOOLCHAIN_PROVIDER, 
GBP_TYPE_GCC_TOOLCHAIN_PROVIDER);
+  peas_object_module_register_extension_type (module,
+                                              IDE_TYPE_BUILD_PIPELINE_ADDIN,
+                                              GBP_TYPE_GCC_PIPELINE_ADDIN);
+  peas_object_module_register_extension_type (module,
+                                              IDE_TYPE_TOOLCHAIN_PROVIDER,
+                                              GBP_TYPE_GCC_TOOLCHAIN_PROVIDER);
 }
diff --git a/src/plugins/gcc/gcc.gresource.xml b/src/plugins/gcc/gcc.gresource.xml
index f9b9c6007..238baef47 100644
--- a/src/plugins/gcc/gcc.gresource.xml
+++ b/src/plugins/gcc/gcc.gresource.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
-  <gresource prefix="/org/gnome/builder/plugins">
+  <gresource prefix="/plugins/gcc">
     <file>gcc.plugin</file>
   </gresource>
 </gresources>
diff --git a/src/plugins/gcc/gcc.plugin b/src/plugins/gcc/gcc.plugin
index e6b8fea5e..4bc7068ad 100644
--- a/src/plugins/gcc/gcc.plugin
+++ b/src/plugins/gcc/gcc.plugin
@@ -1,8 +1,9 @@
 [Plugin]
-Module=gcc-plugin
-Name=GCC
-Description=Provides various GCC integration hooks
 Authors=Christian Hergert <christian hergert me>
-Copyright=Copyright © 2015 Christian Hergert
-Embedded=gbp_gcc_register_types
 Builtin=true
+Copyright=Copyright © 2015-2018 Christian Hergert
+Description=Provides various GCC integration hooks
+Embedded=_gbp_gcc_register_types
+Hidden=true
+Module=gcc
+Name=GCC
diff --git a/src/plugins/gcc/meson.build b/src/plugins/gcc/meson.build
index 4127bde80..932bcdc92 100644
--- a/src/plugins/gcc/meson.build
+++ b/src/plugins/gcc/meson.build
@@ -1,20 +1,15 @@
-if get_option('with_gcc')
-
-gcc_resources = gnome.compile_resources(
-  'gcc-resources',
-  'gcc.gresource.xml',
-  c_name: 'gbp_gcc',
-)
-
-gcc_sources = [
+plugins_sources += files([
   'gbp-gcc-pipeline-addin.c',
   'gbp-gcc-pipeline-addin.h',
-  'gbp-gcc-plugin.c',
   'gbp-gcc-toolchain-provider.c',
   'gbp-gcc-toolchain-provider.h',
-]
+  'gcc-plugin.c',
+])
 
-gnome_builder_plugins_sources += files(gcc_sources)
-gnome_builder_plugins_sources += gcc_resources[0]
+plugin_gcc_resources = gnome.compile_resources(
+  'gcc-resources',
+  'gcc.gresource.xml',
+  c_name: 'gbp_gcc',
+)
 
-endif
+plugins_sources += plugin_gcc_resources[0]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]