Commit d5755b2a authored by Martin Blanchard's avatar Martin Blanchard Committed by Sébastien Wilmet

build: Validate gschema files

#174
parent 57ee486f
Pipeline #130137 passed with stage
in 5 minutes and 1 second
......@@ -23,12 +23,15 @@ appdata_file = i18n.merge_file(
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test(
'validate-appdata', appstream_util,
test(
'validate-appdata',
appstream_util,
args: [
'validate-relax', '--nonet', appdata_file.full_path()
'validate-relax',
'--nonet',
appdata_file.full_path()
]
)
)
endif
......@@ -57,13 +60,13 @@ desktop_file = i18n.merge_file(
desktop_file_validate = find_program('desktop-file-validate', required: false)
if desktop_file_validate.found()
test(
test(
'validate-desktop',
desktop_file_validate,
args: [
desktop_file.full_path()
desktop_file.full_path(),
]
)
)
endif
quoted_plugins = []
......@@ -73,20 +76,38 @@ foreach plugin_name:active_plugins
]
endforeach
gschema_xml = configuration_data()
gschema_xml.set('GETTEXT_PACKAGE', package_name)
gschema_xml.set('ACTIVE_PLUGINS', ', '.join(quoted_plugins))
gschema_in = configuration_data()
gschema_in.set('GETTEXT_PACKAGE', package_name)
gschema_in.set('ACTIVE_PLUGINS', ', '.join(quoted_plugins))
configure_file(
gschema_file = configure_file(
input: 'org.gnome.gedit.gschema.xml.in',
output: 'org.gnome.gedit.gschema.xml',
configuration: gschema_xml,
configuration: gschema_in,
install_dir: join_paths(
glibdir,
'schemas',
)
)
gschema_dtd = join_paths(
gio_dep.get_pkgconfig_variable('schemasdir'),
'gschema.dtd',
)
xmllint = find_program('xmllint', required: false)
if xmllint.found()
test(
'validate-gschema',
xmllint,
args: [
'--noout',
'--dtdvalid', gschema_dtd,
gschema_file,
]
)
endif
service_in = configuration_data()
service_in.set('bindir', bindir)
......
......@@ -2,16 +2,28 @@ subdir('scripts')
subdir('tools')
subdir('data')
configure_file(
externaltools_gschema_file = configure_file(
input: 'org.gnome.gedit.plugins.externaltools.gschema.xml.in',
output: 'org.gnome.gedit.plugins.externaltools.gschema.xml',
configuration: gschema_xml,
configuration: gschema_in,
install_dir: join_paths(
glibdir,
'schemas',
)
)
if xmllint.found()
test(
'validate-externaltools-gschema',
xmllint,
args: [
'--noout',
'--dtdvalid', gschema_dtd,
externaltools_gschema_file,
]
)
endif
custom_target(
'externaltools.plugin',
input: 'externaltools.plugin.desktop.in',
......
......@@ -101,16 +101,28 @@ custom_target(
)
)
configure_file(
filebrowser_gschema_file = configure_file(
input: 'org.gnome.gedit.plugins.filebrowser.gschema.xml.in',
output: 'org.gnome.gedit.plugins.filebrowser.gschema.xml',
configuration: gschema_xml,
configuration: gschema_in,
install_dir: join_paths(
glibdir,
'schemas',
)
)
if xmllint.found()
test(
'validate-filebrowser-gschema',
xmllint,
args: [
'--noout',
'--dtdvalid', gschema_dtd,
filebrowser_gschema_file,
]
)
endif
custom_target(
'filebrowser.plugin',
input: 'filebrowser.plugin.desktop.in',
......
subdir('pythonconsole')
configure_file(
pythonconsole_gschema_file = configure_file(
input: 'org.gnome.gedit.plugins.pythonconsole.gschema.xml.in',
output: 'org.gnome.gedit.plugins.pythonconsole.gschema.xml',
configuration: gschema_xml,
configuration: gschema_in,
install_dir: join_paths(
glibdir,
'schemas',
)
)
if xmllint.found()
test(
'validate-pythonconsole-gschema',
xmllint,
args: [
'--noout',
'--dtdvalid', gschema_dtd,
pythonconsole_gschema_file,
]
)
endif
custom_target(
'pythonconsole.plugin',
input: 'pythonconsole.plugin.desktop.in',
......
......@@ -28,16 +28,28 @@ libspell_sha = shared_module(
name_suffix: module_suffix,
)
configure_file(
spell_gschema_file = configure_file(
input: 'org.gnome.gedit.plugins.spell.gschema.xml.in',
output: 'org.gnome.gedit.plugins.spell.gschema.xml',
configuration: gschema_xml,
configuration: gschema_in,
install_dir: join_paths(
glibdir,
'schemas',
)
)
if xmllint.found()
test(
'validate-spell-gschema',
xmllint,
args: [
'--noout',
'--dtdvalid', gschema_dtd,
spell_gschema_file,
]
)
endif
custom_target(
'spell.plugin',
input: 'spell.plugin.desktop.in',
......
......@@ -42,16 +42,28 @@ libtime_sha = shared_module(
name_suffix: module_suffix,
)
configure_file(
time_gschema_file = configure_file(
input: 'org.gnome.gedit.plugins.time.gschema.xml.in',
output: 'org.gnome.gedit.plugins.time.gschema.xml',
configuration: gschema_xml,
configuration: gschema_in,
install_dir: join_paths(
glibdir,
'schemas',
)
)
if xmllint.found()
test(
'validate-time-gschema',
xmllint,
args: [
'--noout',
'--dtdvalid', gschema_dtd,
time_gschema_file,
]
)
endif
custom_target(
'time.plugin',
input: 'time.plugin.desktop.in',
......
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