Commit f5933b8b authored by Michael Gratton's avatar Michael Gratton 🤞

Merge branch 'wip/validate-app-data' into 'master'

Validate both appdata and desktop files

See merge request !139
parents 4e62db41 b605ddc4
Pipeline #62204 passed with stages
in 37 minutes and 42 seconds
foreach desktop_file: [ 'org.gnome.Geary.desktop', 'geary-autostart.desktop' ] #
i18n.merge_file( # Desktop files
#
desktop_src = [
'org.gnome.Geary.desktop',
'geary-autostart.desktop'
]
foreach desktop_file: desktop_src
desktop_merged = i18n.merge_file(
input: desktop_file + '.in', input: desktop_file + '.in',
output: desktop_file, output: desktop_file,
type: 'desktop', type: 'desktop',
...@@ -7,19 +16,44 @@ foreach desktop_file: [ 'org.gnome.Geary.desktop', 'geary-autostart.desktop' ] ...@@ -7,19 +16,44 @@ foreach desktop_file: [ 'org.gnome.Geary.desktop', 'geary-autostart.desktop' ]
install: true, install: true,
install_dir: join_paths(datadir, 'applications') install_dir: join_paths(datadir, 'applications')
) )
if desktop_file_validate.found()
test(
desktop_file + '-validate',
desktop_file_validate,
args: [ desktop_merged.full_path() ]
)
endif
endforeach endforeach
# The appdata file #
i18n.merge_file( # Appdata file
input: 'org.gnome.Geary.appdata.xml.in', #
output: 'org.gnome.Geary.appdata.xml',
appdata_file = 'org.gnome.Geary.appdata.xml'
appdata_merged = i18n.merge_file(
input: appdata_file + '.in',
output: appdata_file,
type: 'xml', type: 'xml',
po_dir: po_dir, po_dir: po_dir,
install: true, install: true,
install_dir: join_paths(datadir, 'metainfo') install_dir: join_paths(datadir, 'metainfo')
) )
if appstream_util.found()
test(
appdata_file + '-validate',
appstream_util,
args: [
'validate-relax', '--nonet', appdata_merged.full_path()
]
)
endif
#
# Contractor file (Elementary OS) # Contractor file (Elementary OS)
#
if install_contractor_file if install_contractor_file
# Call msgfmt manually since gettext won't otherwise translate the # Call msgfmt manually since gettext won't otherwise translate the
# Description field. See merge req !50. # Description field. See merge req !50.
......
...@@ -99,7 +99,9 @@ if libunwind_dep.found() ...@@ -99,7 +99,9 @@ if libunwind_dep.found()
) )
endif endif
# Optional libraries # Optional dependencies
appstream_util = find_program('appstream-util', required: false)
desktop_file_validate = find_program('desktop-file-validate', required: false)
libunity = dependency('unity', version: '>= 5.12.0', required: false) libunity = dependency('unity', version: '>= 5.12.0', required: false)
libmessagingmenu = meson.get_compiler('c').find_library('libmessaging-menu', required: false) libmessagingmenu = meson.get_compiler('c').find_library('libmessaging-menu', required: false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment