-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathmix.exs
133 lines (115 loc) · 2.95 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
defmodule NebulexRedisAdapter.MixProject do
use Mix.Project
@source_url "https://github.com/cabol/nebulex_redis_adapter"
@version "2.4.2"
@nbx_tag "2.6.4"
@nbx_vsn "2.6"
def project do
[
app: :nebulex_redis_adapter,
version: @version,
elixir: "~> 1.12",
elixirc_paths: elixirc_paths(Mix.env()),
aliases: aliases(),
deps: deps(),
# Docs
name: "NebulexRedisAdapter",
docs: docs(),
# Testing
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
check: :test,
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
# Dialyzer
dialyzer: dialyzer(),
# Hex
package: package(),
description: "Nebulex adapter for Redis"
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
nebulex_dep(),
{:redix, "~> 1.5"},
{:nimble_options, "~> 0.5 or ~> 1.0"},
{:crc, "~> 0.10", optional: true},
{:jchash, "~> 0.1", optional: true},
{:telemetry, "~> 0.4 or ~> 1.0", optional: true},
# Test & Code Analysis
{:excoveralls, "~> 0.18", only: :test},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:mimic, "~> 1.9", only: :test},
# Benchmark Test
{:benchee, "~> 1.3", only: :test},
{:benchee_html, "~> 1.0", only: :test},
# Docs
{:ex_doc, "~> 0.34", only: [:dev, :test], runtime: false}
]
end
defp nebulex_dep do
if path = System.get_env("NEBULEX_PATH") do
{:nebulex, "~> #{@nbx_tag}", path: path}
else
{:nebulex, "~> #{@nbx_vsn}"}
end
end
defp aliases do
[
"nbx.setup": [
"cmd rm -rf nebulex",
"cmd git clone --depth 1 --branch v#{@nbx_tag} https://github.com/cabol/nebulex"
],
check: [
"compile --warnings-as-errors",
"format --check-formatted",
"credo --strict",
"coveralls.html",
"dialyzer --format short"
]
]
end
defp package do
[
name: :nebulex_redis_adapter,
maintainers: ["Carlos Bolanos"],
licenses: ["MIT"],
links: %{"GitHub" => @source_url}
]
end
defp docs do
[
main: "NebulexRedisAdapter",
source_ref: "v#{@version}",
canonical: "http://hexdocs.pm/nebulex_redis_adapter",
source_url: @source_url
]
end
defp dialyzer do
[
plt_add_apps: [:nebulex, :crc, :jchash],
plt_file: {:no_warn, "priv/plts/" <> plt_file_name()},
flags: [
:unmatched_returns,
:error_handling,
:no_opaque,
:unknown,
:no_return
]
]
end
defp plt_file_name do
"dialyzer-#{Mix.env()}-#{System.otp_release()}-#{System.version()}.plt"
end
end