mirror of
https://github.com/correl/rebar.git
synced 2024-12-24 03:00:16 +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 ->
|
||||
ok
|
||||
end,
|
||||
|
||||
|
||||
case catch(rebar_core:run(Args)) of
|
||||
ok ->
|
||||
ok;
|
||||
|
|
|
@ -68,7 +68,7 @@ get(Config, Key, Default) ->
|
|||
|
||||
delete(Config, Key) ->
|
||||
Config#config { opts = proplists:delete(Key, Config#config.opts) }.
|
||||
|
||||
|
||||
set_global(Key, Value) ->
|
||||
application:set_env(rebar_global, Key, Value).
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ filter_flags([Item | Rest], Commands) ->
|
|||
process_dir(Dir, ParentConfig, Commands) ->
|
||||
ok = file:set_cwd(Dir),
|
||||
Config = rebar_config:new(ParentConfig),
|
||||
|
||||
|
||||
%% Save the current code path and then update it with
|
||||
%% lib_dirs. Children inherit parents code path, but we
|
||||
%% also want to ensure that we restore everything to pristine
|
||||
|
@ -197,8 +197,8 @@ app_dir(Dir) ->
|
|||
%%
|
||||
rel_dir(Dir) ->
|
||||
rebar_rel_utils:is_rel_dir(Dir).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
apply_commands([], _Modules, _Config, _ModuleFile) ->
|
||||
|
@ -220,11 +220,11 @@ apply_commands([Command | Rest], Modules, Config, ModuleFile) ->
|
|||
?FAIL;
|
||||
Other ->
|
||||
?ERROR("~p failed while processing ~s: ~p", [Command, Dir, Other]),
|
||||
?FAIL
|
||||
?FAIL
|
||||
end
|
||||
end.
|
||||
|
||||
|
||||
|
||||
update_code_path(Config) ->
|
||||
case rebar_config:get(Config, lib_dirs, []) of
|
||||
[] ->
|
||||
|
@ -241,7 +241,7 @@ restore_code_path(no_change) ->
|
|||
restore_code_path({old, Path}) ->
|
||||
true = code:set_path(Path),
|
||||
ok.
|
||||
|
||||
|
||||
|
||||
expand_lib_dirs([], _Root, Acc) ->
|
||||
Acc;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
%% THE SOFTWARE.
|
||||
%% -------------------------------------------------------------------
|
||||
%%
|
||||
%%
|
||||
%% Targets:
|
||||
%% test - runs common test suites in ./test
|
||||
%% int_test - runs suites in ./int_test
|
||||
|
@ -77,7 +77,7 @@ run_test(TestDir, Config, _File) ->
|
|||
_ ->
|
||||
Output = " 2>&1 | tee -a " ++ RawLog
|
||||
end,
|
||||
|
||||
|
||||
case rebar_utils:sh(Cmd ++ Output, [{"TESTDIR", TestDir}]) of
|
||||
ok ->
|
||||
check_log(RawLog);
|
||||
|
@ -97,7 +97,7 @@ clear_log(RawLog) ->
|
|||
{error, Reason} ->
|
||||
?ERROR("Could not create log dir - ~p\n", [Reason]),
|
||||
?FAIL
|
||||
end.
|
||||
end.
|
||||
|
||||
%% calling ct with erl does not return non-zero on failure - have to check
|
||||
%% log results
|
||||
|
@ -119,7 +119,7 @@ check_log(RawLog) ->
|
|||
true ->
|
||||
?CONSOLE("DONE. ~s\n", [Msg])
|
||||
end.
|
||||
|
||||
|
||||
%% Show the log if it hasn't already been shown because verbose was on
|
||||
show_log(RawLog) ->
|
||||
?CONSOLE("Showing log\n", []),
|
||||
|
@ -151,7 +151,7 @@ make_cmd(TestDir, _Config) ->
|
|||
" -env TEST_DIR \"~s\"",
|
||||
[Ebin,
|
||||
Include,
|
||||
net_adm:localhost(),
|
||||
net_adm:localhost(),
|
||||
LogDir,
|
||||
filename:join(Cwd, TestDir)])) ++
|
||||
get_ct_config_file(TestDir) ++
|
||||
|
@ -160,7 +160,7 @@ make_cmd(TestDir, _Config) ->
|
|||
get_case(),
|
||||
RawLog = filename:join(LogDir, "raw.log"),
|
||||
{Cmd, RawLog}.
|
||||
|
||||
|
||||
|
||||
get_ct_config_file(TestDir) ->
|
||||
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)} ||
|
||||
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)),
|
||||
|
||||
%% Compile first targets in sequence
|
||||
compile_each(FirstTargets, Config, IncludeFn, CompileFn),
|
||||
|
||||
|
||||
%% Spin up workers
|
||||
Self = self(),
|
||||
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
|
||||
end,
|
||||
compile_each(Rest, Config, IncludeFn, CompileFn).
|
||||
|
||||
|
||||
needs_compile(Src, Target, IncludeFn, Config) ->
|
||||
TargetLM = filelib:last_modified(Target),
|
||||
case TargetLM < filelib:last_modified(Src) of
|
||||
|
@ -125,7 +125,7 @@ compile_opts(Config, Key) ->
|
|||
|
||||
list_hrls(Src, Config) ->
|
||||
case epp:open(Src, include_path(Src, Config)) of
|
||||
{ok, Epp} ->
|
||||
{ok, Epp} ->
|
||||
%% check include for erlang files
|
||||
extract_includes(Epp, Src);
|
||||
_ ->
|
||||
|
@ -193,16 +193,16 @@ compile_queue(Pids, Targets, Config, IncludeFn, CompileFn) ->
|
|||
{fail, Error} ->
|
||||
?DEBUG("Worker compilation failed: ~p\n", [Error]),
|
||||
?FAIL;
|
||||
|
||||
|
||||
{compiled, Source} ->
|
||||
?CONSOLE("Compiled ~s\n", [Source]),
|
||||
compile_queue(Pids, Targets, Config, IncludeFn, CompileFn);
|
||||
|
||||
|
||||
{'DOWN', Mref, _, Pid, normal} ->
|
||||
?DEBUG("Worker exited cleanly\n", []),
|
||||
Pids2 = lists:delete({Pid, Mref}, Pids),
|
||||
compile_queue(Pids2, Targets, Config, IncludeFn, CompileFn);
|
||||
|
||||
|
||||
{'DOWN', _Mref, _, _Pid, Info} ->
|
||||
?DEBUG("Worker failed: ~p\n", [Info]),
|
||||
?FAIL
|
||||
|
|
|
@ -36,7 +36,7 @@ escriptize(_Config, AppFile) ->
|
|||
%% Extract the application name from the archive -- this will be be what
|
||||
%% we call the output script
|
||||
{ok, AppName, _AppData} = rebar_app_utils:load_app_file(AppFile),
|
||||
|
||||
|
||||
%% Construct the archive of everything in ebin/ dir -- put it on the
|
||||
%% top-level of the zip file so that code loading works properly.
|
||||
Files = filelib:wildcard("*", "ebin"),
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
%% THE SOFTWARE.
|
||||
%% -------------------------------------------------------------------
|
||||
%%
|
||||
%%
|
||||
%% Targets:
|
||||
%% eunit - runs eunit tests
|
||||
%% clean - remove .eunit directory
|
||||
|
@ -115,7 +115,7 @@ eunit(Config, _File) ->
|
|||
|
||||
clean(_Config, _File) ->
|
||||
rebar_file_utils:rm_rf(?EUNIT_DIR).
|
||||
|
||||
|
||||
|
||||
%% ===================================================================
|
||||
%% Internal functions
|
||||
|
@ -128,7 +128,7 @@ compile_erl(Source, Config) ->
|
|||
false ->
|
||||
EqcOpts = []
|
||||
end,
|
||||
|
||||
|
||||
ErlOpts = rebar_config:get_list(Config, erl_opts, []),
|
||||
EunitOpts = rebar_config:get_list(Config, eunit_compile_opts, []),
|
||||
Opts = [{i, "include"}, {outdir, ?EUNIT_DIR}, {d, 'TEST'}, debug_info, report] ++
|
||||
|
@ -155,13 +155,13 @@ is_quickcheck_avail() ->
|
|||
IsAvail ->
|
||||
IsAvail
|
||||
end.
|
||||
|
||||
|
||||
cover_init(_Config) ->
|
||||
%% Make sure any previous runs of cover don't unduly influence
|
||||
cover:reset(),
|
||||
|
||||
?INFO("Cover compiling ~s\n", [rebar_utils:get_cwd()]),
|
||||
|
||||
|
||||
case cover:compile_beam_directory(?EUNIT_DIR) of
|
||||
{error, Reason2} ->
|
||||
?ERROR("Cover compilation failed: ~p\n", [Reason2]),
|
||||
|
@ -185,8 +185,8 @@ cover_init(_Config) ->
|
|||
|
||||
cover_analyze(_Config, []) ->
|
||||
ok;
|
||||
cover_analyze(_Config, Modules) ->
|
||||
%% Generate coverage info for all the cover-compiled modules
|
||||
cover_analyze(_Config, Modules) ->
|
||||
%% Generate coverage info for all the cover-compiled modules
|
||||
Coverage = [cover_analyze_mod(M) || M <- Modules],
|
||||
|
||||
%% Write index of coverage info
|
||||
|
@ -197,7 +197,7 @@ cover_analyze(_Config, Modules) ->
|
|||
|
||||
Index = filename:join([rebar_utils:get_cwd(), ?EUNIT_DIR, "index.html"]),
|
||||
?CONSOLE("Cover analysis: ~s\n", [Index]).
|
||||
|
||||
|
||||
|
||||
cover_analyze_mod(Module) ->
|
||||
case cover:analyze(Module, coverage, module) of
|
||||
|
@ -229,9 +229,9 @@ cover_write_index(Coverage) ->
|
|||
ok = file:write(F, "</table></body></html>"),
|
||||
file:close(F).
|
||||
|
||||
cover_file(Module) ->
|
||||
cover_file(Module) ->
|
||||
filename:join([?EUNIT_DIR, atom_to_list(Module) ++ ".COVER.html"]).
|
||||
|
||||
|
||||
|
||||
|
||||
percentage(Cov, NotCov) ->
|
||||
trunc((Cov / (Cov + NotCov)) * 100).
|
||||
|
|
|
@ -71,4 +71,4 @@ delete_each([File | Rest]) ->
|
|||
?ERROR("Failed to delete file ~s: ~p\n", [File, Reason]),
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ init() ->
|
|||
_ ->
|
||||
set_level(error)
|
||||
end.
|
||||
|
||||
|
||||
|
||||
set_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, _) -> false;
|
||||
should_log(_, _) -> false.
|
||||
|
||||
|
||||
log_prefix(debug) -> "DEBUG:" ;
|
||||
log_prefix(info) -> "INFO: ";
|
||||
log_prefix(warn) -> "WARN: ";
|
||||
log_prefix(error) -> "ERROR: ".
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ install(Config, File) ->
|
|||
BinDir = filename:join([code:root_dir(), "..", "..", "bin"]),
|
||||
install_binaries(List, AppDir, BinDir)
|
||||
end.
|
||||
|
||||
|
||||
|
||||
%% ===================================================================
|
||||
%% Internal functions
|
||||
|
@ -108,8 +108,8 @@ install_binaries([Bin | Rest], AppDir, BinDir) ->
|
|||
FqBin = filename:join([AppDir, Bin]),
|
||||
rebar_file_utils:ln_sf(FqBin, BinDir),
|
||||
install_binaries(Rest, AppDir, BinDir).
|
||||
|
||||
|
||||
|
||||
|
||||
validate_name(AppName, 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")),
|
||||
|
@ -137,7 +137,7 @@ validate_modules(AppName, Mods) ->
|
|||
ok;
|
||||
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]),
|
||||
?FAIL
|
||||
end,
|
||||
|
@ -148,7 +148,7 @@ validate_modules(AppName, Mods) ->
|
|||
ok;
|
||||
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]),
|
||||
?FAIL
|
||||
end.
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
%% {port_envs, [{"x86_64.*-linux", "CFLAGS", "$CFLAGS -X86Options"}]}
|
||||
%%
|
||||
%% * 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
|
||||
%% files/directories created by port_pre_script.
|
||||
|
@ -79,7 +79,7 @@ compile(Config, AppFile) ->
|
|||
DefaultEnvs = filter_envs(default_env(), []),
|
||||
OverrideEnvs = filter_envs(rebar_config:get_list(Config, port_envs, []), []),
|
||||
Env = merge_envs(OverrideEnvs, DefaultEnvs),
|
||||
|
||||
|
||||
%% One or more files are available for building. Run the pre-compile hook, if
|
||||
%% necessary.
|
||||
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)
|
||||
end,
|
||||
compile_each(Rest, Config, Env, [Bin | NewBins], ExistingBins);
|
||||
|
||||
|
||||
false ->
|
||||
?INFO("Skipping ~s\n", [Source]),
|
||||
compile_each(Rest, Config, Env, NewBins, [Bin | ExistingBins])
|
||||
end.
|
||||
|
||||
|
||||
|
||||
|
||||
needs_compile(Source, Bin) ->
|
||||
%% 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]),
|
||||
MaxLastMod >= Other
|
||||
end.
|
||||
|
||||
|
||||
merge_envs(OverrideEnvs, DefaultEnvs) ->
|
||||
orddict:merge(fun(Key, Override, Default) ->
|
||||
expand_env_variable(Override, Key, Default)
|
||||
|
@ -271,6 +271,6 @@ so_name(AppFile) ->
|
|||
?FAIL
|
||||
end,
|
||||
|
||||
%% Construct the driver name
|
||||
%% Construct the driver name
|
||||
?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]),
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
|
||||
|
||||
%%
|
||||
%% 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}} ->
|
||||
%% Identify all the apps that do NOT exist, based on what's available
|
||||
%% from the reltool server
|
||||
Missing = lists:sort([App || App <- Apps,
|
||||
Missing = lists:sort([App || App <- Apps,
|
||||
app_exists(App, ReltoolServer) == false]),
|
||||
case Missing of
|
||||
[] ->
|
||||
|
@ -139,7 +139,7 @@ app_exists(App, Server) when is_atom(App) ->
|
|||
end;
|
||||
app_exists(AppTuple, Server) when is_tuple(AppTuple) ->
|
||||
app_exists(element(1, AppTuple), Server).
|
||||
|
||||
|
||||
|
||||
run_reltool(Config, 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]),
|
||||
?FAIL
|
||||
end
|
||||
end.
|
||||
|
||||
end.
|
||||
|
||||
|
||||
dump_spec(Spec) ->
|
||||
case rebar_config:get_global(dump_spec, "0") of
|
||||
|
@ -196,7 +196,7 @@ dump_spec(Spec) ->
|
|||
_ ->
|
||||
ok
|
||||
end.
|
||||
|
||||
|
||||
process_rebar_specs([], Spec) ->
|
||||
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]),
|
||||
spec_copy_overlay(Rest, Dir, Acc)
|
||||
end.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue