-
Notifications
You must be signed in to change notification settings - Fork 65
/
mix.exs
64 lines (55 loc) · 1.71 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
54
55
56
57
58
59
60
61
62
63
64
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(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
]
]
end
defp deps do
[
{:distillery, "~> 2.1"},
{:x509, "~> 0.8.5"},
{:shards, "~> 1.0"},
{:ecto, "~> 3.9.0", override: true},
{:hackney, "~> 1.18.1", override: true},
{:absinthe_plug, "~> 1.5.8", git: "https://github.com/absinthe-graphql/absinthe_plug.git", commit: "3a984cc341ebb32c79e7ae58b4ebd116d5c62f9e", override: true},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:sobelow, "~> 0.8", only: :dev},
{:excoveralls, "~> 0.10", only: :test},
{:junit_formatter, "~> 3.3", only: [:test]}
]
end
end