From 964c57f96413f58d4447c785a2c7d43ccfffc5c6 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Tue, 5 May 2015 22:36:53 -0500 Subject: no_debug_info brings down size of escript from 757K to 549K --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index 2656e2b..d987fcb 100644 --- a/rebar.config +++ b/rebar.config @@ -33,7 +33,7 @@ [{platform_define, "R14", no_callback_support}, {platform_define, "^[0-9]+", namespaced_types}, {platform_define, "^R1[4|5]", deprecated_crypto}, - debug_info, + no_debug_info, warnings_as_errors]}. {dialyzer_plt_apps, [common_test, dialyzer, eunit, snmp]}. -- cgit v1.1 From bacde15b48a3b4d6594777dd040430ae611f09e5 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Thu, 7 May 2015 09:58:32 -0500 Subject: include debug_info when running tests of rebar3 --- rebar.config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rebar.config b/rebar.config index d987fcb..876f725 100644 --- a/rebar.config +++ b/rebar.config @@ -42,9 +42,9 @@ {profiles, [{test, [{deps, [ {meck, "", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.2"}}} - ]} - ] - }, + ]}, + {erl_opts, [debug_info]} + ]}, %% We don't want erlydtl to attempt to run on the first compile pass to bootstrap {bootstrap, []} -- cgit v1.1 From d53d3b56be9bb975f6d759d8e5df6af389db9d92 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 8 May 2015 18:06:06 -0500 Subject: update mustache to v0.3.0 and relx to 2.0.0 --- rebar.config | 26 +++++++++++++++++++++----- rebar.lock | 10 +++++++--- src/rebar_templater.erl | 2 +- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/rebar.config b/rebar.config index 876f725..5eaf6de 100644 --- a/rebar.config +++ b/rebar.config @@ -9,11 +9,11 @@ {git, "https://github.com/tsloughter/providers.git", {tag, "v1.3.1"}}}, {relx, "", - {git, "https://github.com/tsloughter/relx.git", - {branch, "mustache"}}}, + {git, "https://github.com/erlware/relx.git", + {tag, "v2.0.0"}}}, {mustache, ".*", {git, "https://github.com/soranoba/mustache.git", - {branch, "master"}}}, + {tag, "v0.3.0"}}}, {getopt, "", {git, "https://github.com/jcomellas/getopt.git", {branch, "master"}}}]}. @@ -51,5 +51,21 @@ ]}. %% Overrides -{overrides, [{override, erlware_commons, [{deps, []}, {plugins, []}]}, - {override, mustache, [{deps, []}, {plugins, []}]}]}. +{overrides, [{override, erlware_commons, [ + {erl_opts, [{platform_define, "^[0-9]+", namespaced_types}, + {platform_define, "^R1[4|5]", deprecated_crypto}, + no_debug_info, + warnings_as_errors]}, + {deps, []}, {plugins, []} + ]}, + {override, mustache, [ + {erl_opts, [{platform_define, "^[0-9]+", namespaced_types}, + no_debug_info]}, + {deps, []}, {plugins, []}]}, + {override, getopt, [{erl_opts, [no_debug_info]}]}, + {override, providers, [{erl_opts, [no_debug_info]}]}, + {override, relx, [{erl_opts, [{platform_define, "^[0-9]+", namespaced_types}, + {platform_define, "^R1[4|5]", deprecated_crypto}, + no_debug_info, + warnings_as_errors]}]} + ]}. diff --git a/rebar.lock b/rebar.lock index 39b3b48..6bff315 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,10 +1,14 @@ -[{<<"providers">>, +[{<<"relx">>, + {git,"https://github.com/erlware/relx.git", + {ref,"2e59b1c95575b3c104cc191e954c82baadc43c6c"}}, + 0}, + {<<"providers">>, {git,"https://github.com/tsloughter/providers.git", {ref,"7563ba7e916d5a35972b25b3aa1945ffe0a8e7a5"}}, 0}, {<<"mustache">>, - {git,"https://github.com/tsloughter/mustache.git", - {ref,"fe99ec4fcc4cf3f169d4851b4d1b7b5780b8d464"}}, + {git,"https://github.com/soranoba/mustache.git", + {ref,"e5401042c66039eef20ee81abc1537ced1f22bc7"}}, 0}, {<<"getopt">>, {git,"https://github.com/jcomellas/getopt.git", diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index c5cec9f..353fa36 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -380,4 +380,4 @@ write_file(Output, Data, Force) -> %% Render a binary to a string, using mustache and the specified context %% render(Bin, Context) -> - mustache:render(ec_cnv:to_binary(Bin), Context). + mustache:render(ec_cnv:to_binary(Bin), Context, [{key_type, atom}]). -- cgit v1.1 From c5aee4b375818a3e1cd6cc94af89bf2b7dc456f3 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 8 May 2015 18:58:31 -0500 Subject: ignore pkgs that can't build with rebar or make --- src/rebar_prv_update.erl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl index 973b275..942b386 100644 --- a/src/rebar_prv_update.erl +++ b/src/rebar_prv_update.erl @@ -72,6 +72,10 @@ write_registry(Dict, {digraph, Edges, Vertices, Neighbors, _}, State) -> ets:tab2file(Neighbors, filename:join(RegistryDir, "neighbors")), file:write_file(filename:join(RegistryDir, "dict"), term_to_binary(Dict)). +is_supported(<<"make">>) -> true; +is_supported(<<"rebar">>) -> true; +is_supported(_) -> false. + hex_to_graph(Filename) -> {ok, T} = ets:file2tab(Filename), Graph = digraph:new(), @@ -83,9 +87,14 @@ hex_to_graph(Filename) -> ok end, ok, T), - Dict1 = ets:foldl(fun({{Pkg, PkgVsn}, [Deps | _]}, Dict) -> - DepsList = update_graph(Pkg, PkgVsn, Deps, T, Graph), - dict:store({Pkg, PkgVsn}, DepsList, Dict); + Dict1 = ets:foldl(fun({{Pkg, PkgVsn}, [Deps, _, BuildTools | _]}, Dict) when is_list(BuildTools) -> + case lists:any(fun is_supported/1, BuildTools) of + true -> + DepsList = update_graph(Pkg, PkgVsn, Deps, T, Graph), + dict:store({Pkg, PkgVsn}, DepsList, Dict); + false -> + Dict + end; (_, Dict) -> Dict end, dict:new(), T), -- cgit v1.1