Просмотр исходного кода

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.
Loïc Hoguin 6 лет назад
Родитель
Сommit
1f0a614d56
2 измененных файлов с 12 добавлено и 1 удалено
  1. 11 0
      core/deps.mk
  2. 1 1
      test/Makefile

+ 11 - 0
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

+ 1 - 1
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))