summaryrefslogtreecommitdiff
path: root/src/rebar_prv_compile.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-07-06 22:54:43 -0500
committerTristan Sloughter <t@crashfast.com>2015-07-06 22:54:43 -0500
commitb6b32fc64efb3b8a48f144fa850bfef923f66d45 (patch)
tree04dfec24dc917cdf03a45108ce5a2643c250346e /src/rebar_prv_compile.erl
parentd64cb0f86382e8c8040c6ac507fd32ec06b7389c (diff)
ensure necessary directories exist to compile mibs files
Diffstat (limited to 'src/rebar_prv_compile.erl')
-rw-r--r--src/rebar_prv_compile.erl13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rebar_prv_compile.erl b/src/rebar_prv_compile.erl
index 6eb8a4f..25d5193 100644
--- a/src/rebar_prv_compile.erl
+++ b/src/rebar_prv_compile.erl
@@ -126,7 +126,20 @@ copy_app_dirs(State, OldAppDir, AppDir) ->
false ->
ok
end,
+
filelib:ensure_dir(filename:join(AppDir, "dummy")),
+
+ %% link or copy mibs if it exists
+ case filelib:is_dir(filename:join(OldAppDir, "mibs")) of
+ true ->
+ %% If mibs exist it means we must ensure priv exists.
+ %% mibs files are compiled to priv/mibs/
+ filelib:ensure_dir(filename:join([OldAppDir, "priv", "dummy"])),
+ symlink_or_copy(OldAppDir, AppDir, "mibs");
+ false ->
+ ok
+ end,
+
%% link to src_dirs to be adjacent to ebin is needed for R15 use of cover/xref
SrcDirs = rebar_dir:all_src_dirs(State, ["src"], ["test"]),
[symlink_or_copy(OldAppDir, AppDir, Dir) || Dir <- ["priv", "include"] ++ SrcDirs];