diff options
author | alisdair sullivan <alisdairsullivan@yahoo.ca> | 2017-01-21 09:53:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-21 09:53:15 -0800 |
commit | 6a1cfaf9483e93b5410a21e4967d53f0ecf4b3c0 (patch) | |
tree | 49a1515f9e74f506d973fd16aab40eb1a916ea62 /src/rebar_base_compiler.erl | |
parent | e3f08361b66df8f7a4b33402a62ce739c791b422 (diff) | |
parent | f16fdd35be2d0d6acb0a4b3448b12d7796751b80 (diff) |
Merge pull request #1450 from ferd/relative-dialyzer-paths
Relative dialyzer paths
Diffstat (limited to 'src/rebar_base_compiler.erl')
-rw-r--r-- | src/rebar_base_compiler.erl | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/rebar_base_compiler.erl b/src/rebar_base_compiler.erl index dcb1975..480e49c 100644 --- a/src/rebar_base_compiler.erl +++ b/src/rebar_base_compiler.erl @@ -35,7 +35,6 @@ error_tuple/4, format_error_source/2]). --define(DEFAULT_COMPILER_SOURCE_FORMAT, relative). -type desc() :: term(). -type loc() :: {line(), col()} | line(). -type line() :: integer(). @@ -138,28 +137,7 @@ error_tuple(Source, Es, Ws, Opts) -> -spec format_error_source(file:filename(), rebar_dict() | [{_,_}]) -> file:filename(). format_error_source(Path, Opts) -> - Type = case rebar_opts:get(Opts, compiler_source_format, - ?DEFAULT_COMPILER_SOURCE_FORMAT) of - V when V == absolute; V == relative; V == build -> - V; - Other -> - ?WARN("Invalid argument ~p for compiler_source_format - " - "assuming ~s~n", [Other, ?DEFAULT_COMPILER_SOURCE_FORMAT]), - ?DEFAULT_COMPILER_SOURCE_FORMAT - end, - case Type of - absolute -> resolve_linked_source(Path); - build -> Path; - relative -> - Cwd = rebar_dir:get_cwd(), - rebar_dir:make_relative_path(resolve_linked_source(Path), Cwd) - end. - -%% @private takes a filename and canonicalizes its path if it is a link. --spec resolve_linked_source(file:filename()) -> file:filename(). -resolve_linked_source(Src) -> - {Dir, Base} = rebar_file_utils:split_dirname(Src), - filename:join(rebar_file_utils:resolve_link(Dir), Base). + rebar_dir:format_source_file_name(Path, Opts). %% =================================================================== %% Internal functions |