Browse Source

remove mib header file in `priv/mibs/include'

pull/967/head
alisdair sullivan 9 years ago
parent
commit
6f70b7fc88
2 changed files with 1 additions and 13 deletions
  1. +1
    -7
      src/rebar_erlc_compiler.erl
  2. +0
    -6
      test/rebar_compile_SUITE.erl

+ 1
- 7
src/rebar_erlc_compiler.erl View File

@ -521,16 +521,12 @@ target_base(OutDir, Source) ->
compile_mib(AppInfo) ->
fun(Source, Target, Opts) ->
Dir = filename:dirname(Target),
IncludeDir = filename:join(Dir, "include"),
Mib = filename:rootname(Target),
HrlFilename = Mib ++ ".hrl",
Hrl = filename:basename(HrlFilename),
AppInclude = filename:join([rebar_app_info:dir(AppInfo), "include"]),
ok = filelib:ensure_dir(Target),
ok = filelib:ensure_dir(filename:join([IncludeDir, "dummy.hrl"])),
ok = filelib:ensure_dir(filename:join([AppInclude, "dummy.hrl"])),
AllOpts = [{outdir, Dir}
@ -547,9 +543,7 @@ compile_mib(AppInfo) ->
#options{specific = [{verbosity, Verbosity}]}
end,
ok = snmpc:mib_to_hrl(Mib, Mib, MibToHrlOpts),
rebar_file_utils:mv(HrlFilename, IncludeDir),
rebar_file_utils:symlink_or_copy(filename:join([IncludeDir, Hrl]),
filename:join([AppInclude, Hrl])),
rebar_file_utils:mv(HrlFilename, AppInclude),
ok;
{error, compilation_failed} ->
?FAIL

+ 0
- 6
test/rebar_compile_SUITE.erl View File

@ -1022,9 +1022,6 @@ mib_test(Config) ->
PrivMibsDir = filename:join([AppDir, "_build", "default", "lib", Name, "priv", "mibs"]),
true = filelib:is_file(filename:join([PrivMibsDir, "SIMPLE-MIB.bin"])),
%% check a hrl corresponding to the mib in the mibs dir exists in priv/mibs/include
true = filelib:is_file(filename:join([PrivMibsDir, "include", "SIMPLE-MIB.hrl"])),
%% check a hrl corresponding to the mib in the mibs dir exists in include
true = filelib:is_file(filename:join([AppDir, "include", "SIMPLE-MIB.hrl"])),
@ -1075,9 +1072,6 @@ umbrella_mib_first_test(Config) ->
PrivMibsDir = filename:join([AppsDir, "_build", "default", "lib", Name, "priv", "mibs"]),
true = filelib:is_file(filename:join([PrivMibsDir, "SIMPLE-MIB.bin"])),
%% check a hrl corresponding to the mib in the mibs dir exists in priv/mibs/include
true = filelib:is_file(filename:join([PrivMibsDir, "include", "SIMPLE-MIB.hrl"])),
%% check a hrl corresponding to the mib in the mibs dir exists in include
true = filelib:is_file(filename:join([AppDir, "include", "SIMPLE-MIB.hrl"])),

Loading…
Cancel
Save