aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2016-10-06 16:30:47 -0700
committerGitHub <[email protected]>2016-10-06 16:30:47 -0700
commit5bcd6a75dc07844dafb01e4ed5efa3357f059251 (patch)
tree70a6fe711aa21ece0a8b51dbe478b7e0898ab2e7
parentabe7a10c1b3b6c6d5618073e98ea50539300ec81 (diff)
parent4620171a7c2991a420228984864f209aa7aba30f (diff)
downloadrelx-5bcd6a75dc07844dafb01e4ed5efa3357f059251.tar.gz
relx-5bcd6a75dc07844dafb01e4ed5efa3357f059251.tar.bz2
relx-5bcd6a75dc07844dafb01e4ed5efa3357f059251.zip
Merge pull request #520 from lrascao/feature/dialyzer_profile
Feature/dialyzer profile
-rw-r--r--rebar.config12
-rw-r--r--src/rlx_app_discovery.erl2
-rw-r--r--src/rlx_app_info.erl14
-rw-r--r--src/rlx_release.erl2
4 files changed, 20 insertions, 10 deletions
diff --git a/rebar.config b/rebar.config
index bb179ea..5cdd869 100644
--- a/rebar.config
+++ b/rebar.config
@@ -21,6 +21,9 @@
warnings_as_errors,
inline]}.
+%% Use OTP 18+ when dialyzing relx
+{dialyzer, [{warnings, [unknown]}]}.
+
%% EUnit =======================================================================
{eunit_opts,
[{report, {eunit_surefire, [{dir, "."}]}}]}.
@@ -29,7 +32,14 @@
{profiles, [{dev, [{plugins, [rebar3_neotoma_plugin]}]},
- {test, [{erl_opts, [debug_info]}]}
+ {test, [{erl_opts, [debug_info]}]},
+
+ {dialyze, [{overrides, [{add, erlware_commons, [{erl_opts, [debug_info]}]},
+ {add, providers, [{erl_opts, [debug_info]}]},
+ {add, getopt, [{erl_opts, [debug_info]}]},
+ {add, bbmustache, [{erl_opts, [debug_info]}]},
+ {add, cf, [{erl_opts, [debug_info]}]}]},
+ {erl_opts, [debug_info]}]}
]}.
{overrides, [{override, erlware_commons, [
diff --git a/src/rlx_app_discovery.erl b/src/rlx_app_discovery.erl
index dcd2604..56ac59c 100644
--- a/src/rlx_app_discovery.erl
+++ b/src/rlx_app_discovery.erl
@@ -290,7 +290,7 @@ get_vsn(AppDir, AppName, AppDetail) ->
end
end.
--spec get_deps(file:name(), atom(), string(), proplists:proplist()) ->
+-spec get_deps(binary(), atom(), string(), proplists:proplist()) ->
{ok, rlx_app_info:t()} | {error, Reason::term()}.
get_deps(AppDir, AppName, AppVsn, AppDetail) ->
ActiveApps = proplists:get_value(applications, AppDetail, []),
diff --git a/src/rlx_app_info.erl b/src/rlx_app_info.erl
index b3402d0..f44dbb5 100644
--- a/src/rlx_app_info.erl
+++ b/src/rlx_app_info.erl
@@ -61,9 +61,9 @@
-include("relx.hrl").
-record(app_info_t, {name :: atom(),
- original_vsn :: string(),
- vsn :: ec_semver:semver(),
- dir :: binary(),
+ original_vsn :: undefined | string(),
+ vsn :: undefined | ec_semver:semver(),
+ dir :: undefined | binary(),
link=false :: boolean(),
active_deps=[]:: [atom()],
library_deps=[] :: [atom()]}).
@@ -83,13 +83,13 @@ new() ->
{ok, #app_info_t{}}.
%% @doc build a complete version of the app info with all fields set.
--spec new(atom(), string(), file:name(), [atom()], [atom()]) ->
+-spec new(atom(), string(), binary(), [atom()], [atom()]) ->
{ok, t()} | relx:error().
new(AppName, Vsn, Dir, ActiveDeps, LibraryDeps) ->
new(AppName, Vsn, Dir, ActiveDeps, LibraryDeps, false).
%% @doc build a complete version of the app info with all fields set.
--spec new(atom(), string(), file:name(), [atom()], [atom()], boolean()) ->
+-spec new(atom(), string(), binary(), [atom()], [atom()], boolean()) ->
{ok, t()} | relx:error().
new(AppName, Vsn, Dir, ActiveDeps, LibraryDeps, Link)
when erlang:is_atom(AppName),
@@ -138,10 +138,10 @@ vsn(AppInfo=#app_info_t{name=AppName}, AppVsn)
{ok, AppInfo#app_info_t{vsn=ParsedVsn}}
end.
--spec dir(t()) -> file:name().
+-spec dir(t()) -> binary().
dir(#app_info_t{dir=Dir}) ->
Dir.
--spec dir(t(), file:name()) -> t().
+-spec dir(t(), binary()) -> t().
dir(AppInfo=#app_info_t{}, Dir) ->
AppInfo#app_info_t{dir=Dir}.
diff --git a/src/rlx_release.erl b/src/rlx_release.erl
index dc39e34..0260402 100644
--- a/src/rlx_release.erl
+++ b/src/rlx_release.erl
@@ -59,7 +59,7 @@
-record(release_t, {name :: atom(),
vsn :: ec_semver:any_version(),
- erts :: ec_semver:any_version(),
+ erts :: undefined | ec_semver:any_version(),
goals = [] :: [rlx_depsolver:constraint()],
realized = false :: boolean(),
annotations = undefined :: annotations(),