-
Notifications
You must be signed in to change notification settings - Fork 8
/
mix.exs
80 lines (68 loc) · 1.83 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
defmodule Dispenser.Mixfile do
use Mix.Project
@github_url "https://github.com/discord/dispenser"
def project do
[
app: :dispenser,
version: "0.1.1",
elixir: "~> 1.8",
elixirc_paths: elixirc_paths(Mix.env()),
elixirc_options: [warnings_as_errors: ci?()],
deps: deps(),
docs: docs(),
package: package(),
test_coverage: [tool: ExCoveralls]
]
end
def application do
[]
end
defp deps do
[
{:assert_eventually, "~> 0.2.0", only: [:test], runtime: false},
{:benchee, "~> 1.0", only: [:dev], runtime: false},
{:benchee_html, "~> 1.0", only: [:dev], runtime: false},
{:dialyxir, "~> 1.1.0", only: [:dev], runtime: false},
{:ex_doc, "~> 0.25.1", only: [:dev], runtime: false},
{:excoveralls, "~> 0.14.2", only: [:dev, :test], runtime: false},
{:limited_queue, "~> 0.1.0"}
]
end
defp ci?() do
System.get_env("CI") == "true"
end
defp docs do
source_ref = current_branch(ci?())
[
name: "dispenser",
extras: ["README.md", "LICENSE"],
main: "readme",
source_url_pattern: "#{@github_url}/blob/#{source_ref}/%{path}#L%{line}"
]
end
def package do
[
name: :dispenser,
description: "Elixir library to buffer and send events to subscribers.",
maintainers: [],
licenses: ["MIT"],
files: ["lib/*", "mix.exs", "README*", "LICENSE*"],
links: %{
"GitHub" => @github_url
}
]
end
@spec current_branch(is_continuous_integration :: boolean()) :: String.t()
defp current_branch(true), do: "master"
defp current_branch(false) do
"git"
|> System.cmd(["rev-parse", "--abbrev-ref", "HEAD"])
|> elem(0)
end
defp elixirc_paths(:test) do
elixirc_paths(:dev) ++ ["test/support"]
end
defp elixirc_paths(_) do
["lib"]
end
end