forked from oban-bg/oban
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
145 lines (131 loc) · 3.88 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
defmodule Oban.MixProject do
use Mix.Project
@version "2.0.0-rc.1"
def project do
[
app: :oban,
version: @version,
elixir: "~> 1.8",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
aliases: aliases(),
preferred_cli_env: [
bench: :test,
ci: :test,
"test.setup": :test
],
# Hex
package: package(),
description: """
Robust job processing, backed by modern PostgreSQL.
""",
# Dialyzer
dialyzer: [
plt_add_apps: [:ex_unit],
plt_core_path: "_build/#{Mix.env()}",
flags: [:error_handling, :race_conditions, :underspecs]
],
# Docs
name: "Oban",
docs: [
main: "Oban",
source_ref: "v#{@version}",
source_url: "https://github.com/sorentwo/oban",
extra_section: "GUIDES",
formatters: ["html"],
extras: extras() ++ pro_extras() ++ web_extras(),
groups_for_extras: groups_for_extras()
]
]
end
def application do
[
extra_applications: [:logger]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_env), do: ["lib"]
defp extras do
[
"CHANGELOG.md",
"guides/troubleshooting.md",
"guides/release_configuration.md",
"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"
]
end
defp pro_extras do
if File.exists?("../oban_pro") do
[
"../oban_pro/guides/pro/overview.md": [filename: "pro_overview"],
"../oban_pro/guides/pro/installation.md": [filename: "pro_installation"],
"../oban_pro/guides/plugins/lifeline.md": [title: "Lifeline Plugin"],
"../oban_pro/guides/plugins/dynamic_pruning.md": [title: "Dynamic Pruning Plugin"],
"../oban_pro/guides/plugins/reprioritization.md": [title: "Reprioritization Plugin"],
"../oban_pro/guides/workers/batch.md": [title: "Batch Worker"],
"../oban_pro/CHANGELOG.md": [filename: "pro-changelog", title: "Changelog"]
]
else
[]
end
end
defp web_extras do
if File.exists?("../oban_web") do
[
"../oban_web/guides/web/overview.md": [filename: "web_overview"],
"../oban_web/guides/web/installation.md": [filename: "web_installation"],
"../oban_web/guides/web/troubleshooting.md": [filename: "web_troubleshooting"],
"../oban_web/CHANGELOG.md": [filename: "web-changelog", title: "Changelog"]
]
else
[]
end
end
defp groups_for_extras do
[
Guides: ~r{guides/[^\/]+\.md},
Recipes: ~r{guides/recipes/.?},
Extras: ~r{^CHANGELOG.md},
"Oban Pro": ~r{oban_pro/.?},
"Oban Web": ~r{oban_web/.?}
]
end
defp package do
[
maintainers: ["Parker Selbert"],
licenses: ["Apache-2.0"],
links: %{github: "https://github.com/sorentwo/oban"}
]
end
defp deps do
[
{:ecto_sql, "~> 3.1"},
{:jason, "~> 1.1"},
{:postgrex, "~> 0.14"},
{:telemetry, "~> 0.4"},
{:stream_data, "~> 0.4", only: [:test, :dev]},
{:tzdata, "~> 1.0", only: [:test, :dev]},
{:benchee, "~> 1.0", only: [:test, :dev], runtime: false},
{:credo, "~> 1.4", only: [:test, :dev], runtime: false},
{:dialyxir, "~> 1.0", only: [:test, :dev], runtime: false},
{:ex_doc, "~> 0.20", only: [:test, :dev], runtime: false},
{:nimble_parsec, "~> 0.6", only: [:test, :dev], runtime: false, override: true}
]
end
defp aliases do
[
bench: "run bench/bench_helper.exs",
"test.setup": ["ecto.create", "ecto.migrate"],
ci: [
"format --check-formatted",
"credo --strict",
"test --raise",
"dialyzer"
]
]
end
end