aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_prv_discover.erl
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2013-10-13 11:17:23 -0500
committerTristan Sloughter <[email protected]>2013-10-15 11:21:34 -0500
commit750c3df605de8e7dc0f4d809e2fe7aa09827eee1 (patch)
tree62ef34c600455bde3d02f51c81fe962fb71171dd /src/rlx_prv_discover.erl
parent9e390a7022b1f5296d4fdb7618d13d843ed26bde (diff)
downloadrelx-750c3df605de8e7dc0f4d809e2fe7aa09827eee1.tar.gz
relx-750c3df605de8e7dc0f4d809e2fe7aa09827eee1.tar.bz2
relx-750c3df605de8e7dc0f4d809e2fe7aa09827eee1.zip
add optoin to use custom system_libs dir. This closes #64
Diffstat (limited to 'src/rlx_prv_discover.erl')
-rw-r--r--src/rlx_prv_discover.erl27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/rlx_prv_discover.erl b/src/rlx_prv_discover.erl
index 0ac4aac..5d09619 100644
--- a/src/rlx_prv_discover.erl
+++ b/src/rlx_prv_discover.erl
@@ -100,22 +100,27 @@ add_common_project_dirs(State) ->
Ebin = filename:join(Root, "ebin"),
lists:foldl(fun(Dir, LibDirs) ->
case ec_file:exists(Dir) of
- true ->
- [erlang:iolist_to_binary(Dir) | LibDirs];
- false ->
- LibDirs
- end
- end, [], [Deps, Lib, Apps, Ebin])
+ true ->
+ [erlang:iolist_to_binary(Dir) | LibDirs];
+ false ->
+ LibDirs
+ end
+ end, [], [Deps, Lib, Apps, Ebin])
end.
-spec add_system_lib_dir(rlx_state:t()) -> [file:name()].
add_system_lib_dir(State) ->
ExcludeSystem = rlx_state:get(State, discover_exclude_system, false),
- case ExcludeSystem of
- true ->
- [];
- false ->
- erlang:iolist_to_binary(code:lib_dir())
+ case rlx_state:get(State, system_libs, undefined) of
+ undefined ->
+ case ExcludeSystem of
+ true ->
+ [];
+ false ->
+ erlang:iolist_to_binary(code:lib_dir())
+ end;
+ SystemLibs ->
+ erlang:iolist_to_binary(SystemLibs)
end.
add_release_output_dir(State) ->