[seahorse/wip/nielsdg/update-flatpak] meson: Validate appdata and desktop files
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse/wip/nielsdg/update-flatpak] meson: Validate appdata and desktop files
- Date: Thu, 20 Feb 2020 18:52:53 +0000 (UTC)
commit 3f68539f320adadaf9e83b9535ace8e1f82ea786
Author: Niels De Graef <nielsdegraef gmail com>
Date: Thu Feb 20 19:52:09 2020 +0100
meson: Validate appdata and desktop files
Let's prevent some easy mishaps by adding validation as tests.
data/meson.build | 42 +++++++++++++++++++++++++++++++-----------
1 file changed, 31 insertions(+), 11 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index a724bbca..beb49240 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -17,7 +17,7 @@ resources_src = gnome.compile_resources('seahorse-resources',
)
# The appdata file
-i18n.merge_file(
+appdata_file = i18n.merge_file(
input: 'org.gnome.seahorse.Application.appdata.xml.in',
output: '@0 appdata xml'.format(application_id),
type: 'xml',
@@ -26,17 +26,26 @@ i18n.merge_file(
install_dir: get_option('datadir') / 'metainfo',
)
+appstream_util = find_program('appstream-util', required: false)
+if appstream_util.found()
+ test('validate-appdata', appstream_util,
+ suite: 'data',
+ args: [
+ 'validate-relax', '--nonet', appdata_file.full_path()
+ ]
+ )
+endif
+
# The desktop file
-configured_desktop_file = configure_file(
- input: 'org.gnome.seahorse.Application.desktop.in.in',
- output: 'org.gnome.seahorse.Application.desktop.in',
- configuration: {
- 'bindir': seahorse_prefix / get_option('bindir'),
- 'icon': application_id,
- },
-)
-i18n.merge_file(
- input: configured_desktop_file,
+desktop_file = i18n.merge_file(
+ input: configure_file(
+ input: 'org.gnome.seahorse.Application.desktop.in.in',
+ output: '@BASENAME@',
+ configuration: {
+ 'bindir': seahorse_prefix / get_option('bindir'),
+ 'icon': application_id,
+ },
+ ),
output: '@0@.desktop'.format(application_id),
type: 'desktop',
po_dir: po_dir,
@@ -44,6 +53,17 @@ i18n.merge_file(
install_dir: get_option('datadir') / 'applications',
)
+desktop_file_validate = find_program ('desktop-file-validate', required: false)
+if desktop_file_validate.found()
+ test('validate-desktop',
+ desktop_file_validate,
+ suite: 'data',
+ args: [
+ desktop_file.full_path()
+ ]
+ )
+endif
+
# The service file
configure_file(
input: 'org.gnome.seahorse.Application.service.in',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]