diff --git a/rebar.config b/rebar.config index 202bb0d76..61efd8d83 100644 --- a/rebar.config +++ b/rebar.config @@ -33,7 +33,7 @@ {erl_opts, [{platform_define, "^[0-9]+", namespaced_types}, {platform_define, "^(19|2)", rand_only}, {platform_define, "^2", unicode_str}, - {platform_define, "^2", filelib_find_source}, + {platform_define, "^(2[1-9])|(20\\\\.3)", filelib_find_source}, {platform_define, "^(R|1|20)", fun_stacktrace}, warnings_as_errors ]}. diff --git a/src/rebar_otp_app.erl b/src/rebar_otp_app.erl index e14975f27..f70565741 100644 --- a/src/rebar_otp_app.erl +++ b/src/rebar_otp_app.erl @@ -166,7 +166,7 @@ ebin_modules(AppInfo, Dir) -> Beams = lists:sort(rebar_utils:beams(filename:join(Dir, "ebin"))), SrcDirs = rebar_dir:src_dirs(rebar_app_info:opts(AppInfo), ["src"]), FindSourceRules = [{".beam", ".erl", - [{"ebin", SrcDir} || SrcDir <- SrcDirs]}], + [{"ebin", filename:join(SrcDir, "**")} || SrcDir <- SrcDirs]}], Filtered = lists:filter(fun(Beam) -> rebar_utils:find_source(filename:basename(Beam), filename:dirname(Beam), diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl index 9cbe8a268..a300690c4 100644 --- a/test/rebar_compile_SUITE.erl +++ b/test/rebar_compile_SUITE.erl @@ -2157,7 +2157,13 @@ recursive(Config) -> EbinDir = filename:join([AppDir, "_build", "default", "lib", Name, "ebin"]), {ok, Files} = rebar_utils:list_dir(EbinDir), - ?assert(lists:member("rec.beam",Files)). + ?assert(lists:member("rec.beam",Files)), + + %% check that rec is in modules list of .app file + AppFile = filename:join(EbinDir, Name++".app"), + {ok, [{application, _, List}]} = file:consult(AppFile), + {modules, Modules} = lists:keyfind(modules, 1, List), + ?assert(lists:member(rec, Modules)). no_recursive(Config) -> AppDir = ?config(apps, Config),