diff options
| author | Fred Hebert <mononcqc@ferd.ca> | 2017-09-01 15:41:58 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-01 15:41:58 -0400 | 
| commit | 03f6f634f03de894c2322e9df3b2b3b36d102a4f (patch) | |
| tree | 18d8502decd7c46f5b417c894135111bc8fc3ee5 /src | |
| parent | af3d3b73c0676f061c7c26a628059f48213f135d (diff) | |
| parent | 7c959ccb4f91cdfdb956aa090b3789cf8fd396ed (diff) | |
Merge pull request #1624 from ferd/fix-rel-srcdirs
Fix relative src_dir specifications to avoid double .app.src file detection
Diffstat (limited to 'src')
| -rw-r--r-- | src/rebar_dir.erl | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/src/rebar_dir.erl b/src/rebar_dir.erl index d0c7805..7a779d1 100644 --- a/src/rebar_dir.erl +++ b/src/rebar_dir.erl @@ -258,8 +258,11 @@ extra_src_dirs(Opts, Default) ->  %% @private agnostic version of src_dirs and extra_src_dirs.  src_dirs(Type, Opts, Default) -> -    lists:usort([case D0 of {D,_} -> D; _ -> D0 end || -                    D0 <- raw_src_dirs(Type,Opts,Default)]). +    lists:usort([ +        case D0 of +            {D,_} -> normalize_relative_path(D); +            _ -> normalize_relative_path(D0) +        end || D0 <- raw_src_dirs(Type,Opts,Default)]).  %% @private extracts the un-formatted src_dirs or extra_src_dirs  %% options as configured. @@ -271,6 +274,10 @@ raw_src_dirs(Type, Opts, Default) ->          Dirs -> Dirs      end. +%% @private normalizes relative paths so that ./a/b/c/ => a/b/c +normalize_relative_path(Path) -> +    make_normalized_path(filename:split(Path), []). +  %% @doc returns all the source directories (`src_dirs' and  %% `extra_src_dirs').  -spec all_src_dirs(rebar_dict()) -> list(file:filename_all()). | 
