Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use apps directory for the apps

Create a temporary apps directory for the OpenACD and
include_apps for lib_dir
  • Loading branch information...
commit 7b8d7f5870e164b1e36987a22b36ff730baa8341 1 parent 1fb9b20
@jvliwanag jvliwanag authored
View
3  .gitignore
@@ -27,6 +27,7 @@ ebin
OpenACD/
include/commit_ver.hrl
+apps/*
include_apps/**/doc
# unique config files
@@ -65,4 +66,4 @@ install-sh
missing
#editor swap files
-*~
+*~
View
42 hooks.sh
@@ -12,11 +12,11 @@ function pre_compile {
# record what commit/version openacd is at
OPENACD_COMMIT=""
- if [ -d ".git" ]
+ if [ -d "$BASEDIR/.git" ]
then
OPENACD_COMMIT=`git log -1 --pretty=format:%H`
fi
- if [ -e "include/commit_ver.hrl" ] && [ ! $OPENACD_COMMIT ]
+ if [ -e "$BASEDIR/include/commit_ver.hrl" ] && [ ! $OPENACD_COMMIT ]
then
exit 0
else
@@ -30,7 +30,7 @@ function pre_compile {
echo "%% automatically generated by OpenACD precompile script. Editing means
%% it will just get overwritten again.
--define(OPENACD_COMMIT, $OPENACD_COMMIT)." > include/commit_ver.hrl
+-define(OPENACD_COMMIT, $OPENACD_COMMIT)." > "$BASEDIR"/include/commit_ver.hrl
}
function pre_get-deps {
@@ -42,21 +42,29 @@ function pre_get-deps {
fi
}
-function pre_generate {
- # hack for reltool
- oaDir="$BASEDIR/OpenACD"
- if [ ! -d "$oaDir" ]; then
+function post_get-deps {
+ # needed by rebar to be added to lib path
+ mkdir -p "$BASEDIR/ebin"
+
+ # create temp apps directory
+ appsDir="$BASEDIR/apps"
+ if [ ! -d "$appsDir" ]; then
+ mkdir -p "$appsDir"
+ ln -s "$BASEDIR"/include_apps/* "$appsDir"
+
+ oaDir="$appsDir"/OpenACD
mkdir "$oaDir"
- ln -sf ../ebin "$oaDir"/ebin
- ln -sf ../src "$oaDir"/src
- ln -sf ../include "$oaDir"/include
- ln -sf ../priv "$oaDir"/priv
- ln -sf ../deps "$oaDir"/deps
+ ln -sf "$BASEDIR"/ebin "$oaDir"/ebin
+ ln -sf "$BASEDIR"/src "$oaDir"/src
+ ln -sf "$BASEDIR"/include "$oaDir"/include
+ ln -sf "$BASEDIR"/priv "$oaDir"/priv
+ ln -sf "$BASEDIR"/deps "$oaDir"/deps
fi
}
-function post_generate {
- rm -rf "$BASEDIR/OpenACD"
+function post_clean {
+ appsDir="$BASEDIR/apps"
+ rm -Rf "$appsDir"
}
case "$1" in
@@ -68,12 +76,6 @@ case "$1" in
pre_compile;;
"post_compile")
post_compile;;
- "pre_clean")
- pre_clean;;
"post_clean")
post_clean;;
- "pre_generate")
- pre_generate;;
- "post_generate")
- post_generate;;
esac
View
2  include_apps/oacd_dummy/rebar.config
@@ -1,6 +1,6 @@
{erl_opts, [{src_dirs, ["contrib/"]}]}.
-{lib_dirs, ["../.."]}.
+{lib_dirs, ["../../apps"]}.
{post_hooks, [{compile, "cat success_message"}]}.
View
3  include_apps/oacd_freeswitch/rebar.config
@@ -1,7 +1,6 @@
{erl_opts, [{src_dirs, ["contrib/"]}]}.
-%{sub_dirs, ["rel"]}.
-{lib_dirs, ["../..", "../../deps"]}.
+{lib_dirs, ["../../apps", "../../deps"]}.
{post_hooks, [{compile, "./hooks.sh post_compile"}]}.
View
5 rebar.config
@@ -24,11 +24,12 @@
]}.
{pre_hooks, [
- {compile, "./hooks.sh pre_compile"},
{'get-deps', "./hooks.sh pre_get-deps"},
- {clean, "./hooks.sh pre_clean"}
+ {'compile', "./hooks.sh pre_compile"}
]}.
{post_hooks, [
+ {'get-deps', "./hooks.sh post_get-deps"},
+ {clean, "./hooks.sh post_clean"}
]}.
{cover_enabled, true}.
View
2  rel/reltool.config
@@ -1,5 +1,5 @@
{sys, [
- {lib_dirs, ["../deps", "..", "../include_apps"]},
+ {lib_dirs, ["../deps", "../apps"]},
{rel, "openacd", "1",
[
kernel,
Please sign in to comment.
Something went wrong with that request. Please try again.