diff options
author | Tristan Sloughter <[email protected]> | 2013-09-18 20:15:32 -0500 |
---|---|---|
committer | Tristan Sloughter <[email protected]> | 2013-09-19 20:26:25 -0500 |
commit | 0d1dfed1ac0a1868d943e0174fce9f8bf49e448b (patch) | |
tree | 5b7ec9e8819b4a6ceb9c1b87f8db3a77ba4f127d | |
parent | daeae596b93605265273fd474407865211039204 (diff) | |
download | relx-0d1dfed1ac0a1868d943e0174fce9f8bf49e448b.tar.gz relx-0d1dfed1ac0a1868d943e0174fce9f8bf49e448b.tar.bz2 relx-0d1dfed1ac0a1868d943e0174fce9f8bf49e448b.zip |
add lib_dirs option to for config file, same as -l cli arg
-rw-r--r-- | src/rlx_prv_config.erl | 5 | ||||
-rw-r--r-- | src/rlx_state.erl | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/rlx_prv_config.erl b/src/rlx_prv_config.erl index c6b264a..346b7c8 100644 --- a/src/rlx_prv_config.erl +++ b/src/rlx_prv_config.erl @@ -127,6 +127,11 @@ load_terms({default_release, RelName, RelVsn}, {ok, State}) -> load_terms({paths, Paths}, {ok, State}) -> code:add_pathsa([filename:absname(Path) || Path <- Paths]), {ok, State}; +load_terms({lib_dirs, Dirs}, {ok, State}) -> + State2 = + rlx_state:add_lib_dirs(State, + [list_to_binary(filename:absname(Dir)) || Dir <- Dirs]), + {ok, State2}; load_terms({providers, Providers0}, {ok, State0}) -> Providers1 = gen_providers(Providers0, State0), case Providers1 of diff --git a/src/rlx_state.erl b/src/rlx_state.erl index 6d3c4ee..138705c 100644 --- a/src/rlx_state.erl +++ b/src/rlx_state.erl @@ -28,6 +28,7 @@ actions/1, output_dir/1, lib_dirs/1, + add_lib_dirs/2, overrides/1, overrides/2, skip_apps/1, @@ -152,7 +153,6 @@ overrides(#state_t{overrides=Overrides}) -> overrides(State, Overrides) -> State#state_t{overrides=Overrides}. - -spec skip_apps(t()) -> [AppName::atom()]. skip_apps(#state_t{skip_apps=Apps}) -> Apps. @@ -175,6 +175,10 @@ output_dir(#state_t{output_dir=OutDir}) -> lib_dirs(#state_t{lib_dirs=LibDir}) -> LibDir. +-spec add_lib_dirs(t(), [file:name()]) -> t(). +add_lib_dirs(State=#state_t{lib_dirs=LibDir}, Dirs) -> + State#state_t{lib_dirs=lists:merge(lists:sort(LibDir), lists:sort(Dirs))}. + -spec goals(t()) -> [rlx_depsolver:constraint()]. goals(#state_t{goals=TS}) -> TS. |