-
Notifications
You must be signed in to change notification settings - Fork 1
/
erl_compile.sh
executable file
·28 lines (25 loc) · 1.07 KB
/
erl_compile.sh
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
#!/usr/bin/env bash
#####################################################################
# @author Tomasz Lichon, Michal Wrzeszcz
# @copyright (C) 2015 ACK CYFRONET AGH
# This software is released under the MIT license
# cited in 'LICENSE.txt'.
#####################################################################
# usage:
# ./erl_compile.sh [MODULE]...
#
# This script compiles modules selected as arguments, and replaces them in
# release: rel/cluster_worker.
#####################################################################
set -e
# for each given module, find its location, compile and copy to releases
for module in $@; do
for dir in src test; do
find ${dir} -type f -name ${module}.erl -exec erlc +debug_info `ls _build/default/lib | awk '{ print "-I _build/default/lib/" $1}'` -I include -I _build/default/lib {} \;
done
for rel_dir in `ls _build/default/rel/cluster_worker/lib/ | grep cluster_worker`; do
cp *.beam _build/default/rel/cluster_worker/lib/${rel_dir}/ebin/
done
cp *.beam _build/default/lib/cluster_worker/ebin/
done
rm *.beam