aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-30 00:20:18 +0100
committerLoïc Hoguin <[email protected]>2018-11-30 00:20:18 +0100
commit1f0a614d56f7208fa5aec38731b9451b9f18bec6 (patch)
tree56cc80d8c37b6dcbcaa5b361e5aa7df83ea540ec
parent037ab74c1f5d980e66f1d460de87c7cccd086316 (diff)
downloaderlang.mk-1f0a614d56f7208fa5aec38731b9451b9f18bec6.tar.gz
erlang.mk-1f0a614d56f7208fa5aec38731b9451b9f18bec6.tar.bz2
erlang.mk-1f0a614d56f7208fa5aec38731b9451b9f18bec6.zip
Add autopatch for LFE projects
Currently experimental. It'll enable lfe.mk when it encounters the rebar3 plugin lfe-compile. Tested against some small library. Note that it adds lfe as a build dependency with no version given so the latest master will be fetched right now. This can be overriden in the parent project.
-rw-r--r--core/deps.mk11
-rw-r--r--test/Makefile2
2 files changed, 12 insertions, 1 deletions
diff --git a/core/deps.mk b/core/deps.mk
index 225ecb4..3d0bab7 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -467,6 +467,17 @@ define dep_autopatch_rebar.erl
end,
[PortSpec(S) || S <- PortSpecs]
end,
+ fun() ->
+ case lists:keyfind(plugins, 1, Conf) of
+ false -> ok;
+ {_, Plugins0} ->
+ Plugins = [P || P <- Plugins0, is_tuple(P)],
+ case lists:keyfind('lfe-compile', 1, Plugins) of
+ false -> ok;
+ _ -> Write("\nBUILD_DEPS = lfe lfe.mk\ndep_lfe.mk = git https://github.com/ninenines/lfe.mk master\nDEP_PLUGINS = lfe.mk\n")
+ end
+ end
+ end(),
Write("\ninclude $$\(if $$\(ERLANG_MK_FILENAME),$$\(ERLANG_MK_FILENAME),erlang.mk)"),
RunPlugin = fun(Plugin, Step) ->
case erlang:function_exported(Plugin, Step, 2) of
diff --git a/test/Makefile b/test/Makefile
index 453beb6..2f9e875 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -132,7 +132,7 @@ $(eval $(foreach t,$(patsubst %.mk,%,$(patsubst plugin_%,%,$(wildcard plugin_*.m
# Packages.
PACKAGES = $(foreach pkg,$(sort $(wildcard ../index/*.mk)),$(notdir $(basename $(pkg))))
-EXCLUDE_FROM_CHECK = ['ci.erlang.mk', hexer_mk, inaka_mk, rabbitmq_codegen]
+EXCLUDE_FROM_CHECK = ['ci.erlang.mk', hexer_mk, inaka_mk, 'lfe.mk', rabbitmq_codegen]
packages: $(addprefix pkg-,$(PACKAGES))