-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmix.exs
124 lines (107 loc) · 2.77 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
defmodule NebulexAdaptersCachex.MixProject do
use Mix.Project
@source_url "https://github.com/cabol/nebulex_adapters_cachex"
@version "2.1.1"
@nbx_tag "2.5.2"
@nbx_vsn "2.5"
def project do
[
app: :nebulex_adapters_cachex,
version: @version,
elixir: "~> 1.9",
elixirc_paths: elixirc_paths(Mix.env()),
aliases: aliases(),
deps: deps(),
# 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: "A Nebulex adapter for Cachex",
# Docs
docs: [
main: "Nebulex.Adapters.Cachex",
source_ref: "v#{@version}",
source_url: @source_url
]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
def application do
[]
end
defp deps do
[
nebulex_dep(),
{:cachex, "~> 3.6"},
{:telemetry, "~> 0.4 or ~> 1.0", optional: true},
# Test & Code Analysis
{:excoveralls, "~> 0.17", only: :test},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:sobelow, "~> 0.13", only: [:dev, :test], runtime: false},
{:stream_data, "~> 0.6", only: [:dev, :test]},
# Benchmark Test
{:benchee, "~> 1.1", only: :test},
{:benchee_html, "~> 1.0", only: :test},
# Docs
{:ex_doc, "~> 0.30", 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",
"sobelow --exit --skip",
"dialyzer --format short"
]
]
end
defp package do
[
name: :nebulex_adapters_cachex,
maintainers: ["Carlos Bolanos"],
licenses: ["MIT"],
links: %{"GitHub" => @source_url}
]
end
defp dialyzer do
[
plt_add_apps: [:nebulex],
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