aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Szymczyszyn <[email protected]>2015-07-02 16:54:27 +0200
committerRadek Szymczyszyn <[email protected]>2015-07-03 13:25:56 +0200
commit7b51ebafd0039709db74bdb23e080b81b72abf18 (patch)
tree9bdb3088c35c4fc02bae3bb3de68b6cb1aa248fd
parent87cd3bb022ff3cb829a07fe4e442c0284360c3e2 (diff)
downloadkerl-7b51ebafd0039709db74bdb23e080b81b72abf18.tar.gz
kerl-7b51ebafd0039709db74bdb23e080b81b72abf18.tar.bz2
kerl-7b51ebafd0039709db74bdb23e080b81b72abf18.zip
Build a Dialyzer PLT when installing a build
-rwxr-xr-xkerl31
1 files changed, 31 insertions, 0 deletions
diff --git a/kerl b/kerl
index 43e3545..59f191a 100755
--- a/kerl
+++ b/kerl
@@ -49,11 +49,15 @@ fi
if [ -n "$KERL_INSTALL_MANPAGES" ]; then
_KIM="$KERL_INSTALL_MANPAGES"
fi
+if [ -n "$KERL_BUILD_PLT" ]; then
+ _KBPLT="$KERL_BUILD_PLT"
+fi
KERL_CONFIGURE_OPTIONS=
KERL_CONFIGURE_APPLICATIONS=
KERL_CONFIGURE_DISABLE_APPLICATIONS=
KERL_SASL_STARTUP=
KERL_INSTALL_MANPAGES=
+KERL_BUILD_PLT=
# ensure the base dir exsists
mkdir -p "$KERL_BASE_DIR"
@@ -82,6 +86,9 @@ fi
if [ -n "$_KIM" ]; then
KERL_INSTALL_MANPAGES="$_KIM"
fi
+if [ -n "$_KBPLT" ]; then
+ KERL_BUILD_PLT="$_KBPLT"
+fi
if [ -z "$KERL_SASL_STARTUP" ]; then
INSTALL_OPT=-minimal
@@ -522,6 +529,11 @@ ACTIVATE
fi
fi
+ if [ -n "$KERL_BUILD_PLT" ]; then
+ echo "Building Dialyzer PLT..."
+ build_plt "$absdir"
+ fi
+
echo "You can activate this installation running the following command:"
echo ". $absdir/activate"
echo "Later on, you can leave the installation typing:"
@@ -545,6 +557,25 @@ do_install_htmldocs()
tar -C "$absdir/html" -xzf "$KERL_DOWNLOAD_DIR/$FILENAME")
}
+build_plt()
+{
+ dialyzerd=$1/dialyzer
+ mkdir -p $dialyzerd
+ plt=$dialyzerd/plt
+ build_log=$dialyzerd/build.log
+ dialyzer=$1/bin/dialyzer
+ apps=`ls -1 $1/lib | cut -d- -f1 | grep -Ev 'erl_interface|jinterface' | xargs echo`
+ $dialyzer --output_plt $plt --build_plt --apps $apps > $build_log 2>&1
+ status=$?
+ if [ $status -eq 0 -o $status -eq 2 ]; then
+ echo "Done building $plt"
+ return 0
+ else
+ echo "Error building PLT, see $build_log for details"
+ return 1
+ fi
+}
+
do_deploy()
{
if [ -z "$1" ]; then