Skip to content

Instantly share code, notes, and snippets.

@chancila
Created July 19, 2012 21:39
Show Gist options
  • Save chancila/3147019 to your computer and use it in GitHub Desktop.
Save chancila/3147019 to your computer and use it in GitHub Desktop.
Dialyze a rebar based erlang project easily
#!/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