Get ejabberd version from vars.config

This commit is contained in:
Badlop 2021-07-15 20:54:56 +02:00
parent df8b0cb1a5
commit 72e069d9ec
1 changed files with 9 additions and 1 deletions

10
mix.exs
View File

@ -3,7 +3,7 @@ defmodule Ejabberd.Mixfile do
def project do def project do
[app: :ejabberd, [app: :ejabberd,
version: "21.4.0", version: version(),
description: description(), description: description(),
elixir: "~> 1.4", elixir: "~> 1.4",
elixirc_paths: ["lib"], elixirc_paths: ["lib"],
@ -17,6 +17,14 @@ defmodule Ejabberd.Mixfile do
deps: deps()] deps: deps()]
end end
def version do
case config(:vsn) do
:false -> "0.0.0" # ./configure wasn't run: vars.config not created
'0.0' -> "0.0.0" # the full git repository wasn't downloaded
vsn -> String.replace(:erlang.list_to_binary(vsn), ".0", ".")
end
end
def description do def description do
""" """
Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server) Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)