[gnome-clocks/bilelmoussaoui/docs] ci: generate & publish docs




commit 3e1df5fd6ac098a24fc8a75d816d5d75d7b548e7
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Mon Oct 5 21:15:52 2020 +0200

    ci: generate & publish docs
    
    why not? also could help with newcomers

 .gitlab-ci.yml                          | 14 ++++++++++++++
 build-aux/flatpak/org.gnome.clocks.json |  3 ++-
 meson.build                             |  2 ++
 meson_options.txt                       |  2 ++
 src/meson.build                         | 32 ++++++++++++++++++++++++++++++++
 5 files changed, 52 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c5b2e3c..4870319 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,3 +19,17 @@ lint:
   image: "valalang/lint:latest"
   script:
     - io.elementary.vala-lint src
+
+docs:
+  image: "fedora:latest"
+  script:
+    - dnf install -y git valadoc vala meson glib2-devel gtk3-devel gsound-devel gnome-desktop3-devel 
libgweather-devel geoclue2-devel
+    - meson -Ddocs=true _build
+    - meson compile -C _build
+    - rm -rf public
+    - mv build/docs public
+  artifacts:
+    paths:
+      - public
+  # rules:
+  #  - if: '$CI_COMMIT_BRANCH == "master"'
\ No newline at end of file
diff --git a/build-aux/flatpak/org.gnome.clocks.json b/build-aux/flatpak/org.gnome.clocks.json
index 1ecd47a..1bf5e84 100644
--- a/build-aux/flatpak/org.gnome.clocks.json
+++ b/build-aux/flatpak/org.gnome.clocks.json
@@ -132,7 +132,8 @@
             "name": "gnome-clocks",
             "buildsystem": "meson",
             "config-opts": [
-                "-Dprofile=development"
+                "-Dprofile=development",
+                "-Ddocs=false"
             ],
             "sources": [
                 {
diff --git a/meson.build b/meson.build
index 9fa294a..c7dfc10 100644
--- a/meson.build
+++ b/meson.build
@@ -26,6 +26,8 @@ if not libhandy.found()
     'libhandy',
     default_options: [
       'examples=false',
+      'introspection=disabled',
+      'vapi=enabled',
       'glade_catalog=disabled',
       'tests=false',
     ]
diff --git a/meson_options.txt b/meson_options.txt
index 3f62c34..12ff40d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,3 +8,5 @@ option(
   value: 'default',
   description: 'The build profile for Clock. One of "default" or "development".'
 )
+
+option('docs', type : 'boolean', value : false)
\ No newline at end of file
diff --git a/src/meson.build b/src/meson.build
index 4673332..ce9bbe6 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -82,3 +82,35 @@ executable('gnome-clocks', clocks_sources,
   dependencies: clocks_dependencies,
   install: true
 )
+
+if get_option('docs')
+  valadoc = find_program('valadoc')
+  custom_target('docs',
+    input: clocks_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=gobject-2.0',
+      '--pkg=libhandy-1',
+      '--pkg=gsound',
+      '--pkg=gweather-3.0',
+      '--pkg=gnome-desktop-3.0',
+      '--pkg=geocode-glib-1.0',
+      '--pkg=libgeoclue-2.0',
+      '--pkg=config',
+      '--directory=@OUTDIR@/../docs',
+      '--vapidir=@0@'.format(meson.current_source_dir()),
+      '--use-svg-images',
+      clocks_vala_sources
+    ],
+    build_by_default: true,
+  )
+endif


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