]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vapicheck: convenient caller script
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 31 Jan 2021 12:04:52 +0000 (13:04 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 8 Feb 2024 15:48:10 +0000 (16:48 +0100)
vapicheck.sh [new file with mode: 0755]

diff --git a/vapicheck.sh b/vapicheck.sh
new file mode 100755 (executable)
index 0000000..fd9343a
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+FILE=$1
+
+if [ ! -f "$FILE" ]; then
+       echo "'$FILE' does not exist."
+       exit 1
+fi
+
+VAPI=`basename -s .vapi $1`
+VAPIDIR=`dirname $1`
+
+vapigen/vapicheck --disable-warnings --disable-since-check \
+       --dump-tree tree.vala \
+       --vapidir $VAPIDIR \
+       $FILE || exit 1
+
+compiler/valac --disable-warnings --disable-since-check \
+       -X -Wno-discarded-qualifiers \
+       -X -Wno-deprecated-declarations \
+       -X -Wno-unused-value \
+       -X -Werror=enum-conversion \
+       -X -Werror=int-conversion \
+       -X -Werror=implicit-function-declaration \
+       --vapidir $VAPIDIR --pkg $VAPI \
+       tree.vala || \
+compiler/valac --disable-warnings --disable-since-check \
+       -C \
+       --vapidir $VAPIDIR --pkg $VAPI \
+       tree.vala && exit 1
+
+./tree || exit 1
+
+rm -f tree.vala tree.c tree