-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialyze.bash
executable file
·40 lines (33 loc) · 938 Bytes
/
dialyze.bash
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
#!/bin/bash
DIRNAME=`pwd`
PROJNAME=`basename $DIRNAME`
GLOBALPLT="$HOME/.dialyzer_plt"
set -e
if [[ ! -f "$GLOBALPLT" ]];
then
echo "OTP plt ($GLOBALPLT) not found"
exit -1
fi
if [[ -d deps ]]; then
if [[ ! -f "deps.plt" ]]; then
rebar compile
echo "Dialyzing dependencies"
dialyzer --add_to_plt --plt $GLOBALPLT --output_plt deps.plt -r deps/*/ebin/
fi
DEPSPLTARG="--plt deps.plt"
else
DEPSPLTARG=""
fi
rebar compile skip_deps=true
if [[ -f $PROJNAME.plt ]]; then
dialyzer --check_plt --plt $PROJNAME.plt -r ebin/
if [[ $? -ne 0 ]]; then
echo "Not up to date, dialyzing"
dialyzer --add_to_plt $DEPSPLTARG --output_plt $PROJNAME.plt -r ebin/
fi
else
echo "Dialyzing $PROJNAME"
dialyzer --add_to_plt $DEPSPLTARG --output_plt $PROJNAME.plt -r ebin/
fi
echo "Checking"
dialyzer -Werror_handling -Wrace_conditions -Wunderspecs --plt $PROJNAME.plt -r ebin/