blob: 5b61273ac0d0c4af26a75ce5b3503b8e5a235204 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#!/bin/sh
set -e
SOURCE_DIR="$1"
ASTYLE="$2"
APIDSL="$3"
# Go to the source root.
if [ -z "$SOURCE_DIR" ]; then
SOURCE_DIR=.
fi
cd "$SOURCE_DIR"
if [ -z "$ASTYLE" ] || ! which "$ASTYLE"; then
ASTYLE=astyle
fi
if ! which "$ASTYLE"; then
# If we couldn't find or install an astyle binary, don't do anything.
echo "Could not find an astyle binary; please install astyle."
exit 1
fi
if ! which "$APIDSL"; then
if [ -f ../apidsl/apigen.native ]; then
APIDSL=../apidsl/apigen.native
else
APIDSL=apidsl_curl
fi
fi
apidsl_curl() {
curl -X POST --data-binary @"$1" https://apidsl.herokuapp.com/apidsl
}
# Check if apidsl generated sources are up to date.
$APIDSL toxcore/crypto_core.api.h > toxcore/crypto_core.h &
$APIDSL toxcore/tox.api.h > toxcore/tox.h &
$APIDSL toxav/toxav.api.h > toxav/toxav.h &
$APIDSL toxencryptsave/toxencryptsave.api.h > toxencryptsave/toxencryptsave.h &
wait; wait; wait; wait
if grep '<unresolved>' */*.h; then
echo "error: some apidsl references were unresolved"
exit 1
fi
SOURCES=`find . \
"-(" -name "*.[ch]" -or -name "*.cpp" "-)" \
-and -not -name "*.api.h" \
-and -not -wholename "./super_donators/*" \
-and -not -wholename "./third_party/*" \
-and -not -wholename "./toxencryptsave/crypto_pwhash*"`
$ASTYLE -n --options=other/astyle/astylerc $SOURCES
git diff --exit-code
|