[PATCH 1/7] add simple script to generate a qrc containing all qml files

Martin Gysel me at bearsh.org
Tue Aug 16 18:23:46 UTC 2016


---
 scripts/gen_qml_qrc.sh | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100755 scripts/gen_qml_qrc.sh

diff --git a/scripts/gen_qml_qrc.sh b/scripts/gen_qml_qrc.sh
new file mode 100755
index 0000000..6e1c378
--- /dev/null
+++ b/scripts/gen_qml_qrc.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+
+TAB="    "
+
+kirigami_dir="$(dirname $(readlink -f $0))/.."
+
+case $1 in
+-h|--help)
+	echo "usage: $(basename $0) [QRC_FILE]"
+	exit 1
+	;;
+esac
+
+pushd ${kirigami_dir} > /dev/null
+
+tmpfile=$(mktemp)
+
+echo "<RCC>" > ${tmpfile}
+echo "${TAB}<qresource prefix=\"/\">" >> ${tmpfile}
+
+for i in $(find src/controls/ -name *.qml); do
+	echo -e "${TAB}${TAB}<file alias=\"${i#src/controls/}\">${i}</file>" >> ${tmpfile};
+done
+for i in $(find src/styles/ -name *.qml); do
+	 echo -e "${TAB}${TAB}<file alias=\"${i#src/}\">${i}</file>" >> ${tmpfile};
+done
+
+echo "${TAB}</qresource>" >> ${tmpfile}
+echo "</RCC>" >> ${tmpfile}
+
+if [[ -n $1 ]]; then
+	cat ${tmpfile} > $1
+else
+	cat ${tmpfile}
+fi
+
+unlink ${tmpfile}
+
+popd > /dev/null
-- 
2.9.3



More information about the Plasma-devel mailing list