Created
July 19, 2012 21:39
-
-
Save chancila/3147019 to your computer and use it in GitHub Desktop.
Dialyze a rebar based erlang project easily
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIRNAME=`pwd` | |
PROJNAME=`basename $DIRNAME` | |
if [[ ! -f "$HOME/.dialyzer_otp.plt" ]]; | |
then | |
echo "OTP plt not found" | |
exit -1 | |
fi | |
if [[ ! -f "deps.plt" ]]; | |
then | |
rebar compile | |
echo "Dialyzing dependencies" | |
dialyzer --add_to_plt --plt $HOME/.dialyzer_otp.plt --output_plt deps.plt -r deps/*/ebin/ | |
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 --plt deps.plt --output_plt $PROJNAME.plt -r ebin/ | |
fi | |
else | |
echo "Dialyzing $PROJNAME" | |
dialyzer --add_to_plt --plt deps.plt --output_plt $PROJNAME.plt -r ebin/ | |
fi | |
echo "Checking" | |
dialyzer -Werror_handling -Wrace_conditions -Wunderspecs --plt $PROJNAME.plt -r ebin/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment