-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmix.exs
153 lines (140 loc) · 3.98 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
defmodule Tarearbol.Mixfile do
@moduledoc false
use Mix.Project
@app :tarearbol
@version "1.12.0"
def project do
[
app: @app,
version: @version,
elixir: "~> 1.10",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
compilers: compilers(Mix.env()),
preferred_cli_env: ["test.cluster": :ci],
package: package(),
description: description(),
deps: deps(),
aliases: aliases(),
xref: [exclude: []],
docs: docs(),
releases: [
{@app,
[
include_executables_for: [:unix],
applications: [logger: :permanent]
]}
],
dialyzer: [
plt_file: {:no_warn, ".dialyzer/plts/dialyzer.plt"},
plt_add_deps: :app_tree,
plt_add_apps: [:mix],
list_unused_filters: true,
ignore_warnings: ".dialyzer/ignore.exs"
]
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: extra_applications(Mix.env()),
mod: {Tarearbol.Application, []}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:boundary, "~> 0.4"},
{:libring, "~> 1.4"},
# kantox
{:telemetria, "~> 0.5", optional: true},
{:cloister, "~> 0.1", optional: true},
# dev / test
{:credo, "~> 1.0", only: [:dev, :ci]},
{:dialyxir, "~> 1.0", only: [:dev, :test, :ci], runtime: false},
{:benchfella, "~> 0.3", only: [:dev]},
{:ex_doc, "~> 0.11", only: :dev},
{:test_cluster_task, "~> 0.1", only: [:test, :ci]},
{:mock, "~> 0.2", only: [:test, :ci]},
{:stream_data, "~> 0.4 or ~> 1.0"}
]
end
defp aliases do
[
quality: ["format", "credo --strict", "dialyzer --unmatched_returns"],
"quality.ci": [
"format --check-formatted",
"credo --strict",
"dialyzer --halt-exit-status"
]
]
end
defp description do
"""
The supervised tree of tasks, simplifying the process of handling:
- recurrent tasks
- retried tasks
- long tasks
- etc
"""
end
defp package do
[
name: @app,
files: ~w|config lib mix.exs README.md|,
maintainers: ["Aleksei Matiushkin"],
licenses: ["MIT"],
links: %{
"GitHub" => "https://github.com/am-kantox/#{@app}",
"Docs" => "https://hexdocs.pm/#{@app}"
}
]
end
defp docs do
[
main: "intro",
source_ref: "v#{@version}",
canonical: "http://hexdocs.pm/#{@app}",
logo: "stuff/images/logo.png",
source_url: "https://github.com/am-kantox/#{@app}",
assets: "stuff/images",
extras: [
"stuff/pages/intro.md",
"stuff/pages/task_management.md",
"stuff/pages/dynamic_workers_management.md",
"stuff/pages/dynamic_management_examples.md",
"stuff/pages/cron_management.md"
],
groups_for_modules: [
"Task Sugar": [
Tarearbol
],
"Dymanic Supervisor Sugar": [
Tarearbol.DynamicManager,
Tarearbol.DynamicManager.Child,
Tarearbol.Pool
],
Scheduler: [
Tarearbol.Calendar,
Tarearbol.Crontab,
Tarearbol.Scheduler,
Tarearbol.Scheduler.Job
],
Exceptions: [
Tarearbol.TaskFailedError
]
]
]
end
defp elixirc_paths(:dev), do: ["lib", "test/support"]
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(:ci), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp extra_applications(:test), do: [:logger, :stream_data, :telemetria]
defp extra_applications(:ci), do: [:logger, :cloister, :stream_data]
defp extra_applications(:dev), do: [:logger]
defp extra_applications(:prod), do: [:logger]
defp compilers(:test), do: [:boundary, :telemetria | Mix.compilers()]
defp compilers(:prod), do: Mix.compilers()
defp compilers(_), do: [:boundary | Mix.compilers()]
end