forked from kafka4beam/wolff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
52 lines (46 loc) · 1.06 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
defmodule Wolff.MixProject do
use Mix.Project
def project() do
[
app: :wolff,
version: read_version(),
elixir: "~> 1.13",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
erlc_paths: erlc_paths(Mix.env()),
deps: deps()
]
end
def application do
[
extra_applications: [:logger],
mod: {:wolff_app, []}
]
end
def elixirc_paths(:test), do: ["test", "src", "lib"]
def elixirc_paths(_), do: ["src", "lib"]
def erlc_paths(:test), do: ["test", "src"]
def erlc_paths(_), do: ["src"]
defp deps do
[
{:kafka_protocol, "4.1.0"},
{:replayq, "0.3.4"},
{:lc, "0.3.2"},
{:telemetry, "1.1.0"},
{:meck, "~> 0.9", only: [:test, :dev]},
{:redbug, "~> 2.0", only: [:test, :dev]},
]
end
defp read_version() do
try do
{out, 0} = System.cmd("git", ["describe", "--tags"])
out
|> String.trim()
|> Version.parse!()
|> Map.put(:pre, [])
|> to_string()
rescue
_ -> "0.1.0"
end
end
end