-
-
Notifications
You must be signed in to change notification settings - Fork 314
/
mix.exs
215 lines (197 loc) · 5.64 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
defmodule Oban.MixProject do
use Mix.Project
@source_url "https://github.com/oban-bg/oban"
@version "2.18.2"
def project do
[
app: :oban,
version: @version,
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
aliases: aliases(),
preferred_cli_env: [
bench: :test,
"test.ci": :test,
"test.reset": :test,
"test.setup": :test
],
xref: [exclude: [Postgrex.Error, MyXQL.Error]],
# Hex
package: package(),
description: """
Robust job processing, backed by modern PostgreSQL, SQLite3, and MySQL.
""",
# Dialyzer
dialyzer: [
plt_add_apps: [:ex_unit, :postgrex],
plt_core_path: "_build/#{Mix.env()}",
flags: [:error_handling, :missing_return, :underspecs]
],
# Docs
name: "Oban",
docs: [
main: "Oban",
api_reference: false,
logo: "assets/oban-logo.svg",
source_ref: "v#{@version}",
source_url: @source_url,
extra_section: "GUIDES",
formatters: ["html"],
extras: extras(),
groups_for_extras: groups_for_extras(),
groups_for_modules: groups_for_modules(),
skip_undefined_reference_warnings_on: ["CHANGELOG.md"]
]
]
end
def application do
[
mod: {Oban.Application, []},
extra_applications: [:logger]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_env), do: ["lib"]
defp extras do
[
# Introduction
"guides/introduction/installation.md",
"guides/introduction/ready_for_production.md",
# Learning
"guides/learning/defining_queues.md",
"guides/learning/scheduling_jobs.md",
"guides/learning/periodic_jobs.md",
"guides/learning/unique_jobs.md",
"guides/learning/operational_maintenance.md",
"guides/learning/instrumentation.md",
"guides/learning/error_handling.md",
"guides/learning/clustering.md",
"guides/learning/isolation.md",
# Advanced
"guides/advanced/writing_plugins.md",
"guides/advanced/release_configuration.md",
"guides/advanced/scaling.md",
"guides/advanced/troubleshooting.md",
# Upgrading
"guides/upgrading/v2.0.md",
"guides/upgrading/v2.6.md",
"guides/upgrading/v2.11.md",
"guides/upgrading/v2.12.md",
"guides/upgrading/v2.14.md",
"guides/upgrading/v2.17.md",
# Recipes
"guides/recipes/recursive-jobs.md",
"guides/recipes/reliable-scheduling.md",
"guides/recipes/reporting-progress.md",
"guides/recipes/expected-failures.md",
"guides/recipes/splitting-queues.md",
"guides/recipes/migrating-from-other-languages.md",
# Testing
"guides/testing/testing.md",
"guides/testing/testing_workers.md",
"guides/testing/testing_queues.md",
"guides/testing/testing_config.md",
"CHANGELOG.md": [title: "Changelog"]
]
end
defp groups_for_extras do
[
Introduction: ~r{guides/introduction/[^\/]+\.md},
Learning: ~r{guides/learning/[^\/]+\.md},
Advanced: ~r{guides/advanced/[^\/]+\.md},
Recipes: ~r{guides/recipes/.?},
Testing: ~r{guides/testing/.?},
"Upgrade Guides": ~r{guides/upgrading/.*}
]
end
defp groups_for_modules do
[
Plugins: [
Oban.Plugins.Cron,
Oban.Plugins.Gossip,
Oban.Plugins.Lifeline,
Oban.Plugins.Pruner,
Oban.Plugins.Reindexer,
Oban.Plugins.Repeater,
Oban.Plugins.Stager
],
Extending: [
Oban.Config,
Oban.Engine,
Oban.Notifier,
Oban.Peer,
Oban.Plugin,
Oban.Registry,
Oban.Repo
],
Migrations: [
Oban.Migrations.Postgres
],
Notifiers: [
Oban.Notifiers.Postgres,
Oban.Notifiers.PG
],
Peers: [
Oban.Peers.Database,
Oban.Peers.Global
],
Engines: [
Oban.Engines.Basic,
Oban.Engines.Inline,
Oban.Engines.Lite
]
]
end
defp package do
[
maintainers: ["Parker Selbert"],
licenses: ["Apache-2.0"],
files: ~w(lib .formatter.exs mix.exs README* CHANGELOG* LICENSE*),
links: %{
Website: "https://oban.pro",
Changelog: "#{@source_url}/blob/main/CHANGELOG.md",
GitHub: @source_url,
Sponsor: "https://oban.pro"
}
]
end
defp deps do
[
{:ecto_sql, "~> 3.10"},
{:ecto_sqlite3, "~> 0.9", optional: true},
{:jason, "~> 1.1"},
{:myxql, "~> 0.7", optional: true},
{:postgrex, "~> 0.16", optional: true},
{:telemetry, "~> 0.4 or ~> 1.0"},
{:stream_data, "~> 1.0", only: [:test, :dev]},
{:tz, "~> 0.24", only: [:test, :dev]},
{:benchee, "~> 1.0", only: [:test, :dev], runtime: false},
{:credo, "~> 1.7.7-rc.0", only: [:test, :dev], runtime: false},
{:dialyxir, "~> 1.0", only: [:test, :dev], runtime: false},
{:ex_doc, "~> 0.28", only: [:test, :dev], runtime: false},
{:makeup_diff, "~> 0.1", only: [:test, :dev], runtime: false}
]
end
defp aliases do
[
bench: "run bench/bench_helper.exs",
release: [
"cmd git tag v#{@version}",
"cmd git push",
"cmd git push --tags",
"hex.publish --yes"
],
"test.reset": ["ecto.drop --quiet", "test.setup"],
"test.setup": ["ecto.create --quiet", "ecto.migrate --quiet"],
"test.ci": [
"format --check-formatted",
"deps.unlock --check-unused",
"credo --strict",
"test --raise",
"dialyzer"
]
]
end
end