summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-09-09 22:09:11 -0400
committerFred Hebert <mononcqc@ferd.ca>2015-09-09 22:09:11 -0400
commitebb919f228ab694ddd6c114fb6dc66989e7d8707 (patch)
tree372b2060630fab11f691041ef9fb60a9a21e900a
parent6eb28a94ca87f7d1e0ed9bde45b98b15ab1fcd5b (diff)
parent14ab5f562efdcbaac54732c3776af4f5acbae1d9 (diff)
Merge pull request #787 from tsloughter/dialyzer_cleanup
fix dialyzer warnings
-rw-r--r--src/rebar_app_utils.erl2
-rw-r--r--src/rebar_erlc_compiler.erl6
-rw-r--r--src/rebar_plugins.erl2
-rw-r--r--src/rebar_prv_clean.erl2
-rw-r--r--src/rebar_prv_dialyzer.erl2
-rw-r--r--src/rebar_prv_install_deps.erl2
-rw-r--r--src/rebar_prv_path.erl8
7 files changed, 11 insertions, 13 deletions
diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl
index 008abc5..de13020 100644
--- a/src/rebar_app_utils.erl
+++ b/src/rebar_app_utils.erl
@@ -90,7 +90,7 @@ validate_application_info(AppInfo, AppDetail) ->
end
end.
--spec parse_deps(binary(), list(), rebar_state:t(), list(), integer()) -> {[rebar_app_info:t()], [tuple()]}.
+-spec parse_deps(binary(), list(), rebar_state:t(), list(), integer()) -> [rebar_app_info:t()].
parse_deps(DepsDir, Deps, State, Locks, Level) ->
parse_deps(root, DepsDir, Deps, State, Locks, Level).
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 0fc5455..54faea4 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -28,7 +28,7 @@
-export([compile/1,
compile/3,
- clean/2]).
+ clean/1]).
-include("rebar.hrl").
-include_lib("stdlib/include/erl_compile.hrl").
@@ -104,8 +104,8 @@ compile(Opts, Dir, OutDir) ->
fun compile_mib/3),
doterl_compile(Opts, Dir, OutDir).
--spec clean(rebar_dict(), file:filename()) -> 'ok'.
-clean(_Opts, AppDir) ->
+-spec clean(file:filename()) -> 'ok'.
+clean(AppDir) ->
MibFiles = rebar_utils:find_files(filename:join(AppDir, "mibs"), ?RE_PREFIX".*\\.mib\$"),
MIBs = [filename:rootname(filename:basename(MIB)) || MIB <- MibFiles],
rebar_file_utils:delete_each(
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl
index 80f62f5..f2d3977 100644
--- a/src/rebar_plugins.erl
+++ b/src/rebar_plugins.erl
@@ -26,7 +26,7 @@ project_apps_install(State) ->
lists:foldl(fun(AppInfo, StateAcc2) ->
C = rebar_config:consult(rebar_app_info:dir(AppInfo)),
AppInfo0 = rebar_app_info:update_opts(AppInfo, rebar_app_info:opts(AppInfo), C),
- Plugins2 = rebar_state:get(AppInfo0, {plugins, Profile}, []),
+ Plugins2 = rebar_app_info:get(AppInfo0, {plugins, Profile}, []),
handle_plugins(Profile, Plugins2, StateAcc2)
end, StateAcc1, ProjectApps)
end, State, Profiles).
diff --git a/src/rebar_prv_clean.erl b/src/rebar_prv_clean.erl
index 8bdea4d..a2b537a 100644
--- a/src/rebar_prv_clean.erl
+++ b/src/rebar_prv_clean.erl
@@ -66,7 +66,7 @@ clean_apps(State, Providers, Apps) ->
?INFO("Cleaning out ~s...", [rebar_app_info:name(AppInfo)]),
AppDir = rebar_app_info:dir(AppInfo),
AppInfo1 = rebar_hooks:run_all_hooks(AppDir, pre, ?PROVIDER, Providers, AppInfo, State),
- rebar_erlc_compiler:clean(State, rebar_app_info:out_dir(AppInfo1)),
+ rebar_erlc_compiler:clean(rebar_app_info:out_dir(AppInfo1)),
rebar_hooks:run_all_hooks(AppDir, post, ?PROVIDER, Providers, AppInfo1, State)
end || AppInfo <- Apps].
diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl
index 1cf7b71..7f26487 100644
--- a/src/rebar_prv_dialyzer.erl
+++ b/src/rebar_prv_dialyzer.erl
@@ -313,7 +313,7 @@ get_base_plt(State) ->
Name = plt_name(Prefix),
case get_config(State, base_plt_location, global) of
global ->
- GlobalCacheDir = rebar_dir:global_cache_dir(State),
+ GlobalCacheDir = rebar_dir:global_cache_dir(rebar_state:opts(State)),
filename:join(GlobalCacheDir, Name);
Dir ->
filename:join(Dir, Name)
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 6c39423..b6b36e2 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -249,7 +249,7 @@ update_unseen_dep(AppInfo, Profile, Level, Deps, Apps, State, Upgrade, Seen, Loc
AppInfo3 = rebar_app_info:dep_level(AppInfo2, Level),
{NewDeps ++ Deps, [AppInfo3 | Apps], State2, NewSeen}.
--spec handle_dep(rebar_state:t(), atom(), file:filename_all(), rebar_app_info:t(), list(), integer()) -> {rebar_app_info:t(), [rebar_app_info:t()], [pkg_dep()], [integer()], rebar_state:t()}.
+-spec handle_dep(rebar_state:t(), atom(), file:filename_all(), rebar_app_info:t(), list(), integer()) -> {rebar_app_info:t(), [rebar_app_info:t()], rebar_state:t()}.
handle_dep(State, Profile, DepsDir, AppInfo, Locks, Level) ->
Profiles = rebar_state:current_profiles(State),
Name = rebar_app_info:name(AppInfo),
diff --git a/src/rebar_prv_path.erl b/src/rebar_prv_path.erl
index 2a59ae4..37c9834 100644
--- a/src/rebar_prv_path.erl
+++ b/src/rebar_prv_path.erl
@@ -40,10 +40,8 @@ do(State) ->
Paths = lists:filter(fun({app, _}) -> false; ({separator, _}) -> false; (_) -> true end, RawOpts),
%% if no paths requested in opts print the base_dir instead
P = case Paths of [] -> [{ebin, true}]; _ -> Paths end,
- case paths(P, Apps, State, []) of
- ok -> {ok, State};
- {error, Error} -> {error, Error}
- end.
+ paths(P, Apps, State, []),
+ {ok, State}.
-spec format_error(any()) -> iolist().
format_error(Reason) ->
@@ -124,4 +122,4 @@ help(lib) -> "Return the `lib' path of the current profile.";
help(priv) -> "Return the `priv' path of the current profile's applications.";
help(separator) -> "In case of multiple return paths, the separator character to use to join them.";
help(src) -> "Return the `src' path of the current profile's applications.";
-help(rel) -> "Return the `rel' path of the current profile.". \ No newline at end of file
+help(rel) -> "Return the `rel' path of the current profile.".