From ecc8a05b4bfcdd32a20cdb1c84eba91ad0e9a5a0 Mon Sep 17 00:00:00 2001 From: Grigory Starinkin Date: Tue, 20 Nov 2018 07:40:42 +0000 Subject: [PATCH] change zip package location to make tooling happy --- src/rebar3_erllambda_rlx_zip_prv.erl | 10 +++++++++- src/rebar3_erllambda_zip.erl | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/rebar3_erllambda_rlx_zip_prv.erl b/src/rebar3_erllambda_rlx_zip_prv.erl index 02a3b88..13b2bda 100644 --- a/src/rebar3_erllambda_rlx_zip_prv.erl +++ b/src/rebar3_erllambda_rlx_zip_prv.erl @@ -47,10 +47,18 @@ format_error(ErrorDetail) -> %% Internal Functions %%============================================================================ archive_path(State, Release) -> - Dir = rlx_state:base_output_dir(State), + Dir = archive_dir(State), FileName = archive_name(Release), filename:join(Dir, FileName). +archive_dir(State) -> + case get({rebar3_erllambda_rlx_zip_prv, archive_dir}) of + undefined -> + rlx_state:base_output_dir(State); + Dir -> + Dir + end. + archive_name(Release) -> Name = atom_to_list(rlx_release:name(Release)), Vsn = rlx_release:vsn(Release), diff --git a/src/rebar3_erllambda_zip.erl b/src/rebar3_erllambda_zip.erl index d992efd..c853f52 100644 --- a/src/rebar3_erllambda_zip.erl +++ b/src/rebar3_erllambda_zip.erl @@ -54,6 +54,8 @@ do( State ) -> rebar_api:info( "generating erllambda zip package", [] ), State1 = rebar3_erllambda:add_property( State, relx, add_providers, rebar3_erllambda_rlx_zip_prv), + %% Internal tooling expects artifacts in this specific location, to be fixed + set_archive_dir(State1), rebar_relx:do(rebar3_erllambda_rlx_prv, "erllambda_zip", ?PROVIDER, State1). %%%--------------------------------------------------------------------------- @@ -68,3 +70,6 @@ format_error( Error ) -> %%============================================================================ %% Internal Functions %%============================================================================ +set_archive_dir(State) -> + BaseDir = rebar_dir:base_dir(State), + put({rebar3_erllambda_rlx_zip_prv, archive_dir}, BaseDir).