From 7f60448d333b2fa78de2de14f0f047eb12116bc9 Mon Sep 17 00:00:00 2001 From: James Fish Date: Thu, 5 Mar 2015 14:10:09 +0000 Subject: Change default project PLT location to base directory Previously dialyzer stored the project PLT in ./build/, which meant the same PLT was used for all profiles. This could mean partial rebuilding of a PLT when switching between profiles. --- src/rebar_prv_dialyzer.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl index 9d2c10a..7268f06 100644 --- a/src/rebar_prv_dialyzer.erl +++ b/src/rebar_prv_dialyzer.erl @@ -86,8 +86,8 @@ format_error(Reason) -> %% Internal functions get_plt_location(State) -> - BuildDir = rebar_state:get(State, base_dir, ?DEFAULT_BASE_DIR), - DefaultPlt = filename:join([BuildDir, default_plt()]), + BaseDir = rebar_dir:base_dir(State), + DefaultPlt = filename:join(BaseDir, default_plt()), rebar_state:get(State, dialyzer_plt, DefaultPlt). default_plt() -> -- cgit v1.1 From 53e43298ba7c79a2a9df69e8bc9e196186b6e925 Mon Sep 17 00:00:00 2001 From: James Fish Date: Thu, 5 Mar 2015 14:11:53 +0000 Subject: Fix dialyzer active otp release detection --- src/rebar_prv_dialyzer.erl | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src') diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl index 7268f06..f140f1b 100644 --- a/src/rebar_prv_dialyzer.erl +++ b/src/rebar_prv_dialyzer.erl @@ -91,24 +91,7 @@ get_plt_location(State) -> rebar_state:get(State, dialyzer_plt, DefaultPlt). default_plt() -> - ".rebar3.otp-" ++ otp_version() ++ ".plt". - -otp_version() -> - Release = erlang:system_info(otp_release), - try otp_version(Release) of - Vsn -> - Vsn - catch - error:_ -> - Release - end. - -otp_version(Release) -> - File = filename:join([code:root_dir(), "releases", Release, "OTP_VERSION"]), - {ok, Contents} = file:read_file(File), - [Vsn] = binary:split(Contents, [<<$\n>>], [global, trim]), - [_ | _] = unicode:characters_to_list(Vsn). - + ".rebar3.otp-" ++ rebar_utils:otp_release() ++ ".plt". do(State, Plt, Apps) -> {PltWarnings, State1} = update_proj_plt(State, Plt, Apps), -- cgit v1.1 From 37850ed819861cfc72d1106e1ef7e298813b22d9 Mon Sep 17 00:00:00 2001 From: James Fish Date: Thu, 5 Mar 2015 14:39:38 +0000 Subject: Shorten default PLT name --- src/rebar_prv_dialyzer.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl index f140f1b..4b6812f 100644 --- a/src/rebar_prv_dialyzer.erl +++ b/src/rebar_prv_dialyzer.erl @@ -91,7 +91,7 @@ get_plt_location(State) -> rebar_state:get(State, dialyzer_plt, DefaultPlt). default_plt() -> - ".rebar3.otp-" ++ rebar_utils:otp_release() ++ ".plt". + rebar_utils:otp_release() ++ ".plt". do(State, Plt, Apps) -> {PltWarnings, State1} = update_proj_plt(State, Plt, Apps), -- cgit v1.1