mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Deleted trailing whitespace
This commit is contained in:
parent
5cd5870f32
commit
8c85021c1e
12 changed files with 56 additions and 56 deletions
|
@ -46,7 +46,7 @@ main(Args) ->
|
||||||
false ->
|
false ->
|
||||||
ok
|
ok
|
||||||
end,
|
end,
|
||||||
|
|
||||||
case catch(rebar_core:run(Args)) of
|
case catch(rebar_core:run(Args)) of
|
||||||
ok ->
|
ok ->
|
||||||
ok;
|
ok;
|
||||||
|
|
|
@ -68,7 +68,7 @@ get(Config, Key, Default) ->
|
||||||
|
|
||||||
delete(Config, Key) ->
|
delete(Config, Key) ->
|
||||||
Config#config { opts = proplists:delete(Key, Config#config.opts) }.
|
Config#config { opts = proplists:delete(Key, Config#config.opts) }.
|
||||||
|
|
||||||
set_global(Key, Value) ->
|
set_global(Key, Value) ->
|
||||||
application:set_env(rebar_global, Key, Value).
|
application:set_env(rebar_global, Key, Value).
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ filter_flags([Item | Rest], Commands) ->
|
||||||
process_dir(Dir, ParentConfig, Commands) ->
|
process_dir(Dir, ParentConfig, Commands) ->
|
||||||
ok = file:set_cwd(Dir),
|
ok = file:set_cwd(Dir),
|
||||||
Config = rebar_config:new(ParentConfig),
|
Config = rebar_config:new(ParentConfig),
|
||||||
|
|
||||||
%% Save the current code path and then update it with
|
%% Save the current code path and then update it with
|
||||||
%% lib_dirs. Children inherit parents code path, but we
|
%% lib_dirs. Children inherit parents code path, but we
|
||||||
%% also want to ensure that we restore everything to pristine
|
%% also want to ensure that we restore everything to pristine
|
||||||
|
@ -197,8 +197,8 @@ app_dir(Dir) ->
|
||||||
%%
|
%%
|
||||||
rel_dir(Dir) ->
|
rel_dir(Dir) ->
|
||||||
rebar_rel_utils:is_rel_dir(Dir).
|
rebar_rel_utils:is_rel_dir(Dir).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
apply_commands([], _Modules, _Config, _ModuleFile) ->
|
apply_commands([], _Modules, _Config, _ModuleFile) ->
|
||||||
|
@ -220,11 +220,11 @@ apply_commands([Command | Rest], Modules, Config, ModuleFile) ->
|
||||||
?FAIL;
|
?FAIL;
|
||||||
Other ->
|
Other ->
|
||||||
?ERROR("~p failed while processing ~s: ~p", [Command, Dir, Other]),
|
?ERROR("~p failed while processing ~s: ~p", [Command, Dir, Other]),
|
||||||
?FAIL
|
?FAIL
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
update_code_path(Config) ->
|
update_code_path(Config) ->
|
||||||
case rebar_config:get(Config, lib_dirs, []) of
|
case rebar_config:get(Config, lib_dirs, []) of
|
||||||
[] ->
|
[] ->
|
||||||
|
@ -241,7 +241,7 @@ restore_code_path(no_change) ->
|
||||||
restore_code_path({old, Path}) ->
|
restore_code_path({old, Path}) ->
|
||||||
true = code:set_path(Path),
|
true = code:set_path(Path),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
|
||||||
expand_lib_dirs([], _Root, Acc) ->
|
expand_lib_dirs([], _Root, Acc) ->
|
||||||
Acc;
|
Acc;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
%% THE SOFTWARE.
|
%% THE SOFTWARE.
|
||||||
%% -------------------------------------------------------------------
|
%% -------------------------------------------------------------------
|
||||||
%%
|
%%
|
||||||
%% Targets:
|
%% Targets:
|
||||||
%% test - runs common test suites in ./test
|
%% test - runs common test suites in ./test
|
||||||
%% int_test - runs suites in ./int_test
|
%% int_test - runs suites in ./int_test
|
||||||
|
@ -77,7 +77,7 @@ run_test(TestDir, Config, _File) ->
|
||||||
_ ->
|
_ ->
|
||||||
Output = " 2>&1 | tee -a " ++ RawLog
|
Output = " 2>&1 | tee -a " ++ RawLog
|
||||||
end,
|
end,
|
||||||
|
|
||||||
case rebar_utils:sh(Cmd ++ Output, [{"TESTDIR", TestDir}]) of
|
case rebar_utils:sh(Cmd ++ Output, [{"TESTDIR", TestDir}]) of
|
||||||
ok ->
|
ok ->
|
||||||
check_log(RawLog);
|
check_log(RawLog);
|
||||||
|
@ -97,7 +97,7 @@ clear_log(RawLog) ->
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?ERROR("Could not create log dir - ~p\n", [Reason]),
|
?ERROR("Could not create log dir - ~p\n", [Reason]),
|
||||||
?FAIL
|
?FAIL
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% calling ct with erl does not return non-zero on failure - have to check
|
%% calling ct with erl does not return non-zero on failure - have to check
|
||||||
%% log results
|
%% log results
|
||||||
|
@ -119,7 +119,7 @@ check_log(RawLog) ->
|
||||||
true ->
|
true ->
|
||||||
?CONSOLE("DONE. ~s\n", [Msg])
|
?CONSOLE("DONE. ~s\n", [Msg])
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% Show the log if it hasn't already been shown because verbose was on
|
%% Show the log if it hasn't already been shown because verbose was on
|
||||||
show_log(RawLog) ->
|
show_log(RawLog) ->
|
||||||
?CONSOLE("Showing log\n", []),
|
?CONSOLE("Showing log\n", []),
|
||||||
|
@ -151,7 +151,7 @@ make_cmd(TestDir, _Config) ->
|
||||||
" -env TEST_DIR \"~s\"",
|
" -env TEST_DIR \"~s\"",
|
||||||
[Ebin,
|
[Ebin,
|
||||||
Include,
|
Include,
|
||||||
net_adm:localhost(),
|
net_adm:localhost(),
|
||||||
LogDir,
|
LogDir,
|
||||||
filename:join(Cwd, TestDir)])) ++
|
filename:join(Cwd, TestDir)])) ++
|
||||||
get_ct_config_file(TestDir) ++
|
get_ct_config_file(TestDir) ++
|
||||||
|
@ -160,7 +160,7 @@ make_cmd(TestDir, _Config) ->
|
||||||
get_case(),
|
get_case(),
|
||||||
RawLog = filename:join(LogDir, "raw.log"),
|
RawLog = filename:join(LogDir, "raw.log"),
|
||||||
{Cmd, RawLog}.
|
{Cmd, RawLog}.
|
||||||
|
|
||||||
|
|
||||||
get_ct_config_file(TestDir) ->
|
get_ct_config_file(TestDir) ->
|
||||||
Config = filename:join(TestDir, "test.config"),
|
Config = filename:join(TestDir, "test.config"),
|
||||||
|
|
|
@ -69,12 +69,12 @@ do_compile(Config, SrcWildcard, OutDir, InExt, OutExt,
|
||||||
RestTargets = [{Fs, target_file(Fs, OutDir, InExt, OutExt)} ||
|
RestTargets = [{Fs, target_file(Fs, OutDir, InExt, OutExt)} ||
|
||||||
Fs <- drop_each(FirstFiles, FoundFiles)],
|
Fs <- drop_each(FirstFiles, FoundFiles)],
|
||||||
|
|
||||||
%% Make sure target directory exists
|
%% Make sure target directory exists
|
||||||
ok = filelib:ensure_dir(target_file(hd(FoundFiles), OutDir, InExt, OutExt)),
|
ok = filelib:ensure_dir(target_file(hd(FoundFiles), OutDir, InExt, OutExt)),
|
||||||
|
|
||||||
%% Compile first targets in sequence
|
%% Compile first targets in sequence
|
||||||
compile_each(FirstTargets, Config, IncludeFn, CompileFn),
|
compile_each(FirstTargets, Config, IncludeFn, CompileFn),
|
||||||
|
|
||||||
%% Spin up workers
|
%% Spin up workers
|
||||||
Self = self(),
|
Self = self(),
|
||||||
Pids = [spawn_monitor(fun() -> compile_worker(Self) end) || _I <- lists:seq(1,3)],
|
Pids = [spawn_monitor(fun() -> compile_worker(Self) end) || _I <- lists:seq(1,3)],
|
||||||
|
@ -100,7 +100,7 @@ compile_each([{Src, Target} | Rest], Config, IncludeFn, CompileFn) ->
|
||||||
ok
|
ok
|
||||||
end,
|
end,
|
||||||
compile_each(Rest, Config, IncludeFn, CompileFn).
|
compile_each(Rest, Config, IncludeFn, CompileFn).
|
||||||
|
|
||||||
needs_compile(Src, Target, IncludeFn, Config) ->
|
needs_compile(Src, Target, IncludeFn, Config) ->
|
||||||
TargetLM = filelib:last_modified(Target),
|
TargetLM = filelib:last_modified(Target),
|
||||||
case TargetLM < filelib:last_modified(Src) of
|
case TargetLM < filelib:last_modified(Src) of
|
||||||
|
@ -125,7 +125,7 @@ compile_opts(Config, Key) ->
|
||||||
|
|
||||||
list_hrls(Src, Config) ->
|
list_hrls(Src, Config) ->
|
||||||
case epp:open(Src, include_path(Src, Config)) of
|
case epp:open(Src, include_path(Src, Config)) of
|
||||||
{ok, Epp} ->
|
{ok, Epp} ->
|
||||||
%% check include for erlang files
|
%% check include for erlang files
|
||||||
extract_includes(Epp, Src);
|
extract_includes(Epp, Src);
|
||||||
_ ->
|
_ ->
|
||||||
|
@ -193,16 +193,16 @@ compile_queue(Pids, Targets, Config, IncludeFn, CompileFn) ->
|
||||||
{fail, Error} ->
|
{fail, Error} ->
|
||||||
?DEBUG("Worker compilation failed: ~p\n", [Error]),
|
?DEBUG("Worker compilation failed: ~p\n", [Error]),
|
||||||
?FAIL;
|
?FAIL;
|
||||||
|
|
||||||
{compiled, Source} ->
|
{compiled, Source} ->
|
||||||
?CONSOLE("Compiled ~s\n", [Source]),
|
?CONSOLE("Compiled ~s\n", [Source]),
|
||||||
compile_queue(Pids, Targets, Config, IncludeFn, CompileFn);
|
compile_queue(Pids, Targets, Config, IncludeFn, CompileFn);
|
||||||
|
|
||||||
{'DOWN', Mref, _, Pid, normal} ->
|
{'DOWN', Mref, _, Pid, normal} ->
|
||||||
?DEBUG("Worker exited cleanly\n", []),
|
?DEBUG("Worker exited cleanly\n", []),
|
||||||
Pids2 = lists:delete({Pid, Mref}, Pids),
|
Pids2 = lists:delete({Pid, Mref}, Pids),
|
||||||
compile_queue(Pids2, Targets, Config, IncludeFn, CompileFn);
|
compile_queue(Pids2, Targets, Config, IncludeFn, CompileFn);
|
||||||
|
|
||||||
{'DOWN', _Mref, _, _Pid, Info} ->
|
{'DOWN', _Mref, _, _Pid, Info} ->
|
||||||
?DEBUG("Worker failed: ~p\n", [Info]),
|
?DEBUG("Worker failed: ~p\n", [Info]),
|
||||||
?FAIL
|
?FAIL
|
||||||
|
|
|
@ -36,7 +36,7 @@ escriptize(_Config, AppFile) ->
|
||||||
%% Extract the application name from the archive -- this will be be what
|
%% Extract the application name from the archive -- this will be be what
|
||||||
%% we call the output script
|
%% we call the output script
|
||||||
{ok, AppName, _AppData} = rebar_app_utils:load_app_file(AppFile),
|
{ok, AppName, _AppData} = rebar_app_utils:load_app_file(AppFile),
|
||||||
|
|
||||||
%% Construct the archive of everything in ebin/ dir -- put it on the
|
%% Construct the archive of everything in ebin/ dir -- put it on the
|
||||||
%% top-level of the zip file so that code loading works properly.
|
%% top-level of the zip file so that code loading works properly.
|
||||||
Files = filelib:wildcard("*", "ebin"),
|
Files = filelib:wildcard("*", "ebin"),
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
%% THE SOFTWARE.
|
%% THE SOFTWARE.
|
||||||
%% -------------------------------------------------------------------
|
%% -------------------------------------------------------------------
|
||||||
%%
|
%%
|
||||||
%% Targets:
|
%% Targets:
|
||||||
%% eunit - runs eunit tests
|
%% eunit - runs eunit tests
|
||||||
%% clean - remove .eunit directory
|
%% clean - remove .eunit directory
|
||||||
|
@ -115,7 +115,7 @@ eunit(Config, _File) ->
|
||||||
|
|
||||||
clean(_Config, _File) ->
|
clean(_Config, _File) ->
|
||||||
rebar_file_utils:rm_rf(?EUNIT_DIR).
|
rebar_file_utils:rm_rf(?EUNIT_DIR).
|
||||||
|
|
||||||
|
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
%% Internal functions
|
%% Internal functions
|
||||||
|
@ -128,7 +128,7 @@ compile_erl(Source, Config) ->
|
||||||
false ->
|
false ->
|
||||||
EqcOpts = []
|
EqcOpts = []
|
||||||
end,
|
end,
|
||||||
|
|
||||||
ErlOpts = rebar_config:get_list(Config, erl_opts, []),
|
ErlOpts = rebar_config:get_list(Config, erl_opts, []),
|
||||||
EunitOpts = rebar_config:get_list(Config, eunit_compile_opts, []),
|
EunitOpts = rebar_config:get_list(Config, eunit_compile_opts, []),
|
||||||
Opts = [{i, "include"}, {outdir, ?EUNIT_DIR}, {d, 'TEST'}, debug_info, report] ++
|
Opts = [{i, "include"}, {outdir, ?EUNIT_DIR}, {d, 'TEST'}, debug_info, report] ++
|
||||||
|
@ -155,13 +155,13 @@ is_quickcheck_avail() ->
|
||||||
IsAvail ->
|
IsAvail ->
|
||||||
IsAvail
|
IsAvail
|
||||||
end.
|
end.
|
||||||
|
|
||||||
cover_init(_Config) ->
|
cover_init(_Config) ->
|
||||||
%% Make sure any previous runs of cover don't unduly influence
|
%% Make sure any previous runs of cover don't unduly influence
|
||||||
cover:reset(),
|
cover:reset(),
|
||||||
|
|
||||||
?INFO("Cover compiling ~s\n", [rebar_utils:get_cwd()]),
|
?INFO("Cover compiling ~s\n", [rebar_utils:get_cwd()]),
|
||||||
|
|
||||||
case cover:compile_beam_directory(?EUNIT_DIR) of
|
case cover:compile_beam_directory(?EUNIT_DIR) of
|
||||||
{error, Reason2} ->
|
{error, Reason2} ->
|
||||||
?ERROR("Cover compilation failed: ~p\n", [Reason2]),
|
?ERROR("Cover compilation failed: ~p\n", [Reason2]),
|
||||||
|
@ -185,8 +185,8 @@ cover_init(_Config) ->
|
||||||
|
|
||||||
cover_analyze(_Config, []) ->
|
cover_analyze(_Config, []) ->
|
||||||
ok;
|
ok;
|
||||||
cover_analyze(_Config, Modules) ->
|
cover_analyze(_Config, Modules) ->
|
||||||
%% Generate coverage info for all the cover-compiled modules
|
%% Generate coverage info for all the cover-compiled modules
|
||||||
Coverage = [cover_analyze_mod(M) || M <- Modules],
|
Coverage = [cover_analyze_mod(M) || M <- Modules],
|
||||||
|
|
||||||
%% Write index of coverage info
|
%% Write index of coverage info
|
||||||
|
@ -197,7 +197,7 @@ cover_analyze(_Config, Modules) ->
|
||||||
|
|
||||||
Index = filename:join([rebar_utils:get_cwd(), ?EUNIT_DIR, "index.html"]),
|
Index = filename:join([rebar_utils:get_cwd(), ?EUNIT_DIR, "index.html"]),
|
||||||
?CONSOLE("Cover analysis: ~s\n", [Index]).
|
?CONSOLE("Cover analysis: ~s\n", [Index]).
|
||||||
|
|
||||||
|
|
||||||
cover_analyze_mod(Module) ->
|
cover_analyze_mod(Module) ->
|
||||||
case cover:analyze(Module, coverage, module) of
|
case cover:analyze(Module, coverage, module) of
|
||||||
|
@ -229,9 +229,9 @@ cover_write_index(Coverage) ->
|
||||||
ok = file:write(F, "</table></body></html>"),
|
ok = file:write(F, "</table></body></html>"),
|
||||||
file:close(F).
|
file:close(F).
|
||||||
|
|
||||||
cover_file(Module) ->
|
cover_file(Module) ->
|
||||||
filename:join([?EUNIT_DIR, atom_to_list(Module) ++ ".COVER.html"]).
|
filename:join([?EUNIT_DIR, atom_to_list(Module) ++ ".COVER.html"]).
|
||||||
|
|
||||||
|
|
||||||
percentage(Cov, NotCov) ->
|
percentage(Cov, NotCov) ->
|
||||||
trunc((Cov / (Cov + NotCov)) * 100).
|
trunc((Cov / (Cov + NotCov)) * 100).
|
||||||
|
|
|
@ -71,4 +71,4 @@ delete_each([File | Rest]) ->
|
||||||
?ERROR("Failed to delete file ~s: ~p\n", [File, Reason]),
|
?ERROR("Failed to delete file ~s: ~p\n", [File, Reason]),
|
||||||
?FAIL
|
?FAIL
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ init() ->
|
||||||
_ ->
|
_ ->
|
||||||
set_level(error)
|
set_level(error)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
set_level(Level) ->
|
set_level(Level) ->
|
||||||
ok = application:set_env(rebar, log_level, Level).
|
ok = application:set_env(rebar, log_level, Level).
|
||||||
|
@ -74,11 +74,11 @@ should_log(warn, _) -> true;
|
||||||
should_log(error, error) -> true;
|
should_log(error, error) -> true;
|
||||||
should_log(error, _) -> false;
|
should_log(error, _) -> false;
|
||||||
should_log(_, _) -> false.
|
should_log(_, _) -> false.
|
||||||
|
|
||||||
log_prefix(debug) -> "DEBUG:" ;
|
log_prefix(debug) -> "DEBUG:" ;
|
||||||
log_prefix(info) -> "INFO: ";
|
log_prefix(info) -> "INFO: ";
|
||||||
log_prefix(warn) -> "WARN: ";
|
log_prefix(warn) -> "WARN: ";
|
||||||
log_prefix(error) -> "ERROR: ".
|
log_prefix(error) -> "ERROR: ".
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ install(Config, File) ->
|
||||||
BinDir = filename:join([code:root_dir(), "..", "..", "bin"]),
|
BinDir = filename:join([code:root_dir(), "..", "..", "bin"]),
|
||||||
install_binaries(List, AppDir, BinDir)
|
install_binaries(List, AppDir, BinDir)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
%% Internal functions
|
%% Internal functions
|
||||||
|
@ -108,8 +108,8 @@ install_binaries([Bin | Rest], AppDir, BinDir) ->
|
||||||
FqBin = filename:join([AppDir, Bin]),
|
FqBin = filename:join([AppDir, Bin]),
|
||||||
rebar_file_utils:ln_sf(FqBin, BinDir),
|
rebar_file_utils:ln_sf(FqBin, BinDir),
|
||||||
install_binaries(Rest, AppDir, BinDir).
|
install_binaries(Rest, AppDir, BinDir).
|
||||||
|
|
||||||
|
|
||||||
validate_name(AppName, File) ->
|
validate_name(AppName, File) ->
|
||||||
%% Convert the .app file name to an atom -- check it against the identifier within the file
|
%% Convert the .app file name to an atom -- check it against the identifier within the file
|
||||||
ExpApp = list_to_atom(filename:basename(File, ".app")),
|
ExpApp = list_to_atom(filename:basename(File, ".app")),
|
||||||
|
@ -137,7 +137,7 @@ validate_modules(AppName, Mods) ->
|
||||||
ok;
|
ok;
|
||||||
MissingBeams ->
|
MissingBeams ->
|
||||||
Msg1 = lists:flatten([io_lib:format("\t* ~p\n", [M]) || M <- MissingBeams]),
|
Msg1 = lists:flatten([io_lib:format("\t* ~p\n", [M]) || M <- MissingBeams]),
|
||||||
?ERROR("One or more modules listed in ~p.app are not present in ebin/*.beam:\n~s",
|
?ERROR("One or more modules listed in ~p.app are not present in ebin/*.beam:\n~s",
|
||||||
[AppName, Msg1]),
|
[AppName, Msg1]),
|
||||||
?FAIL
|
?FAIL
|
||||||
end,
|
end,
|
||||||
|
@ -148,7 +148,7 @@ validate_modules(AppName, Mods) ->
|
||||||
ok;
|
ok;
|
||||||
MissingMods ->
|
MissingMods ->
|
||||||
Msg2 = lists:flatten([io_lib:format("\t* ~p\n", [M]) || M <- MissingMods]),
|
Msg2 = lists:flatten([io_lib:format("\t* ~p\n", [M]) || M <- MissingMods]),
|
||||||
?ERROR("On or more .beam files exist that are not listed in ~p.app:\n~s",
|
?ERROR("On or more .beam files exist that are not listed in ~p.app:\n~s",
|
||||||
[AppName, Msg2]),
|
[AppName, Msg2]),
|
||||||
?FAIL
|
?FAIL
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
%% {port_envs, [{"x86_64.*-linux", "CFLAGS", "$CFLAGS -X86Options"}]}
|
%% {port_envs, [{"x86_64.*-linux", "CFLAGS", "$CFLAGS -X86Options"}]}
|
||||||
%%
|
%%
|
||||||
%% * port_pre_script - Tuple which specifies a pre-compilation script to run, and a filename that
|
%% * port_pre_script - Tuple which specifies a pre-compilation script to run, and a filename that
|
||||||
%% exists as a result of the script running.
|
%% exists as a result of the script running.
|
||||||
%%
|
%%
|
||||||
%% * port_cleanup_script - String that specifies a script to run during cleanup. Use this to remove
|
%% * port_cleanup_script - String that specifies a script to run during cleanup. Use this to remove
|
||||||
%% files/directories created by port_pre_script.
|
%% files/directories created by port_pre_script.
|
||||||
|
@ -79,7 +79,7 @@ compile(Config, AppFile) ->
|
||||||
DefaultEnvs = filter_envs(default_env(), []),
|
DefaultEnvs = filter_envs(default_env(), []),
|
||||||
OverrideEnvs = filter_envs(rebar_config:get_list(Config, port_envs, []), []),
|
OverrideEnvs = filter_envs(rebar_config:get_list(Config, port_envs, []), []),
|
||||||
Env = merge_envs(OverrideEnvs, DefaultEnvs),
|
Env = merge_envs(OverrideEnvs, DefaultEnvs),
|
||||||
|
|
||||||
%% One or more files are available for building. Run the pre-compile hook, if
|
%% One or more files are available for building. Run the pre-compile hook, if
|
||||||
%% necessary.
|
%% necessary.
|
||||||
run_precompile_hook(Config, Env),
|
run_precompile_hook(Config, Env),
|
||||||
|
@ -165,13 +165,13 @@ compile_each([Source | Rest], Config, Env, NewBins, ExistingBins) ->
|
||||||
rebar_utils:sh_failfast(?FMT("$CXX -c $CXXFLAGS $DRIVER_CFLAGS ~s -o ~s", [Source, Bin]), Env)
|
rebar_utils:sh_failfast(?FMT("$CXX -c $CXXFLAGS $DRIVER_CFLAGS ~s -o ~s", [Source, Bin]), Env)
|
||||||
end,
|
end,
|
||||||
compile_each(Rest, Config, Env, [Bin | NewBins], ExistingBins);
|
compile_each(Rest, Config, Env, [Bin | NewBins], ExistingBins);
|
||||||
|
|
||||||
false ->
|
false ->
|
||||||
?INFO("Skipping ~s\n", [Source]),
|
?INFO("Skipping ~s\n", [Source]),
|
||||||
compile_each(Rest, Config, Env, NewBins, [Bin | ExistingBins])
|
compile_each(Rest, Config, Env, NewBins, [Bin | ExistingBins])
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
needs_compile(Source, Bin) ->
|
needs_compile(Source, Bin) ->
|
||||||
%% TODO: Generate depends using gcc -MM so we can also check for include changes
|
%% TODO: Generate depends using gcc -MM so we can also check for include changes
|
||||||
|
@ -190,7 +190,7 @@ needs_link(SoName, NewBins) ->
|
||||||
?DEBUG("Checking ~p >= ~p", [MaxLastMod, Other]),
|
?DEBUG("Checking ~p >= ~p", [MaxLastMod, Other]),
|
||||||
MaxLastMod >= Other
|
MaxLastMod >= Other
|
||||||
end.
|
end.
|
||||||
|
|
||||||
merge_envs(OverrideEnvs, DefaultEnvs) ->
|
merge_envs(OverrideEnvs, DefaultEnvs) ->
|
||||||
orddict:merge(fun(Key, Override, Default) ->
|
orddict:merge(fun(Key, Override, Default) ->
|
||||||
expand_env_variable(Override, Key, Default)
|
expand_env_variable(Override, Key, Default)
|
||||||
|
@ -271,6 +271,6 @@ so_name(AppFile) ->
|
||||||
?FAIL
|
?FAIL
|
||||||
end,
|
end,
|
||||||
|
|
||||||
%% Construct the driver name
|
%% Construct the driver name
|
||||||
?FMT("priv/~s_drv.so", [AppName]).
|
?FMT("priv/~s_drv.so", [AppName]).
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ load_config(ReltoolFile) ->
|
||||||
?ERROR("Failed to load expected config from ~s: ~p\n", [ReltoolFile, Other]),
|
?ERROR("Failed to load expected config from ~s: ~p\n", [ReltoolFile, Other]),
|
||||||
?FAIL
|
?FAIL
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
%%
|
%%
|
||||||
%% Determine the name of the target directory; try the user provided name
|
%% Determine the name of the target directory; try the user provided name
|
||||||
|
@ -113,7 +113,7 @@ validate_rel_apps(ReltoolServer, {sys, ReltoolConfig}) ->
|
||||||
{value, {rel, _Name, _Vsn, Apps}} ->
|
{value, {rel, _Name, _Vsn, Apps}} ->
|
||||||
%% Identify all the apps that do NOT exist, based on what's available
|
%% Identify all the apps that do NOT exist, based on what's available
|
||||||
%% from the reltool server
|
%% from the reltool server
|
||||||
Missing = lists:sort([App || App <- Apps,
|
Missing = lists:sort([App || App <- Apps,
|
||||||
app_exists(App, ReltoolServer) == false]),
|
app_exists(App, ReltoolServer) == false]),
|
||||||
case Missing of
|
case Missing of
|
||||||
[] ->
|
[] ->
|
||||||
|
@ -139,7 +139,7 @@ app_exists(App, Server) when is_atom(App) ->
|
||||||
end;
|
end;
|
||||||
app_exists(AppTuple, Server) when is_tuple(AppTuple) ->
|
app_exists(AppTuple, Server) when is_tuple(AppTuple) ->
|
||||||
app_exists(element(1, AppTuple), Server).
|
app_exists(element(1, AppTuple), Server).
|
||||||
|
|
||||||
|
|
||||||
run_reltool(Config, ReltoolConfig) ->
|
run_reltool(Config, ReltoolConfig) ->
|
||||||
{ok, Server} = reltool:start_server([sys_tuple(ReltoolConfig)]),
|
{ok, Server} = reltool:start_server([sys_tuple(ReltoolConfig)]),
|
||||||
|
@ -185,8 +185,8 @@ mk_target_dir(TargetDir) ->
|
||||||
?ERROR("Release target directory ~p already exists!\n", [TargetDir]),
|
?ERROR("Release target directory ~p already exists!\n", [TargetDir]),
|
||||||
?FAIL
|
?FAIL
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
dump_spec(Spec) ->
|
dump_spec(Spec) ->
|
||||||
case rebar_config:get_global(dump_spec, "0") of
|
case rebar_config:get_global(dump_spec, "0") of
|
||||||
|
@ -196,7 +196,7 @@ dump_spec(Spec) ->
|
||||||
_ ->
|
_ ->
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
process_rebar_specs([], Spec) ->
|
process_rebar_specs([], Spec) ->
|
||||||
Spec;
|
Spec;
|
||||||
process_rebar_specs([{overlay, Source} | Rest], Spec) ->
|
process_rebar_specs([{overlay, Source} | Rest], Spec) ->
|
||||||
|
@ -254,4 +254,4 @@ spec_copy_overlay([F | Rest], Dir, Acc) ->
|
||||||
?DEBUG("Skipping ~p of type ~p\n", [F, Other]),
|
?DEBUG("Skipping ~p of type ~p\n", [F, Other]),
|
||||||
spec_copy_overlay(Rest, Dir, Acc)
|
spec_copy_overlay(Rest, Dir, Acc)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue