-
Notifications
You must be signed in to change notification settings - Fork 18
/
mix.exs
154 lines (144 loc) · 4.47 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
defmodule Slipstream.MixProject do
use Mix.Project
@source_url "https://github.com/NFIBrokerage/slipstream"
@version_file Path.join(__DIR__, ".version")
@external_resource @version_file
@version (case Regex.run(~r/^v([\d\.\w-]+)/, File.read!(@version_file),
capture: :all_but_first
) do
[version] -> version
nil -> "0.0.0"
end)
def project do
[
app: :slipstream,
version: @version,
# Slipstream makes use of the `@derive {Inspect, ..` feature introduced
# in elixir 1.8, but it only uses the feature if it detects that the
# current elixir version meets the requirements.
elixir: "~> 1.6",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: extra_compilers(Mix.env()) ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
deps: deps(),
preferred_cli_env: [
credo: :test,
coveralls: :test,
"coveralls.html": :test,
"coveralls.github": :test,
inch: :dev,
bless: :test,
test: :test,
dialyzer: :test,
docs: :docs
],
test_coverage: [tool: ExCoveralls],
package: package(),
description: description(),
source_url: "https://github.com/NFIBrokerage/slipstream",
name: "Slipstream",
docs: docs(),
dialyzer: [
ignore_warnings: ".dialyzer_ignore.exs",
list_unused_filters: true
]
]
end
defp elixirc_paths(env) when env in [:test, :dev],
do: ["lib", "test/support", "test/fixtures"]
defp elixirc_paths(_), do: ["lib"]
defp extra_compilers(env) when env in [:test, :dev, :docs], do: [:phoenix]
defp extra_compilers(_), do: []
def application do
[
mod: {Slipstream.Application, []},
extra_applications: [:logger]
]
end
defp deps do
[
{:mint_web_socket, "~> 1.0 or ~> 0.2"},
{:telemetry, "~> 1.0 or ~> 0.4"},
{:jason, "~> 1.0", optional: true},
{:nimble_options, "~> 1.0 or ~> 0.1"},
# docs
{:ex_doc, ">= 0.0.0", only: [:docs], runtime: false},
{:inch_ex, "== 2.1.0-rc.1", only: [:docs]},
# test
{:phoenix, "~> 1.6.16", only: [:dev, :test, :docs]},
{:cowlib, "~> 2.9", override: true, only: [:dev, :test]},
{:phoenix_pubsub, "~> 2.0", override: true, only: [:docs, :dev, :test]},
{:plug_cowboy, "~> 2.0", only: [:dev, :test]},
{:mox, "~> 1.0", only: [:dev, :test]},
{:credo, "~> 1.5", only: :test},
{:bless, "~> 1.0", only: :test},
{:excoveralls, "~> 0.7", only: :test},
{:dialyxir, "~> 1.0", only: [:dev, :test, :docs], runtime: false}
]
end
defp package do
[
name: "slipstream",
files: ~w(lib .formatter.exs mix.exs README.md .version),
licenses: ["Apache-2.0"],
links: %{
"GitHub" => @source_url,
"Changelog" => @source_url <> "/blob/main/CHANGELOG.md"
}
]
end
defp description do
"A slick websocket client for Phoenix channels"
end
defp docs do
[
deps: [],
language: "en",
formatters: ["html"],
main: Slipstream,
extras: [
"CHANGELOG.md",
"guides/telemetry.md",
"guides/implementation.md",
"examples/README.md": [filename: "examples", title: "Examples"],
"examples/graceful_startup/README.md": [
filename: "graceful_startup_example",
title: "Graceful Startup"
],
"examples/repeater/README.md": [
filename: "repeater_example",
title: "Repeater-style Client"
],
"examples/rejoin_on_reconnect/README.md": [
filename: "rejoin_on_reconnect_example",
title: "Rejoin on Reconnect"
],
"examples/gen_server/README.md": [
filename: "gen_server_example",
title: "GenServer Capabilities"
],
"examples/scripting/README.md": [
filename: "scripting_example",
title: "Scripting"
]
],
groups_for_extras: [
Guides: ["examples/README.md" | Path.wildcard("guides/*.md")],
Examples: Path.wildcard("examples/*/README.md")
],
groups_for_modules: [
Testing: [
Slipstream.SocketTest
]
],
groups_for_functions: [
"Synchronous Functions": &(&1[:synchronicity] == :synchronous)
],
skip_undefined_reference_warnings_on: [
"guides/implementation.md",
"guides/telemetry.md",
"CHANGELOG.md"
]
]
end
end