diff options
| author | Alexandru Croitor <[email protected]> | 2019-05-24 17:29:21 +0200 |
|---|---|---|
| committer | Alexandru Croitor <[email protected]> | 2019-05-27 07:48:51 +0000 |
| commit | cbb143e9f1396c8180401c4f8a5b1fe579902559 (patch) | |
| tree | 6c25ee3dfd31e5badf8f4da9fe8201ddd530a71c /util/cmake/configurejson2cmake.py | |
| parent | e4f0680c4a722b02fb31fc1693e09059e94326f4 (diff) | |
Improve configurejson2cmake.py to handle non-compliant qmake JSON
Some configure.json files contain new lines inside quoted strings,
which is not conformant with the JSON spec.
Add a new json_parser python module which uses pyparsing to preprocess
the json files to remove the new lines inside the quoted strings, and
then hands over the preprocessed content to the regular json module.
Change-Id: I5f8938492068dda5640465cc78f5a7b6be0e709a
Reviewed-by: Simon Hausmann <[email protected]>
Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'util/cmake/configurejson2cmake.py')
| -rwxr-xr-x | util/cmake/configurejson2cmake.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index d1646ed0826..09f76a272d0 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -27,7 +27,7 @@ ## ############################################################################# -import json +import json_parser import os.path import re import sys @@ -154,8 +154,8 @@ def readJsonFromDir(dir): print('Reading {}...'.format(path)) assert os.path.exists(path) - with open(path, 'r') as fh: - return json.load(fh) + parser = json_parser.QMakeSpecificJSONParser() + return parser.parse(path) def processFiles(ctx, data): |
