[gnome-builder] build: do not pre-generate .c files for .vala



commit ca10f306d3e64989b13eaca4876d7d32c7d928e6
Author: Christian Hergert <chergert redhat com>
Date:   Mon Feb 22 02:54:24 2016 -0800

    build: do not pre-generate .c files for .vala
    
    Due to API breakage in vala, we ca no-longer ship pre-generated .c files
    during `make distcheck`. We now ship just the .vala files and generate
    the .c files before the all target using BUILT_SOURCES.

 plugins/vala-pack/Makefile.am |   41 ++++++++++++++++++++++++++++++++++++++++-
 po/POTFILES.skip              |    3 ++-
 2 files changed, 42 insertions(+), 2 deletions(-)
---
diff --git a/plugins/vala-pack/Makefile.am b/plugins/vala-pack/Makefile.am
index 93864e9..86baaa9 100644
--- a/plugins/vala-pack/Makefile.am
+++ b/plugins/vala-pack/Makefile.am
@@ -1,12 +1,30 @@
 if ENABLE_VALA_PACK_PLUGIN
 
+# NOTE:
+#
+# This does not use the normal _SOURCES support for Vala in automake.
+# This is because we need to ship files that are generated on the
+# build machine, based on the vala it has available. These can change
+# as has been seen in API breaks in libvala. Make sure you add any
+# new .vala file to _VALASOURCES and the corresponding C file to
+# _SOURCES.
+
 EXTRA_DIST = $(plugin_DATA)
 
 plugindir = $(libdir)/gnome-builder/plugins
 plugin_LTLIBRARIES = libvala-pack-plugin.la
 dist_plugin_DATA = vala-pack.plugin
 
-libvala_pack_plugin_la_SOURCES = \
+BUILT_SOURCES = libvala_pack_plugin_la.stamp
+
+libvala_pack_plugin_la.stamp: $(libvala_pack_plugin_la_VALASOURCES)
+       $(AM_V_GEN)$(VALAC) \
+               $(libvala_pack_plugin_la_VALAFLAGS) \
+               $(addprefix $(srcdir)/,$(libvala_pack_plugin_la_VALASOURCES)) \
+               --ccode \
+               && touch $@
+
+libvala_pack_plugin_la_VALASOURCES = \
        config.vapi \
        ide-vala-service.vala \
        ide-vala-completion.vala \
@@ -24,6 +42,27 @@ libvala_pack_plugin_la_SOURCES = \
        vala-pack-plugin.vala \
        $(NULL)
 
+EXTRA_DIST += $(libvala_pack_plugin_la_VALASOURCES)
+
+nodist_libvala_pack_plugin_la_SOURCES = \
+       ide-vala-service.c \
+       ide-vala-completion.c \
+       ide-vala-completion-item.c \
+       ide-vala-completion-provider.c \
+       ide-vala-diagnostics.c \
+       ide-vala-diagnostic-provider.c \
+       ide-vala-indenter.c \
+       ide-vala-index.c \
+       ide-vala-locator.c \
+       ide-vala-preferences-addin.c \
+       ide-vala-source-file.c \
+       ide-vala-symbol-resolver.c \
+       ide-vala-symbol-tree.c \
+       vala-pack-plugin.c \
+       $(NULL)
+
+CLEANFILES = $(BUILT_SOURCES) $(nodist_libvala_pack_plugin_la_SOURCES)
+
 libvala_pack_plugin_la_VALAFLAGS = \
        --target-glib=2.44 \
        --thread \
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index dc6db78..c065748 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -2,12 +2,13 @@
 # Please keep this file sorted alphabetically.
 contrib/tmpl/tmpl-expr-parser.c
 plugins/vala-pack/ide-vala-preferences-addin.c
+sub/plugins/vala-pack/ide-vala-preferences-addin.c
 tests/menus.ui
 tools/ide-build.c
 tools/ide-list-build-flags.c
 tools/ide-list-devices.c
 tools/ide-list-diagnostics.c
-tools/ide-list-files.c
 tools/ide-list-file-settings.c
+tools/ide-list-files.c
 tools/ide-mine-projects.c
 tools/ide-search.c


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