Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catch up with rebar 3.18 internal API changes #3

Open
wants to merge 6 commits into
base: develop-3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
warnings_as_errors]}.

{deps, [
{cuttlefish, {git,"https://github.com/basho/cuttlefish.git", {branch, "develop-3.0"}}}
{cuttlefish, {git,"https://github.com/TI-Tokyo/cuttlefish.git", {tag, "2.2.1rc1"}}}
]}.

{xref_checks, [
Expand Down
15 changes: 9 additions & 6 deletions src/rebar3_cuttlefish_release.erl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
-module(rebar3_cuttlefish_release).
-behaviour(provider).

-export([init/1
,do/1
,format_error/1]).
-export([ init/1
, do/1
, format_error/1
]).

-define(PROVIDER, release).
-define(NAMESPACE, default).
Expand All @@ -22,7 +23,7 @@ init(State) ->
{bare, true}, % The task can be run by the user, always true
{deps, ?DEPS}, % The list of dependencies
{example, "rebar3 cuttlefish release"}, % How to use the plugin
{opts, relx:opt_spec_list()}, % list of options understood by the plugin
{opts, rebar_relx:opt_spec_list()}, % list of options understood by the plugin
{short_desc, "Rebar3 cuttlefish release plugin"},
{desc, ""}
]),
Expand Down Expand Up @@ -99,7 +100,7 @@ do(State) ->
State1 = rebar_state:set(State, relx, lists:keydelete(overlay, 1, Relx) ++
[{generate_start_script, DisableCFRelScripts},
{overlay, Overlays3} | StartHookState]),
Res = rebar_relx:do(rlx_prv_release, "release", ?PROVIDER, State1),
Res = rebar_relx:do(?PROVIDER, State1),
SchemaGlob = filename:join([TargetDir, "share", "schema", "*.schema"]),
ReleaseSchemas = filelib:wildcard(SchemaGlob),

Expand All @@ -117,6 +118,8 @@ do(State) ->
Res
end.



-spec format_error(any()) -> iolist().
format_error({no_cuttlefish_escript, ProfileDir}) ->
io_lib:format("No cuttlefish escript found under ~s or ~s", [filename:join(ProfileDir, "bin"),
Expand Down Expand Up @@ -162,7 +165,7 @@ maybe_set_startup_hook(false, _State) ->
[{sys_config, false}, {vm_args, false}];
maybe_set_startup_hook(true, State) ->
RelxState = rebar_state:get(State, relx),
StartHooks0 =
StartHooks0 =
case lists:keyfind(extended_start_script_hooks, 1, RelxState) of
{extended_start_script_hooks, StartHooks1} ->
do_set_start_hook(StartHooks1);
Expand Down
12 changes: 7 additions & 5 deletions src/rebar3_cuttlefish_tar.erl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
-module(rebar3_cuttlefish_tar).
-behaviour(provider).

-export([init/1
,do/1
,format_error/1]).
-export([ init/1
, do/1
, format_error/1
]).

-define(PROVIDER, tar).
-define(NAMESPACE, default).
Expand All @@ -21,7 +22,7 @@ init(State) ->
{bare, true}, % The task can be run by the user, always true
{deps, ?DEPS}, % The list of dependencies
{example, "rebar3 cuttlefish tar"}, % How to use the plugin
{opts, relx:opt_spec_list()}, % list of options understood by the plugin
{opts, rebar_relx:opt_spec_list()}, % list of options understood by the plugin
{short_desc, "Rebar3 cuttlefish release tarball plugin"},
{desc, ""}
]),
Expand All @@ -30,7 +31,8 @@ init(State) ->

-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
rebar_relx:do(rlx_prv_release, "tar", ?PROVIDER, State).
rebar_relx:do(?PROVIDER, State).


-spec format_error(any()) -> iolist().
format_error(Error) ->
Expand Down