[gupnp/wip/gi-docgen: 2/3] build: Distribute docs




commit 2d0dc90d4b2c3efdc3ac3c2b4728872ca1da5b11
Author: Jens Georg <mail jensge org>
Date:   Mon Jan 3 11:15:07 2022 +0100

    build: Distribute docs

 build-aux/dist-docs.py | 19 +++++++++++++++++++
 meson.build            |  4 ++++
 2 files changed, 23 insertions(+)
---
diff --git a/build-aux/dist-docs.py b/build-aux/dist-docs.py
new file mode 100644
index 0000000..0403b2a
--- /dev/null
+++ b/build-aux/dist-docs.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+
+import os
+import shutil
+
+references = [
+    'doc/GUPnP',
+]
+
+sourceroot = os.environ.get('MESON_SOURCE_ROOT')
+buildroot = os.environ.get('MESON_BUILD_ROOT')
+distroot = os.environ.get('MESON_DIST_ROOT')
+
+for reference in references:
+    src_path = os.path.join(buildroot, reference)
+    if os.path.isdir(src_path):
+        dst_path = os.path.join(distroot, reference)
+        shutil.copytree(src_path, dst_path)
+
diff --git a/meson.build b/meson.build
index 5f7eebd..7a6e488 100644
--- a/meson.build
+++ b/meson.build
@@ -60,6 +60,10 @@ if get_option('examples')
     subdir('examples')
 endif
 
+if not meson.is_subproject()
+    meson.add_dist_script('build-aux/dist-docs.py')
+endif
+
 summary(
   {
     'Version': meson.project_version(),


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