[gnome-contacts] Documentation: auto-build the valadoc docs.



commit 030a5bcba951be114878f82f584f9996cae2ae69
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sat Mar 31 14:55:26 2018 +0200

    Documentation: auto-build the valadoc docs.
    
    We won't them by defaul though, you have to explicitly set 'docs' to
    true when configuring meson.

 docs/meson.build         | 26 ++++++++++++++++++++++++++
 meson.build              |  6 ++++++
 meson_options.txt        |  1 +
 src/contacts-avatar.vala |  2 +-
 src/meson.build          |  4 ++--
 5 files changed, 36 insertions(+), 3 deletions(-)
---
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 0000000..4a77608
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1,26 @@
+custom_target('docs',
+  input: contacts_vala_sources,
+  output: 'docs',
+  command: [ valadoc,
+    '--doclet=html',
+    '--force',
+    '--package-name=@0@'.format(meson.project_name()),
+    '--package-version=@0@'.format(meson.project_version()),
+    '--pkg=glib-2.0',
+    '--pkg=gio-2.0',
+    '--pkg=gio-unix-2.0',
+    '--pkg=gtk+-3.0',
+    '--pkg=gnome-desktop-3.0',
+    '--pkg=gee-0.8',
+    '--pkg=goa-1.0',
+    '--pkg=folks',
+    '--pkg=folks-eds',
+    '--pkg=libedataserverui-1.2',
+    '--pkg=custom',
+    '--pkg=config',
+    '--vapidir=@0@'.format(join_paths(meson.source_root(), 'vapi')),
+    '--directory=@OUTDIR@',
+    contacts_vala_sources,
+  ],
+  build_by_default: true,
+)
diff --git a/meson.build b/meson.build
index 674cdee..59dd6c0 100644
--- a/meson.build
+++ b/meson.build
@@ -61,6 +61,9 @@ if telepathy_enabled
   telepathy_glib = dependency('telepathy-glib', version: '>= 0.22.0')
 endif
 
+docs_enabled = get_option('docs')
+valadoc = find_program('valadoc', required: docs_enabled)
+
 manpage_enabled = get_option('with-manpage')
 
 # Configuration
@@ -85,3 +88,6 @@ subdir('data')
 subdir('po')
 subdir('src')
 subdir('man')
+if docs_enabled
+  subdir('docs')
+endif
diff --git a/meson_options.txt b/meson_options.txt
index fa67894..08347a2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,3 +2,4 @@ option('with-cheese', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'aut
 option('maps', type: 'boolean', value: true, description: 'Enable built-in support for maps.')
 option('telepathy', type: 'boolean', value: true, description: 'Enable Telepathy call/chat support.')
 option('with-manpage', type: 'boolean', value: true, description: 'enable building man pages')
+option('docs', type: 'boolean', value: true, description: 'Whether to build the valadoc docs.')
diff --git a/src/contacts-avatar.vala b/src/contacts-avatar.vala
index 48db68f..873d638 100644
--- a/src/contacts-avatar.vala
+++ b/src/contacts-avatar.vala
@@ -20,7 +20,7 @@ using Folks;
 using Gee;
 
 /**
- * The Avatar of a Contact is responsible for showing an {@link Individual}'s
+ * The Avatar of a Contact is responsible for showing an {@link Folks.Individual}'s
  * avatar, or a fallback if it's not available.
  */
 public class Contacts.Avatar : DrawingArea {
diff --git a/src/meson.build b/src/meson.build
index b472ece..7dc6d27 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -5,7 +5,7 @@ install_data('org.gnome.Contacts.gschema.xml',
 )
 
 # The gnome-contacts binary
-contacts_vala_sources = [
+contacts_vala_sources = files(
   'contacts-accounts-list.vala',
   'contacts-app.vala',
   'contacts-avatar.vala',
@@ -31,7 +31,7 @@ contacts_vala_sources = [
   'contacts-utils.vala',
   'contacts-window.vala',
   'main.vala',
-]
+)
 
 contacts_vala_args = [
   '--target-glib=@0@'.format(min_glib_version),


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