From 9b8ae80dabc8e194613a27cd52d0dcfab06b1fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Mon, 30 Oct 2017 13:55:10 +0100 Subject: [PATCH] Improve --enable-system-deps --- Makefile.in | 1 + rebar.config.script | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3d9388df7..86d4ca6d1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -93,6 +93,7 @@ deps: deps/.got deps/.got: rm -rf deps/.got rm -rf deps/.built + mkdir deps $(REBAR) get-deps && :> deps/.got deps/.built: deps/.got diff --git a/rebar.config.script b/rebar.config.script index 219514a2f..85f918fff 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -229,13 +229,22 @@ TestConfig = case file:read_file_info(TestConfigFile) of "" end, -ResolveDepPath = case IsRebar3 of - true -> +ResolveDepPath = case {SystemDeps, IsRebar3} of + {true, _} -> fun("deps/" ++ Rest) -> Slash = string:str(Rest, "/"), - Dir = "_build/default/lib/" ++ - string:sub_string(Rest, 1, Slash - 1), - Dir ++ string:sub_string(Rest, Slash); + code:lib_dir( + string:sub_string(Rest, 1, Slash -1)) ++ + string:sub_string(Rest, Slash); + (Path) -> + Path + end; + {_, true} -> + fun("deps/" ++ Rest) -> + Slash = string:str(Rest, "/"), + "_build/default/lib/" ++ + string:sub_string(Rest, 1, Slash - 1) ++ + string:sub_string(Rest, Slash); (Path) -> Path end; @@ -326,7 +335,7 @@ Rules = [ AppendList([{coveralls, ".*", {git, "https://github.com/markusn/coveralls-erl.git", "master"}}]), []}, {[post_hooks], [cover_enabled], os:getenv("TRAVIS") == "true", AppendList2(TravisPostHooks), [], false}, - {[overrides], [post_hook_configure], true, + {[overrides], [post_hook_configure], SystemDeps == false, AppendList2(GenDepsConfigure), [], []}, {[ct_extra_params], [eunit_compile_opts], true, AppendStr2(CtParams), "", []},