-
Notifications
You must be signed in to change notification settings - Fork 14
/
mix.exs
147 lines (139 loc) · 3.9 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
defmodule Spear.MixProject do
use Mix.Project
@source_url "https://github.com/NFIBrokerage/spear"
@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.1.0"
end)
def project do
[
app: :spear,
version: @version,
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
credo: :test,
coveralls: :test,
"coveralls.html": :test,
"coveralls.github": :test,
inch: :dev,
bless: :test,
test: :test,
dialyzer: :test
],
name: "Spear",
source_url: @source_url,
deps: deps(),
docs: docs(),
package: package(),
description: description()
]
end
def application do
[
extra_applications: [:crypto]
]
end
defp deps do
[
# hard dependencies
{:mint, "~> 1.0"},
{:gpb, "~> 4.0"},
{:event_store_db_gpb_protobufs, "~> 2.2"},
{:connection, "~> 1.0"},
# optional dependencies
{:jason, ">= 0.0.0", optional: true},
# dev/test utilities
{:castore, ">= 0.0.0", only: [:dev, :test]},
{:ex_doc, "~> 0.24", only: :dev, runtime: false},
# testing suite
{:credo, "~> 1.5", only: :test},
{:bless, "~> 1.0", only: :test},
{:excoveralls, "~> 0.7", only: :test}
]
end
defp elixirc_paths(:test), do: ["lib", "test/support", "test/fixtures"]
defp elixirc_paths(_), do: ["lib"]
defp package do
[
name: "spear",
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 sharp EventStoreDB 20+ client backed by mint"
end
defp docs do
[
deps: [],
language: "en",
formatters: ["html"],
main: Spear,
extras: [
"CHANGELOG.md",
"guides/writing_events.md",
"guides/streams.md",
"guides/link_resolution.md",
"guides/security.md",
"guides/pooling.md"
],
groups_for_extras: [
Guides: Path.wildcard("guides/*.md")
],
groups_for_modules: [
"Structures and Types": [
Spear.Acl,
Spear.Connection.Configuration,
Spear.Event,
Spear.ExpectationViolation,
Spear.Filter.Checkpoint,
Spear.StreamMetadata,
Spear.User,
Spear.ClusterMember,
Spear.Scavenge,
Spear.PersistentSubscription,
Spear.PersistentSubscription.Settings,
Spear.Position,
Spear.BatchAppendResult,
Spear.SupportedRpc
],
"Record interfaces": [
Spear.Records.Shared,
Spear.Records.Streams,
Spear.Records.Operations,
Spear.Records.Projections,
Spear.Records.Persistent,
Spear.Records.Users,
Spear.Records.Gossip,
Spear.Records.Monitoring,
Spear.Records.Google,
Spear.Records.Status,
Spear.Records.ServerFeatures
]
],
groups_for_functions: [
"Utility Functions": &(&1[:api] == :utils),
Streams: &(&1[:api] == :streams),
Users: &(&1[:api] == :users),
Operations: &(&1[:api] == :operations),
Projections: &(&1[:api] == :projections),
"Persistent Subscriptions": &(&1[:api] == :persistent),
Gossip: &(&1[:api] == :gossip),
Monitoring: &(&1[:api] == :monitoring),
"Server Features": &(&1[:api] == :server_features)
],
skip_undefined_reference_warnings_on: [
"CHANGELOG.md"
]
]
end
end