From c6c8a4dbb74a409d0f89e29f18f6fe2f278d6879 Mon Sep 17 00:00:00 2001 From: mappu Date: Tue, 6 Aug 2024 13:03:01 +1200 Subject: [PATCH] dumpjson: initial commit --- cmd/dumpjson/dumpjson.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 cmd/dumpjson/dumpjson.sh diff --git a/cmd/dumpjson/dumpjson.sh b/cmd/dumpjson/dumpjson.sh new file mode 100755 index 00000000..543668d0 --- /dev/null +++ b/cmd/dumpjson/dumpjson.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Makes a very large amount of data + +set -eu + +QT_DIR=/usr/include/x86_64-linux-gnu/qt5/ + +main() { + if [[ -d jsonfiles ]] ; then + rm -fr ./jsonfiles + fi + mkdir ./jsonfiles + + for package in QtWidgets QtCore QtGui ; do + + mkdir ./jsonfiles/${package} + + for f in ${QT_DIR}/${package}/*.h ; do + echo "Processing file '$f'..." + clang -x c++ $(pkg-config --cflags Qt5Widgets) -Xclang -ast-dump=json -fsyntax-only "$f" \ + | gzip --best \ + > jsonfiles/${package}/$(basename "$f").json.gz + done + + done +} + +main "$@"