gstreamer/scripts/generate_plugins_path.py
Thibault Saunier fbb81c6c78 Generate the GST_PLUGIN_PATH using the plugins variable in subprojects
To build the documentation, we are maintaining a 'standardise' `plugins`
variable accross all modules to list all plugins and generate
documentation for them.

This is also used to get the right plugin path when inspecting plugins
for the documentation.
2019-05-13 11:42:15 -04:00

20 lines
565 B
Python

#!/usr/bin/env python3
import argparse
import os
import json
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--builddir", help="The meson build directory")
parser.add_argument(dest="plugins", help="The list of plugins", nargs="+")
options = parser.parse_args()
all_paths = set()
for plugin in options.plugins:
all_paths.add(os.path.dirname(plugin))
with open(os.path.join(options.builddir, 'GstPluginsPath.json'), "w") as f:
json.dump(list(all_paths), f, indent=4, sort_keys=True)