aboutsummaryrefslogtreecommitdiff
path: root/mix.exs
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2022-03-10 10:57:10 +0100
committerBadlop <badlop@process-one.net>2022-03-10 13:09:35 +0100
commitce8c2ca0fd390dd6f8370e90ff12f3a5a8787640 (patch)
tree98e7128611a6958a3627b42d3f455a2f580ba91e /mix.exs
parentAdd -boot and -boot_var in ejabberdctl instead of adding vm.args (diff)
Add fine-grained Elixir version requirement
1.4 is accepted in general 1.10 is required to build OTP releases 1.11 is required to run 'make relive' lower than 1.11.4 requires Erlang lower than 24 to build releases
Diffstat (limited to 'mix.exs')
-rw-r--r--mix.exs33
1 files changed, 31 insertions, 2 deletions
diff --git a/mix.exs b/mix.exs
index 22364b751..c18ad15c6 100644
--- a/mix.exs
+++ b/mix.exs
@@ -5,7 +5,7 @@ defmodule Ejabberd.MixProject do
[app: :ejabberd,
version: version(),
description: description(),
- elixir: "~> 1.4",
+ elixir: elixir_required_version(),
elixirc_paths: ["lib"],
compile_path: ".",
compilers: [:asn1] ++ Mix.compilers,
@@ -184,6 +184,35 @@ defmodule Ejabberd.MixProject do
end
end
+ defp elixir_required_version do
+ case {System.get_env("RELIVE", "false"),
+ MapSet.member?(MapSet.new(System.argv()), "release")}
+ do
+ {"true", _} ->
+ case Version.match?(System.version(), "~> 1.11") do
+ false ->
+ IO.puts("ERROR: To use 'make relive', Elixir 1.11.0 or higher is required.")
+ _ -> :ok
+ end
+ "~> 1.11"
+ {_, true} ->
+ case Version.match?(System.version(), "~> 1.10") do
+ false ->
+ IO.puts("ERROR: To build releases, Elixir 1.10.0 or higher is required.")
+ _ -> :ok
+ end
+ case Version.match?(System.version(), "< 1.11.4")
+ and :erlang.system_info(:otp_release) > '23' do
+ true ->
+ IO.puts("ERROR: To build releases with Elixir lower than 1.11.4, Erlang/OTP lower than 24 is required.")
+ _ -> :ok
+ end
+ "~> 1.10"
+ _ ->
+ "~> 1.4"
+ end
+ end
+
defp releases do
maybe_tar = case Mix.env() do
:prod -> [:tar]
@@ -228,7 +257,7 @@ defmodule Ejabberd.MixProject do
end
# Mix/Elixir lower than 1.11.0 use config/releases.exs instead of runtime.exs
- case Version.match?(System.version, ">= 1.11.0") do
+ case Version.match?(System.version, "~> 1.11") do
true ->
:ok
false ->