-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathmix.exs
53 lines (44 loc) · 1.19 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
53
defmodule Plural.MixProject do
use Mix.Project
defp version do
version = git_vsn()
case Version.parse(version) do
{:ok, %Version{pre: ["pre" <> _ | _]} = version} ->
to_string(version)
{:ok, %Version{pre: []} = version} ->
to_string(version)
{:ok, %Version{patch: patch, pre: pre} = version} ->
to_string(%{version | patch: patch + 1, pre: ["dev" | pre]})
:error ->
Mix.shell().error("Failed to parse, falling back to 0.0.0")
"0.0.0"
end
end
defp git_vsn() do
case System.cmd("git", ~w[describe --dirty=+dirty]) do
{version, 0} ->
String.trim_leading(String.trim(version), "v")
{_, code} ->
Mix.shell().error("Git exited with code #{code}, falling back to 0.0.0")
"0.0.0"
end
end
def project do
[
apps_path: "apps",
version: version(),
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
defp deps do
[
{:distillery, "~> 2.1"},
{:x509, "~> 0.8.5"},
{:shards, "~> 1.1.0"},
{:ecto, "~> 3.9.0", override: true},
{:hackney, "~> 1.18.1", override: true},
{:absinthe_plug, "~> 1.5.8"},
]
end
end