build: Replace array with dict

It's more readable than "magic" indexes, and makes it easier to
provide fallback values for optional entries.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2141>
This commit is contained in:
Florian Müllner 2022-01-31 23:55:57 +01:00 committed by Marge Bot
parent 372ccc3e29
commit d6b689eaf1

View File

@ -48,16 +48,19 @@ subdir('icons')
subdir('theme')
data_resources = [
['dbus-interfaces', []],
['osk-layouts', []],
['theme', theme_deps]
{'name': 'dbus-interfaces'},
{'name': 'osk-layouts'},
{'name': 'theme', 'deps': theme_deps}
]
foreach resource : data_resources
name = resource.get('name')
deps = resource.get('deps', [])
gnome.compile_resources(
'gnome-shell-' + resource[0],
'gnome-shell-@0@.gresource.xml'.format(resource[0]),
source_dir: resource[0],
dependencies: resource[1],
'gnome-shell-' + name,
'gnome-shell-@0@.gresource.xml'.format(name),
source_dir: name,
dependencies: deps,
gresource_bundle: true,
install: true,
install_dir: pkgdatadir