From 553d35c2f67250589f738001001042c90ee600bb Mon Sep 17 00:00:00 2001 From: David Robakowski Date: Wed, 26 Oct 2016 23:51:28 +0200 Subject: [PATCH] Switch to rebar3 while keeping backward compatibility to rebar2 --- .gitignore | 1 + rebar.config | 4 ++-- rebar.config.script | 11 +++++++++++ rebar.lock | 10 ++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 rebar.config.script create mode 100644 rebar.lock diff --git a/.gitignore b/.gitignore index f96d01c..b638e85 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ dump.rdb .rebar _rel relx +_build diff --git a/rebar.config b/rebar.config index b46e392..7d6a2e6 100644 --- a/rebar.config +++ b/rebar.config @@ -5,6 +5,6 @@ }. {cover_enabled, true}. {deps, [ - {lager, ".*", {git, "https://github.com/basho/lager.git", {tag, "3.0.1"}}} - ,{jsx, "2.*", {git, "https://github.com/talentdeficit/jsx.git", {tag, "v2.7.1"}}} + {lager, "3.0.1"} + ,{jsx, "2.7.1"} ]}. diff --git a/rebar.config.script b/rebar.config.script new file mode 100644 index 0000000..b908be6 --- /dev/null +++ b/rebar.config.script @@ -0,0 +1,11 @@ +case erlang:function_exported(rebar3, main, 1) of + true -> % rebar3 + CONFIG; + false -> % rebar 2.x or older + %% Rebuild deps, possibly including those that have been moved to + %% profiles + [{deps, [ + {lager, ".*", {git, "https://github.com/basho/lager.git", {tag, "3.0.1"}}} + ,{jsx, ".*", {git, "https://github.com/talentdeficit/jsx.git", {tag, "v2.7.1"}}} + ]} | [Config || {Key, _Value}=Config <- CONFIG, Key =/= deps]] +end. diff --git a/rebar.lock b/rebar.lock new file mode 100644 index 0000000..947ac3f --- /dev/null +++ b/rebar.lock @@ -0,0 +1,10 @@ +{"1.1.0", +[{<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.7">>},1}, + {<<"jsx">>,{pkg,<<"jsx">>,<<"2.7.1">>},0}, + {<<"lager">>,{pkg,<<"lager">>,<<"3.0.1">>},0}]}. +[ +{pkg_hash,[ + {<<"goldrush">>, <<"349A351D17C71C2FDAA18A6C2697562ABE136FEC945F147B381F0CF313160228">>}, + {<<"jsx">>, <<"30CA834AC0AC6D745E4103D62CCC123C81399E4C937B7751A0185EF16425EDA8">>}, + {<<"lager">>, <<"480F0DFF5A53EBD5937EF6B469B18BC776F911BD0A8B29328900BA3E8BBF63C6">>}]} +].