[gnome-builder] mono: add simple mono plugin
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] mono: add simple mono plugin
- Date: Sun, 12 Mar 2017 01:59:35 +0000 (UTC)
commit 60959dc931847675112915f4b6f464b20c48e21f
Author: Christian Hergert <chergert redhat com>
Date: Sat Mar 11 17:54:17 2017 -0800
mono: add simple mono plugin
This just adds an error regex to extract build warnings when
projects are compiled with gmcs/mcs.
configure.ac | 2 ++
meson_options.txt | 1 +
plugins/Makefile.am | 3 ++-
plugins/meson.build | 1 +
plugins/mono/Makefile.am | 14 ++++++++++++++
plugins/mono/configure.ac | 12 ++++++++++++
plugins/mono/meson.build | 6 ++++++
plugins/mono/mono.plugin | 9 +++++++++
plugins/mono/mono_plugin.py | 20 ++++++++++++++++++++
9 files changed, 67 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ef5c100..e446f9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -314,6 +314,7 @@ m4_include([plugins/make/configure.ac])
m4_include([plugins/meson/configure.ac])
m4_include([plugins/meson-templates/configure.ac])
m4_include([plugins/mingw/configure.ac])
+m4_include([plugins/mono/configure.ac])
m4_include([plugins/project-tree/configure.ac])
m4_include([plugins/python-gi-imports-completion/configure.ac])
m4_include([plugins/python-pack/configure.ac])
@@ -596,6 +597,7 @@ echo " JHBuild .............................. : ${enable_jhbuild_plugin}"
echo " Make ................................. : ${enable_make_plugin}"
echo " Meson ................................ : ${enable_meson_plugin}"
echo " MinGW ................................ : ${enable_mingw_plugin}"
+echo " Mono ................................. : ${enable_mono_plugin}"
echo " Project Creation ..................... : ${enable_create_project_plugin}"
echo " Project Tree ......................... : ${enable_project_tree_plugin}"
echo " Python GObject Introspection ......... : ${enable_python_gi_imports_completion_plugin}"
diff --git a/meson_options.txt b/meson_options.txt
index ed9f8e7..8a0ab03 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -45,6 +45,7 @@ option('with_make', type: 'boolean')
option('with_meson', type: 'boolean')
option('with_meson_templates', type: 'boolean', value: false)
option('with_mingw', type: 'boolean')
+option('with_mono', type: 'boolean')
option('with_project_tree', type: 'boolean')
option('with_python_gi_imports_completion', type: 'boolean')
option('with_python_pack', type: 'boolean')
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 49a1cfe..40961e2 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -25,9 +25,10 @@ SUBDIRS = \
jedi \
jhbuild \
make \
- mingw \
meson \
meson-templates \
+ mingw \
+ mono \
project-tree \
python-gi-imports-completion \
python-pack \
diff --git a/plugins/meson.build b/plugins/meson.build
index a9f1f33..a40f799 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -39,6 +39,7 @@ subdir('make')
subdir('meson')
subdir('meson-templates')
subdir('mingw')
+subdir('mono')
subdir('project-tree')
subdir('python-gi-imports-completion')
subdir('python-pack')
diff --git a/plugins/mono/Makefile.am b/plugins/mono/Makefile.am
new file mode 100644
index 0000000..d4fc70f
--- /dev/null
+++ b/plugins/mono/Makefile.am
@@ -0,0 +1,14 @@
+if ENABLE_MONO_PLUGIN
+
+EXTRA_DIST = $(plugin_DATA)
+
+plugindir = $(libdir)/gnome-builder/plugins
+dist_plugin_DATA = mono.plugin
+
+moduledir = $(libdir)/gnome-builder/plugins
+dist_module_DATA = mono_plugin.py
+
+endif
+
+-include $(top_srcdir)/git.mk
+
diff --git a/plugins/mono/configure.ac b/plugins/mono/configure.ac
new file mode 100644
index 0000000..42d4531
--- /dev/null
+++ b/plugins/mono/configure.ac
@@ -0,0 +1,12 @@
+# --enable-mono-plugin=yes/no
+AC_ARG_ENABLE([mono-plugin],
+ [AS_HELP_STRING([--enable-mono-plugin=@<:@yes/no@:>@],
+ [Build with support for mono])],
+ [enable_mono_plugin=$enableval],
+ [enable_mono_plugin=yes])
+
+# for if ENABLE_MONO_PLUGIN in Makefile.am
+AM_CONDITIONAL(ENABLE_MONO_PLUGIN, test x$enable_mono_plugin = xyes)
+
+# Ensure our makefile is generated by autoconf
+AC_CONFIG_FILES([plugins/mono/Makefile])
diff --git a/plugins/mono/meson.build b/plugins/mono/meson.build
new file mode 100644
index 0000000..bd52554
--- /dev/null
+++ b/plugins/mono/meson.build
@@ -0,0 +1,6 @@
+if get_option('with_mono')
+
+install_data('mono.plugin', install_dir: plugindir)
+install_data('mono_plugin.py', install_dir: plugindir)
+
+endif
diff --git a/plugins/mono/mono.plugin b/plugins/mono/mono.plugin
new file mode 100644
index 0000000..b14d6d7
--- /dev/null
+++ b/plugins/mono/mono.plugin
@@ -0,0 +1,9 @@
+[Plugin]
+Module=mono_plugin
+Loader=python3
+Name=Mono
+Description=Provides integration with Mono
+Authors=Christian Hergert <chergert redhat com>
+Copyright=Copyright © 2017 Christian Hergert
+Builtin=true
+Hidden=false
diff --git a/plugins/mono/mono_plugin.py b/plugins/mono/mono_plugin.py
new file mode 100644
index 0000000..d05db62
--- /dev/null
+++ b/plugins/mono/mono_plugin.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+
+import gi
+
+from gi.repository import Ide
+from gi.repository import GLib
+
+_ERROR_REGEX = ("(?<filename>[a-zA-Z0-9\\-\\.\\/]+.cs)" +
+ "\\((?<line>\\d+),(?<column>\\d+)\\): " +
+ "(?<level>[\\w\\s]+) " +
+ "(?<code>CS[0-9]+): " +
+ "(?<message>.*)")
+
+class MonoPipelineAddin(Ide.Object, Ide.BuildPipelineAddin):
+
+ def do_load(self, pipeline):
+ self.error_format = pipeline.add_error_format(_ERROR_REGEX, GLib.RegexCompileFlags.OPTIMIZE)
+
+ def do_unload(self, pipeline):
+ pipeline.remove_error_format(self.error_format)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]