Remove obsolete way of generating target ebin subdirectories

As per @tuncer: "That's most likely a vestige of package module support".
This commit is contained in:
David Kubecka 2015-03-31 23:36:30 +02:00
parent c7a2b450bb
commit ee5a75cb33

View file

@ -327,6 +327,9 @@ needed_files(G, OutDir, SourceFiles) ->
digraph:vertex(G, Source) > {Source, filelib:last_modified(Target)} digraph:vertex(G, Source) > {Source, filelib:last_modified(Target)}
end, SourceFiles). end, SourceFiles).
target_base(OutDir, Source) ->
filename:join(OutDir, filename:basename(Source, ".erl")).
erlcinfo_file() -> erlcinfo_file() ->
filename:join([rebar_utils:get_cwd(), ".rebar", ?ERLCINFO_FILE]). filename:join([rebar_utils:get_cwd(), ".rebar", ?ERLCINFO_FILE]).
@ -468,9 +471,8 @@ expand_file_names(Files, Dirs) ->
-spec internal_erl_compile(rebar_config:config(), file:filename(), -spec internal_erl_compile(rebar_config:config(), file:filename(),
file:filename(), list()) -> ok | {ok, any()} | {error, any(), any()}. file:filename(), list()) -> ok | {ok, any()} | {error, any(), any()}.
internal_erl_compile(Config, Source, OutDir, ErlOpts) -> internal_erl_compile(Config, Source, OutDir, ErlOpts) ->
TargetDir = filename:dirname(target_base(OutDir, Source)), ok = filelib:ensure_dir(OutDir),
ok = filelib:ensure_dir(TargetDir), Opts = [{outdir, OutDir}] ++ ErlOpts ++ [{i, "include"}, return],
Opts = [{outdir, TargetDir}] ++ ErlOpts ++ [{i, "include"}, return],
case compile:file(Source, Opts) of case compile:file(Source, Opts) of
{ok, _Mod} -> {ok, _Mod} ->
ok; ok;
@ -480,10 +482,6 @@ internal_erl_compile(Config, Source, OutDir, ErlOpts) ->
rebar_base_compiler:error_tuple(Config, Source, Es, Ws, Opts) rebar_base_compiler:error_tuple(Config, Source, Es, Ws, Opts)
end. end.
target_base(OutDir, Source) ->
Module = filename:basename(Source, ".erl"),
filename:join([OutDir|string:tokens(Module, ".")]).
-spec compile_mib(file:filename(), file:filename(), -spec compile_mib(file:filename(), file:filename(),
rebar_config:config()) -> 'ok'. rebar_config:config()) -> 'ok'.
compile_mib(Source, Target, Config) -> compile_mib(Source, Target, Config) ->