aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_rel_discovery.erl
diff options
context:
space:
mode:
authorKonrad Kaplita <[email protected]>2013-11-18 13:54:07 +0100
committerKonrad Kaplita <[email protected]>2013-12-03 12:14:11 +0100
commit95c4565d078033c18561813c48c20de11ed9ab88 (patch)
tree1ced40925aef4edf196ec3040b571f187f0272ef /src/rlx_rel_discovery.erl
parent04a0d907ae17cdc9b9c62130a009138b8580ff43 (diff)
downloadrelx-95c4565d078033c18561813c48c20de11ed9ab88.tar.gz
relx-95c4565d078033c18561813c48c20de11ed9ab88.tar.bz2
relx-95c4565d078033c18561813c48c20de11ed9ab88.zip
Add option to skip release discovery
`rlx_prv_discover` provider recursively scans all directories in `lib_dirs` list looking for `*.app` and `*.rel` files. This commit adds an option `disable_rel_discovery` to skip searching for `*.rel` files when we know there aren't any. This speeds up release generation with a lot of dependencies on the `libs_dir` list significantly and reduces total release generation time in half.
Diffstat (limited to 'src/rlx_rel_discovery.erl')
-rw-r--r--src/rlx_rel_discovery.erl18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/rlx_rel_discovery.erl b/src/rlx_rel_discovery.erl
index 837ebe6..23c0ab9 100644
--- a/src/rlx_rel_discovery.erl
+++ b/src/rlx_rel_discovery.erl
@@ -38,12 +38,18 @@
-spec do(rlx_state:t(), [file:name()], [rlx_app_info:t()]) ->
{ok, [rlx_release:t()]} | relx:error().
do(State, LibDirs, AppMeta) ->
- ec_cmd_log:info(rlx_state:log(State),
- fun() ->
- ["Resolving available OTP Releases from directories:\n",
- string:join([[rlx_util:indent(2), LibDir] || LibDir <- LibDirs], "\n")]
- end),
- resolve_rel_metadata(State, LibDirs, AppMeta).
+ case rlx_state:get(State, disable_rel_discovery, false) of
+ true ->
+ ec_cmd_log:debug(rlx_state:log(State), "Disbaled resolving of OTP releases"),
+ {ok, []};
+ false ->
+ ec_cmd_log:info(rlx_state:log(State),
+ fun() ->
+ ["Resolving available OTP Releases from directories:\n",
+ string:join([[rlx_util:indent(2), LibDir] || LibDir <- LibDirs], "\n")]
+ end),
+ resolve_rel_metadata(State, LibDirs, AppMeta)
+ end.
-spec format_error([ErrorDetail::term()]) -> iolist().
format_error(ErrorDetails)