[gnome-contacts] build: move resource files into data subdir



commit f90dfb8c76f4727b903e617f6b4f456eca26ad74
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Sat May 31 15:26:13 2014 -0400

    build: move resource files into data subdir

 data/Makefile.am                       |    5 +++++
 data/contacts.gresource.xml            |    8 ++++++++
 {src => data/ui}/app-menu.ui           |    0
 {src => data/ui}/contacts-list-pane.ui |    0
 {src => data/ui}/contacts-window.ui    |    0
 src/Makefile.am                        |   12 ++++--------
 src/contacts-list-pane.vala            |    2 +-
 src/contacts-utils.vala                |    2 +-
 src/contacts-window.vala               |    2 +-
 src/contacts.gresource.xml             |    8 --------
 10 files changed, 20 insertions(+), 19 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index fa3220c..bd637b1 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -28,6 +28,10 @@ appdata_in_files = gnome-contacts.appdata.xml.in
 
 EXTRA_DIST = \
        gnome-contacts.desktop.in.in    \
+       contacts.gresource.xml \
+       ui/app-menu.ui \
+       ui/contacts-window.ui \
+       ui/contacts-list-pane.ui \
        $(appdata_in_files)     \
        $(searchprovider_DATA)  \
        $(service_in_files)  \
@@ -35,6 +39,7 @@ EXTRA_DIST = \
 
 CLEANFILES = $(service_DATA)   \
        $(appdata_DATA)
+
 DISTCLEANFILES = \
        gnome-contacts.desktop \
        gnome-contacts.desktop.in
diff --git a/data/contacts.gresource.xml b/data/contacts.gresource.xml
new file mode 100644
index 0000000..6e1c6ff
--- /dev/null
+++ b/data/contacts.gresource.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/contacts">
+    <file compressed="true" preprocess="xml-stripblanks">ui/app-menu.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">ui/contacts-window.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">ui/contacts-list-pane.ui</file>
+  </gresource>
+</gresources>
diff --git a/src/app-menu.ui b/data/ui/app-menu.ui
similarity index 100%
rename from src/app-menu.ui
rename to data/ui/app-menu.ui
diff --git a/src/contacts-list-pane.ui b/data/ui/contacts-list-pane.ui
similarity index 100%
rename from src/contacts-list-pane.ui
rename to data/ui/contacts-list-pane.ui
diff --git a/src/contacts-window.ui b/data/ui/contacts-window.ui
similarity index 100%
rename from src/contacts-window.ui
rename to data/ui/contacts-window.ui
diff --git a/src/Makefile.am b/src/Makefile.am
index 29b6395..822e170 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,7 @@ AM_CPPFLAGS = \
 AM_VALAFLAGS = \
        --vapidir=../vapi --vapidir=../libgd --pkg config --pkg custom --pkg gd-1.0 \
        @CONTACTS_PACKAGES@ \
-       --target-glib=2.38 --gresources=$(srcdir)/contacts.gresource.xml \
+       --target-glib=2.38 --gresources=$(top_srcdir)/data/contacts.gresource.xml \
        $(NULL)
 
 if BUILD_CHEESE
@@ -59,9 +59,9 @@ gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml)
 
 @GSETTINGS_RULES@
 
-contact-resources.c: contacts.gresource.xml app-menu.ui contacts-window.ui contacts-list-pane.ui
-       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/contacts.gresource.xml \
-               --target=$@ --sourcedir=$(srcdir) --c-name contacts --generate-source
+resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir=$(top_srcdir)/data 
$(top_srcdir)/data/contacts.gresource.xml)
+contact-resources.c: $(top_srcdir)/data/contacts.gresource.xml $(resource_files)
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(top_srcdir)/data --generate-source $<
 
 gnome_contacts_SOURCES = \
        $(vala_sources) \
@@ -100,10 +100,6 @@ CLEANFILES = \
 EXTRA_DIST = \
        cheese-flash.h \
        um-crop-area.h \
-       contacts.gresource.xml \
-       app-menu.ui \
-       contacts-window.ui \
-       contacts-list-pane.ui \
        $(gsettingsschema_in_files)     \
        contacts-esd-setup.h \
        $(NULL)
diff --git a/src/contacts-list-pane.vala b/src/contacts-list-pane.vala
index c2b9948..4606d0f 100644
--- a/src/contacts-list-pane.vala
+++ b/src/contacts-list-pane.vala
@@ -20,7 +20,7 @@ using Gee;
 using Gtk;
 using Folks;
 
-[GtkTemplate (ui = "/org/gnome/contacts/contacts-list-pane.ui")]
+[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-list-pane.ui")]
 public class Contacts.ListPane : Frame {
   private Store _store;
   public Store store {
diff --git a/src/contacts-utils.vala b/src/contacts-utils.vala
index 03664c8..755a8b1 100644
--- a/src/contacts-utils.vala
+++ b/src/contacts-utils.vala
@@ -29,7 +29,7 @@ namespace Contacts {
   public Gtk.Builder load_ui (string ui) {
     var builder = new Gtk.Builder ();
     try {
-        builder.add_from_resource ("/org/gnome/contacts/".concat (ui, null));
+        builder.add_from_resource ("/org/gnome/contacts/ui/".concat (ui, null));
     } catch (GLib.Error e) {
         error ("loading ui file: %s", e.message);
     }
diff --git a/src/contacts-window.vala b/src/contacts-window.vala
index f03ffa2..a5c0dbd 100644
--- a/src/contacts-window.vala
+++ b/src/contacts-window.vala
@@ -20,7 +20,7 @@ using Gee;
 using Gtk;
 using Folks;
 
-[GtkTemplate (ui = "/org/gnome/contacts/contacts-window.ui")]
+[GtkTemplate (ui = "/org/gnome/contacts/ui/contacts-window.ui")]
 public class Contacts.Window : Gtk.ApplicationWindow {
   [GtkChild]
   private Grid content_grid;


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