diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | RELEASE-NOTES.md | 33 | ||||
-rw-r--r-- | dialyzer_reference | 2 | ||||
-rw-r--r-- | ebin/rebar.app | 6 | ||||
-rw-r--r-- | src/rebar.erl | 14 | ||||
-rw-r--r-- | src/rebar_app_utils.erl | 9 | ||||
-rw-r--r-- | src/rebar_base_compiler.erl | 44 | ||||
-rw-r--r-- | src/rebar_erlydtl_compiler.erl | 4 | ||||
-rw-r--r-- | src/rebar_eunit.erl | 8 | ||||
-rw-r--r-- | src/rebar_getopt.erl (renamed from src/getopt.erl) | 90 | ||||
-rw-r--r-- | src/rebar_mustache.erl (renamed from src/mustache.erl) | 10 | ||||
-rw-r--r-- | src/rebar_qc.erl | 7 | ||||
-rw-r--r-- | src/rebar_templater.erl | 2 | ||||
-rw-r--r-- | src/rebar_upgrade.erl | 8 |
14 files changed, 175 insertions, 64 deletions
diff --git a/.travis.yml b/.travis.yml index 191d337..a7eedb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: erlang otp_release: + - R16B02 + - R16B01 - R16B - R15B01 - R15B diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md new file mode 100644 index 0000000..bdfb3d7 --- /dev/null +++ b/RELEASE-NOTES.md @@ -0,0 +1,33 @@ +# Rebar 2.2.0 + +## PR's Merged + +* rebar/137: [Filter documented behaviour callbacks](https://github.com/basho/rebar/pull/137) +* rebar/142: [Fix rebar_file_utils module on Windows with MSYS](https://github.com/basho/rebar/pull/142) +* rebar/152: [Allow users to configure skip_deps for specific commands](https://github.com/basho/rebar/pull/152) +* rebar/154: [Stop applications nicely before killing extra processes](https://github.com/basho/rebar/pull/154) +* rebar/155: [Fix rebar_utils:expand_env_variable/3](https://github.com/basho/rebar/pull/155) +* rebar/157: [add native Windows compiler support](https://github.com/basho/rebar/pull/157) +* rebar/172: [Allow reltool target_dir to be constructed on the fly](https://github.com/basho/rebar/pull/172) +* rebar/173: [rebar should expand VCS version in the top directory, if possible](https://github.com/basho/rebar/pull/173) +* rebar/174: [Fixed handle_call response in simplesrv.erl](https://github.com/basho/rebar/pull/174) +* rebar/177: [Cache vsn information during the run to avoid extra unnecessary shell calls](https://github.com/basho/rebar/pull/177) +* rebar/179: [Add ebin to the path before compiling erlydtl templates](https://github.com/basho/rebar/pull/179) +* rebar/183: [Fix compiling DTL templates with latest erlydtl](https://github.com/basho/rebar/pull/183) +* rebar/184: [Fix for destruction of config app vars on reset](https://github.com/basho/rebar/pull/184) +* rebar/185: [simple enhance and simple bugfix](https://github.com/basho/rebar/pull/185) +* rebar/187: [fix for cp_r_win32 where copying a directory to a non-existant directory would crash](https://github.com/basho/rebar/pull/187) +* rebar/189: [Fix typos in generated cmd script in bootstrap](https://github.com/basho/rebar/pull/189) +* rebar/190: [Windows xcopy dir to non-existant dir (re-request)](https://github.com/basho/rebar/pull/190) +* rebar/191: [Fix typos in rebar_templater](https://github.com/basho/rebar/pull/191) +* rebar/196: [Escape '|' in the Windows runner usage string](https://github.com/basho/rebar/pull/196) +* rebar/198: [New feature to rebar_xref to allow execution of custom queries.](https://github.com/basho/rebar/pull/198) +* rebar/199: [Added new feature to rebar xref to allow execution of custom queries.](https://github.com/basho/rebar/pull/199) +* rebar/200: [Enable runner to pass more than one argument to start](https://github.com/basho/rebar/pull/200) +* rebar/201: [include simplemodule.app.src in simplemod template](https://github.com/basho/rebar/pull/201) +* rebar/205: [Ports in languages other than C](https://github.com/basho/rebar/issues/205) +* rebar/210: [use file:script if a .config.script file present](https://github.com/basho/rebar/pull/210) +* rebar/212: [ Modified simplenode.runner to start from alternative directory](https://github.com/basho/rebar/pull/212) +* rebar/214: [Foreground running doesn't allow console attaching](https://github.com/basho/rebar/issues/214) +* rebar/215: [Add support for http proxy_friendly_github_urls](https://github.com/basho/rebar/pull/215) +* rebar/388: [Less than useful rebar error message when error in .hrl files](https://github.com/basho/rebar/issues/388) diff --git a/dialyzer_reference b/dialyzer_reference index e26d8dd..558a7bb 100644 --- a/dialyzer_reference +++ b/dialyzer_reference @@ -1,3 +1,3 @@ -rebar_eunit.erl:388: Call to missing or unexported function eunit_test:function_wrapper/2 +rebar_eunit.erl:387: Call to missing or unexported function eunit_test:function_wrapper/2 rebar_utils.erl:163: Call to missing or unexported function escript:foldl/3 diff --git a/ebin/rebar.app b/ebin/rebar.app index 873be18..8e239e9 100644 --- a/ebin/rebar.app +++ b/ebin/rebar.app @@ -3,7 +3,7 @@ {application, rebar, [{description, "Rebar: Erlang Build Tool"}, - {vsn, "2.1.0"}, + {vsn, "2.2.0"}, {modules, [ rebar, rebar_abnfc_compiler, rebar_app_utils, @@ -38,8 +38,8 @@ rebar_upgrade, rebar_utils, rebar_xref, - getopt, - mustache ]}, + rebar_getopt, + rebar_mustache ]}, {registered, []}, {applications, [kernel, stdlib, diff --git a/src/rebar.erl b/src/rebar.erl index 00505be..ea3a2ab 100644 --- a/src/rebar.erl +++ b/src/rebar.erl @@ -87,7 +87,9 @@ run(["help"|RawCmds]) when RawCmds =/= [] -> run(["help"]) -> help(); run(["info"|_]) -> - help(); + %% Catch calls to 'rebar info' to avoid treating plugins' info/2 functions + %% as commands. + ?CONSOLE("Command 'info' not understood or not applicable~n", []); run(["version"]) -> ok = load_rebar_app(), %% Display vsn and build time info @@ -178,10 +180,10 @@ run_aux(BaseConfig, Commands) -> %% help() -> OptSpecList = option_spec_list(), - getopt:usage(OptSpecList, "rebar", - "[var=value,...] <command,...>", - [{"var=value", "rebar global variables (e.g. force=1)"}, - {"command", "Command to run (e.g. compile)"}]), + rebar_getopt:usage(OptSpecList, "rebar", + "[var=value,...] <command,...>", + [{"var=value", "rebar global variables (e.g. force=1)"}, + {"command", "Command to run (e.g. compile)"}]), ?CONSOLE( "Type 'rebar help <CMD1> <CMD2>' for help on specific commands." "~n~n", []), @@ -215,7 +217,7 @@ help() -> parse_args(RawArgs) -> %% Parse getopt options OptSpecList = option_spec_list(), - case getopt:parse(OptSpecList, RawArgs) of + case rebar_getopt:parse(OptSpecList, RawArgs) of {ok, Args} -> Args; {error, {Reason, Data}} -> diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl index 8158eb6..a2484e1 100644 --- a/src/rebar_app_utils.erl +++ b/src/rebar_app_utils.erl @@ -163,15 +163,6 @@ consult_app_file(Filename) -> false -> file:consult(Filename); true -> - %% TODO: EXPERIMENTAL For now let's warn the user if a - %% script is going to be run. - case filelib:is_regular([Filename, ".script"]) of - true -> - ?CONSOLE("NOTICE: Using experimental *.app.src.script " - "functionality on ~s ~n", [Filename]); - _ -> - ok - end, rebar_config:consult_file(Filename) end. diff --git a/src/rebar_base_compiler.erl b/src/rebar_base_compiler.erl index a0dec30..1957070 100644 --- a/src/rebar_base_compiler.erl +++ b/src/rebar_base_compiler.erl @@ -49,7 +49,7 @@ run(Config, FirstFiles, RestFiles, CompileFn) -> Jobs = rebar:get_jobs(Config), ?DEBUG("Starting ~B compile worker(s)~n", [Jobs]), Pids = [spawn_monitor(F) || _I <- lists:seq(1,Jobs)], - compile_queue(Pids, RestFiles) + compile_queue(Config, Pids, RestFiles) end. run(Config, FirstFiles, SourceDir, SourceExt, TargetDir, TargetExt, @@ -139,27 +139,31 @@ compile_each([Source | Rest], Config, CompileFn) -> skipped -> ?INFO("Skipped ~s\n", [Source]); Error -> + ?CONSOLE("Compiling ~s failed:\n", + [maybe_absname(Config, Source)]), maybe_report(Error), ?DEBUG("Compilation failed: ~p\n", [Error]), ?FAIL end, compile_each(Rest, Config, CompileFn). -compile_queue([], []) -> +compile_queue(_Config, [], []) -> ok; -compile_queue(Pids, Targets) -> +compile_queue(Config, Pids, Targets) -> receive {next, Worker} -> case Targets of [] -> Worker ! empty, - compile_queue(Pids, Targets); + compile_queue(Config, Pids, Targets); [Source | Rest] -> Worker ! {compile, Source}, - compile_queue(Pids, Rest) + compile_queue(Config, Pids, Rest) end; - {fail, Error} -> + {fail, {_, {source, Source}}=Error} -> + ?CONSOLE("Compiling ~s failed:\n", + [maybe_absname(Config, Source)]), maybe_report(Error), ?DEBUG("Worker compilation failed: ~p\n", [Error]), ?FAIL; @@ -167,20 +171,20 @@ compile_queue(Pids, Targets) -> {compiled, Source, Warnings} -> report(Warnings), ?CONSOLE("Compiled ~s\n", [Source]), - compile_queue(Pids, Targets); + compile_queue(Config, Pids, Targets); {compiled, Source} -> ?CONSOLE("Compiled ~s\n", [Source]), - compile_queue(Pids, Targets); + compile_queue(Config, Pids, Targets); {skipped, Source} -> ?INFO("Skipped ~s\n", [Source]), - compile_queue(Pids, Targets); + compile_queue(Config, Pids, Targets); {'DOWN', Mref, _, Pid, normal} -> ?DEBUG("Worker exited cleanly\n", []), Pids2 = lists:delete({Pid, Mref}, Pids), - compile_queue(Pids2, Targets); + compile_queue(Config, Pids2, Targets); {'DOWN', _Mref, _, _Pid, Info} -> ?DEBUG("Worker failed: ~p\n", [Info]), @@ -202,8 +206,7 @@ compile_worker(QueuePid, Config, CompileFn) -> QueuePid ! {skipped, Source}, compile_worker(QueuePid, Config, CompileFn); Error -> - QueuePid ! {fail, [{error, Error}, - {source, Source}]}, + QueuePid ! {fail, {{error, Error}, {source, Source}}}, ok end; @@ -224,7 +227,7 @@ format_warnings(Config, Source, Warnings, Opts) -> end, format_errors(Config, Source, Prefix, Warnings). -maybe_report([{error, {error, _Es, _Ws}=ErrorsAndWarnings}, {source, _}]) -> +maybe_report({{error, {error, _Es, _Ws}=ErrorsAndWarnings}, {source, _}}) -> maybe_report(ErrorsAndWarnings); maybe_report([{error, E}, {source, S}]) -> report(["unexpected error compiling " ++ S, io_lib:fwrite("~n~p~n", [E])]); @@ -239,12 +242,7 @@ report(Messages) -> format_errors(Config, _MainSource, Extra, Errors) -> [begin - AbsSource = case rebar_utils:processing_base_dir(Config) of - true -> - Source; - false -> - filename:absname(Source) - end, + AbsSource = maybe_absname(Config, Source), [format_error(AbsSource, Extra, Desc) || Desc <- Descs] end || {Source, Descs} <- Errors]. @@ -258,3 +256,11 @@ format_error(AbsSource, Extra, {Line, Mod, Desc}) -> format_error(AbsSource, Extra, {Mod, Desc}) -> ErrorDesc = Mod:format_error(Desc), ?FMT("~s: ~s~s~n", [AbsSource, Extra, ErrorDesc]). + +maybe_absname(Config, Filename) -> + case rebar_utils:processing_base_dir(Config) of + true -> + Filename; + false -> + filename:absname(Filename) + end. diff --git a/src/rebar_erlydtl_compiler.erl b/src/rebar_erlydtl_compiler.erl index 6172879..fea8ea6 100644 --- a/src/rebar_erlydtl_compiler.erl +++ b/src/rebar_erlydtl_compiler.erl @@ -210,6 +210,10 @@ do_compile(Config, Source, Target, DtlOpts) -> Opts) of ok -> ok; + {ok, _Mod, Ws} -> + rebar_base_compiler:ok_tuple(Config, Source, Ws); + {ok, _Mod, _Bin, Ws} -> + rebar_base_compiler:ok_tuple(Config, Source, Ws); error -> rebar_base_compiler:error_tuple(Config, Source, [], [], Opts); {error, {_File, _Msgs} = Error} -> diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl index 6ea28f7..0219d96 100644 --- a/src/rebar_eunit.erl +++ b/src/rebar_eunit.erl @@ -84,8 +84,7 @@ eunit(Config, _AppFile) -> ok = ensure_dirs(), %% Save code path CodePath = setup_code_path(), - CompileOnly = rebar_utils:get_experimental_global(Config, compile_only, - false), + CompileOnly = rebar_config:get_global(Config, compile_only, false), {ok, SrcErls} = rebar_erlc_compiler:test_compile(Config, "eunit", ?EUNIT_DIR), case CompileOnly of @@ -126,7 +125,8 @@ info_help(Description) -> " tests=\"baz\" (For every existing suite, run the first test whose~n" " name starts with bar and, if no such test exists,~n" " run the test whose name starts with bar in the~n" - " suite's _tests module)~n", + " suite's _tests module)~n" + " compile_only=true (Compile but do not run tests)", [ Description, {eunit_opts, []}, @@ -260,7 +260,7 @@ get_tests(Config, SuitesProvided, ModuleBeamFiles, FilteredModules) -> get_matching_tests(Config, Modules). get_matching_tests(Config, Modules) -> - RawFunctions = rebar_utils:get_experimental_global(Config, tests, ""), + RawFunctions = rebar_config:get_global(Config, tests, ""), Tests = [list_to_atom(F1) || F1 <- string:tokens(RawFunctions, ",")], case Tests of [] -> diff --git a/src/getopt.erl b/src/rebar_getopt.erl index f9852fb..79b871d 100644 --- a/src/getopt.erl +++ b/src/rebar_getopt.erl @@ -8,10 +8,11 @@ %%% a copy of the New BSD license with this software. If not, it can be %%% retrieved from: http://www.opensource.org/licenses/bsd-license.php %%%------------------------------------------------------------------- --module(getopt). +-module(rebar_getopt). -author('juanjo@comellas.org'). --export([parse/2, usage/2, usage/3, usage/4, tokenize/1]). +-export([parse/2, check/2, parse_and_check/2, format_error/2, + usage/2, usage/3, usage/4, tokenize/1]). -export([usage_cmd_line/2]). -define(LINE_LENGTH, 75). @@ -57,11 +58,52 @@ -export_type([arg_type/0, arg_value/0, arg_spec/0, simple_option/0, compound_option/0, option/0, option_spec/0]). -%% @doc Parse the command line options and arguments returning a list of tuples -%% and/or atoms using the Erlang convention for sending options to a -%% function. +%% @doc Parse the command line options and arguments returning a list of tuples +%% and/or atoms using the Erlang convention for sending options to a +%% function. Additionally perform check if all required options (the ones +%% without default values) are present. The function is a combination of +%% two calls: parse/2 and check/2. +-spec parse_and_check([option_spec()], string() | [string()]) -> + {ok, {[option()], [string()]}} | {error, {Reason :: atom(), Data :: term()}}. +parse_and_check(OptSpecList, CmdLine) when is_list(OptSpecList), is_list(CmdLine) -> + case parse(OptSpecList, CmdLine) of + {ok, {Opts, _}} = Result -> + case check(OptSpecList, Opts) of + ok -> Result; + Error -> Error + end; + Error -> + Error + end. + +%% @doc Check the parsed command line arguments returning ok if all required +%% options (i.e. that don't have defaults) are present, and returning +%% error otherwise. +-spec check([option_spec()], [option()]) -> + ok | {error, {Reason :: atom(), Option :: atom()}}. +check(OptSpecList, ParsedOpts) when is_list(OptSpecList), is_list(ParsedOpts) -> + try + RequiredOpts = [Name || {Name, _, _, Arg, _} <- OptSpecList, + not is_tuple(Arg) andalso Arg =/= undefined], + lists:foreach(fun (Option) -> + case proplists:is_defined(Option, ParsedOpts) of + true -> + ok; + false -> + throw({error, {missing_required_option, Option}}) + end + end, RequiredOpts) + catch + _:Error -> + Error + end. + + +%% @doc Parse the command line options and arguments returning a list of tuples +%% and/or atoms using the Erlang convention for sending options to a +%% function. -spec parse([option_spec()], string() | [string()]) -> - {ok, {[option()], [string()]}} | {error, {Reason :: atom(), Data :: any()}}. + {ok, {[option()], [string()]}} | {error, {Reason :: atom(), Data :: term()}}. parse(OptSpecList, CmdLine) when is_list(CmdLine) -> try Args = if @@ -101,6 +143,24 @@ parse(OptSpecList, OptAcc, ArgAcc, _ArgPos, []) -> {ok, {lists:reverse(append_default_options(OptSpecList, OptAcc)), lists:reverse(ArgAcc)}}. +%% @doc Format the error code returned by prior call to parse/2 or check/2. +-spec format_error([option_spec()], {error, {Reason :: atom(), Data :: term()}} | + {Reason :: term(), Data :: term()}) -> string(). +format_error(OptSpecList, {error, Reason}) -> + format_error(OptSpecList, Reason); +format_error(OptSpecList, {missing_required_option, Name}) -> + {_Name, Short, Long, _Type, _Help} = lists:keyfind(Name, 1, OptSpecList), + lists:flatten(["missing required option: -", [Short], " (", to_string(Long), ")"]); +format_error(_OptSpecList, {invalid_option, OptStr}) -> + lists:flatten(["invalid option: ", to_string(OptStr)]); +format_error(_OptSpecList, {invalid_option_arg, {Name, Arg}}) -> + lists:flatten(["option \'", to_string(Name) ++ "\' has invalid argument: ", to_string(Arg)]); +format_error(_OptSpecList, {invalid_option_arg, OptStr}) -> + lists:flatten(["invalid option argument: ", to_string(OptStr)]); +format_error(_OptSpecList, {Reason, Data}) -> + lists:flatten([to_string(Reason), " ", to_string(Data)]). + + %% @doc Parse a long option, add it to the option accumulator and continue %% parsing the rest of the arguments recursively. %% A long option can have the following syntax: @@ -698,7 +758,7 @@ format_usage_line(_MaxOptionLength, _MaxLineLength, {_OptionLength, OptionText, %% @doc Wrap a text line converting it into several text lines so that the -%% length of each one of them is never over HelpLength characters. +%% length of each one of them is never over Length characters. -spec wrap_text_line(Length :: non_neg_integer(), Text :: string()) -> [string()]. wrap_text_line(Length, Text) -> wrap_text_line(Length, Text, [], 0, []). @@ -730,7 +790,7 @@ default_arg_value_to_string(Value) when is_binary(Value) -> default_arg_value_to_string(Value) when is_integer(Value) -> integer_to_list(Value); default_arg_value_to_string(Value) when is_float(Value) -> - float_to_list(Value); + lists:flatten(io_lib:format("~w", [Value])); default_arg_value_to_string(Value) -> Value. @@ -832,7 +892,7 @@ get_env_var(Prefix, Suffix, []) -> Prefix ++ Suffix. --spec line_length() -> non_neg_integer(). +-spec line_length() -> 0..?LINE_LENGTH. line_length() -> case io:columns() of {ok, Columns} when Columns < ?LINE_LENGTH -> @@ -840,3 +900,15 @@ line_length() -> _ -> ?LINE_LENGTH end. + + +-spec to_string(term()) -> string(). +to_string(List) when is_list(List) -> + case io_lib:printable_list(List) of + true -> List; + false -> io_lib:format("~p", [List]) + end; +to_string(Atom) when is_atom(Atom) -> + atom_to_list(Atom); +to_string(Value) -> + io_lib:format("~p", [Value]). diff --git a/src/mustache.erl b/src/rebar_mustache.erl index f6963cd..9016c0f 100644 --- a/src/mustache.erl +++ b/src/rebar_mustache.erl @@ -23,7 +23,7 @@ %% See the README at http://github.com/mojombo/mustache.erl for additional %% documentation and usage examples. --module(mustache). %% v0.1.0 +-module(rebar_mustache). %% v0.1.0 -author("Tom Preston-Werner"). -export([compile/1, compile/2, render/1, render/2, render/3, get/2, get/3, escape/1, start/1]). @@ -31,6 +31,8 @@ section_re = undefined, tag_re = undefined}). +-define(MUSTACHE_STR, "rebar_mustache"). + compile(Body) when is_list(Body) -> State = #mstate{}, CompiledTemplate = pre_compile(Body, State), @@ -108,7 +110,7 @@ compile_section(Name, Content, State) -> Mod = State#mstate.mod, Result = compiler(Content, State), "fun() -> " ++ - "case mustache:get(" ++ Name ++ ", Ctx, " ++ atom_to_list(Mod) ++ ") of " ++ + "case " ++ ?MUSTACHE_STR ++ ":get(" ++ Name ++ ", Ctx, " ++ atom_to_list(Mod) ++ ") of " ++ "\"true\" -> " ++ Result ++ "; " ++ "\"false\" -> " ++ @@ -143,10 +145,10 @@ tag_kind(T, {K0, K1}) -> compile_tag(none, Content, State) -> Mod = State#mstate.mod, - "mustache:escape(mustache:get(" ++ Content ++ ", Ctx, " ++ atom_to_list(Mod) ++ "))"; + ?MUSTACHE_STR ++ ":escape(" ++ ?MUSTACHE_STR ++ ":get(" ++ Content ++ ", Ctx, " ++ atom_to_list(Mod) ++ "))"; compile_tag("{", Content, State) -> Mod = State#mstate.mod, - "mustache:get(" ++ Content ++ ", Ctx, " ++ atom_to_list(Mod) ++ ")"; + ?MUSTACHE_STR ++ ":get(" ++ Content ++ ", Ctx, " ++ atom_to_list(Mod) ++ ")"; compile_tag("!", _Content, _State) -> "[]". diff --git a/src/rebar_qc.erl b/src/rebar_qc.erl index 53a6f52..99d37a2 100644 --- a/src/rebar_qc.erl +++ b/src/rebar_qc.erl @@ -67,7 +67,9 @@ info(help, qc) -> "Valid rebar.config options:~n" " {qc_opts, [{qc_mod, module()}, Options]}~n" " ~p~n" - " ~p~n", + " ~p~n" + "Valid command line options:~n" + " compile_only=true (Compile but do not test properties)", [ {qc_compile_opts, []}, {qc_first_files, []} @@ -142,8 +144,7 @@ run(Config, QC, QCOpts) -> ok = ensure_dirs(), CodePath = setup_codepath(), - CompileOnly = rebar_utils:get_experimental_global(Config, compile_only, - false), + CompileOnly = rebar_config:get_global(Config, compile_only, false), %% Compile erlang code to ?QC_DIR, using a tweaked config %% with appropriate defines, and include all the test modules %% as well. diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index c21daa3..43bb8da 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -103,7 +103,7 @@ render(Bin, Context) -> ReOpts = [global, {return, list}], Str0 = re:replace(Bin, "\\\\", "\\\\\\", ReOpts), Str1 = re:replace(Str0, "\"", "\\\\\"", ReOpts), - mustache:render(Str1, Context). + rebar_mustache:render(Str1, Context). %% =================================================================== %% Internal functions diff --git a/src/rebar_upgrade.erl b/src/rebar_upgrade.erl index 5814e51..3a38a08 100644 --- a/src/rebar_upgrade.erl +++ b/src/rebar_upgrade.erl @@ -87,7 +87,8 @@ info(help, 'generate-upgrade') -> ?CONSOLE("Build an upgrade package.~n" "~n" "Valid command line options:~n" - " previous_release=path~n", + " previous_release=path~n" + " target_dir=target_dir (optional)~n", []). run_checks(Config, OldVerPath, ReltoolConfig) -> @@ -97,10 +98,7 @@ run_checks(Config, OldVerPath, ReltoolConfig) -> {Name, Ver} = rebar_rel_utils:get_reltool_release_info(ReltoolConfig), - NewVerPath = - filename:join( - [rebar_rel_utils:get_target_parent_dir(Config, ReltoolConfig), - Name]), + NewVerPath = rebar_rel_utils:get_target_dir(Config, ReltoolConfig), true = rebar_utils:prop_check(filelib:is_dir(NewVerPath), "Release directory doesn't exist (~p)~n", [NewVerPath]), |