Support whitespace stripping for JSON resources

Similarly to how glib-compile-resources can call xmllint to eliminate
whitespace in XML files to reduce their size inside a GResource, we can
use json-glib-format to achieve the same result.

The mechanism for using json-glib-format is the same, with a separate
environment variable if we want to direct glib-compile-resources to a
version of json-glib-format that is not the one in the PATH.

https://bugzilla.gnome.org/show_bug.cgi?id=794284
This commit is contained in:
Emmanuele Bassi
2018-03-13 11:49:59 +00:00
parent c672fcc0a8
commit 7fd17c4337
2 changed files with 59 additions and 0 deletions

View File

@@ -216,6 +216,16 @@ environment variable is not set, gdk-pixbuf-pixdata is searched in the
</para></listitem>
</varlistentry>
<varlistentry>
<term><envar>JSON_GLIB_FORMAT</envar></term>
<listitem><para>
The full path to the json-glib-format executable. This is used to preprocess
resources with the <literal>json-stripblanks</literal> preprocessing option.
If this environment variable is not set, json-glib-format is searched in the
<envar>PATH</envar>.
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
</refentry>