Browse Source

Merge branch 'hommeabeil-fix_skip_compile_dep'

pull/1737/head
Fred Hebert 7 years ago
parent
commit
8b061497e2
7 changed files with 59 additions and 5 deletions
  1. +4
    -3
      src/rebar_app_discover.erl
  2. +15
    -2
      systest/all_SUITE.erl
  3. +8
    -0
      systest/all_SUITE_data/compile_deps/rebar.config
  4. +2
    -0
      systest/all_SUITE_data/compile_deps/rebar.config.script
  5. +2
    -0
      systest/all_SUITE_data/compile_deps/vendored/fake_dep/rebar.config
  6. +15
    -0
      systest/all_SUITE_data/compile_deps/vendored/fake_dep/src/fake_dep.app.src
  7. +13
    -0
      systest/all_SUITE_data/compile_deps/vendored/fake_dep/src/fake_dep.erl

+ 4
- 3
src/rebar_app_discover.erl View File

@ -411,12 +411,13 @@ try_handle_app_src_file(_AppInfo, _, _AppDir, _AppSrcFile, valid) ->
false;
try_handle_app_src_file(AppInfo, _, AppDir, [File], Validate) when Validate =:= invalid
; Validate =:= all ->
AppInfo1 = create_app_info(AppInfo, AppDir, File),
AppInfo1 = rebar_app_info:app_file(AppInfo, undefined),
AppInfo2 = create_app_info(AppInfo1, AppDir, File),
case filename:extension(File) of
".script" ->
{true, rebar_app_info:app_file_src_script(AppInfo1, File)};
{true, rebar_app_info:app_file_src_script(AppInfo2, File)};
_ ->
{true, rebar_app_info:app_file_src(AppInfo1, File)}
{true, rebar_app_info:app_file_src(AppInfo2, File)}
end;
try_handle_app_src_file(_AppInfo, _, _AppDir, Other, _Validate) ->
throw({error, {multiple_app_files, Other}}).

+ 15
- 2
systest/all_SUITE.erl View File

@ -12,7 +12,7 @@ init_per_suite(Config) ->
["rebar", Vsn | _] ->
%% Copy all base cases to priv_dir
rebar_file_utils:cp_r([?config(data_dir, Config)],
?config(priv_dir, Config)),
?config(priv_dir, Config)),
Config;
_ ->
{skip, "expected current version "++Vsn++" in path "
@ -29,7 +29,7 @@ end_per_testcase(_Name, Config) ->
Config.
all() ->
[noop, resource_plugins, alias_clash, grisp_explode].
[noop, resource_plugins, alias_clash, grisp_explode, compile_deps].
%groups() ->
% [{plugins, [shuffle], []},
@ -79,6 +79,19 @@ grisp_explode(Config) ->
),
ok.
compile_deps() ->
[{doc, "When compiling a project multiple times, the deps should always be built event if refetched"}].
compile_deps(Config) ->
rebar3("compile", Config),
rebar3("compile", Config),
PrivDir = ?config(path, Config),
EbinDir = filename:join([PrivDir, "_build", "default", "lib", "fake_dep", "ebin"]),
{ok, Beams} = file:list_dir(EbinDir),
?assert(length(Beams) > 1).
%%%%%%%%%%%%%%%
%%% Helpers %%%
%%%%%%%%%%%%%%%

+ 8
- 0
systest/all_SUITE_data/compile_deps/rebar.config View File

@ -0,0 +1,8 @@
{deps, [
{fake_dep, {localdep, "fake_dep"}}
]}.
{plugins, [{rebar_localdep,
{git, "https://github.com/alinpopa/rebar3-localdep-plugin.git",
{branch, "master"}}}]}.

+ 2
- 0
systest/all_SUITE_data/compile_deps/rebar.config.script View File

@ -0,0 +1,2 @@
os:putenv("LOCALDEP_DIR", "./vendored/").
CONFIG.

+ 2
- 0
systest/all_SUITE_data/compile_deps/vendored/fake_dep/rebar.config View File

@ -0,0 +1,2 @@
{erl_opts, [debug_info]}.
{deps, []}.

+ 15
- 0
systest/all_SUITE_data/compile_deps/vendored/fake_dep/src/fake_dep.app.src View File

@ -0,0 +1,15 @@
{application, fake_dep,
[{description, "An OTP library"},
{vsn, "0.1.0"},
{registered, []},
{applications,
[kernel,
stdlib
]},
{env,[]},
{modules, []},
{maintainers, []},
{licenses, ["Apache 2.0"]},
{links, []}
]}.

+ 13
- 0
systest/all_SUITE_data/compile_deps/vendored/fake_dep/src/fake_dep.erl View File

@ -0,0 +1,13 @@
-module(fake_dep).
%% API exports
-export([]).
%%====================================================================
%% API functions
%%====================================================================
%%====================================================================
%% Internal functions
%%====================================================================

Loading…
Cancel
Save