-
Notifications
You must be signed in to change notification settings - Fork 1
/
mix.exs
118 lines (107 loc) · 3.05 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
defmodule Tempus.MixProject do
use Mix.Project
@app :tempus
@version "0.15.0"
def project do
[
app: @app,
version: @version,
name: "Tempus",
elixir: "~> 1.14",
compilers: compilers(Mix.env()),
elixirc_paths: elixirc_paths(Mix.env()),
consolidate_protocols: Mix.env() not in [:dev, :test],
preferred_cli_env: [quality: :ci, "quality.ci": :ci],
description: description(),
package: package(),
deps: deps(),
aliases: aliases(),
xref: [exclude: []],
docs: docs(),
releases: [],
dialyzer: [
flags: ["-Wunmatched_returns", :error_handling, :underspecs],
plt_file: {:no_warn, ".dialyzer/dialyzer.plt"},
plt_add_deps: :app_tree,
plt_add_apps: [:mix],
list_unused_filters: true,
ignore_warnings: ".dialyzer/ignore.exs"
],
preferred_cli_env: [coveralls: :test, "coveralls.github": :test],
test_coverage: [tool: ExCoveralls]
]
end
def application,
do: [
extra_applications: [:logger]
]
defp deps do
[
{:telemetria, "~> 0.8", optional: true},
{:formulae, "~> 0.15"},
{:avl_tree, "~> 1.0"},
# dev / test
{:tzdata, "~> 1.0", only: [:dev, :test]},
{:benchee, "~> 1.0", only: [:dev, :ci]},
{:credo, "~> 1.0", only: [:dev, :ci]},
{:dialyxir, "~> 1.0", only: [:dev, :ci], runtime: false},
{:excoveralls, "~> 0.13", only: [:test]},
{:ex_doc, "~> 0.11", only: :dev}
]
end
defp aliases do
[
quality: ["format", "credo --strict", "dialyzer"],
"quality.ci": [
"format --check-formatted",
"credo --strict",
"dialyzer"
]
]
end
defp description do
"""
Easy handling of time periods, like business days, holidays, etc.
"""
end
defp package do
[
name: @app,
files: ~w|stuff lib mix.exs README.md LICENSE|,
maintainers: ["Aleksei Matiushkin"],
licenses: ["Kantox LTD"],
links: %{
"GitHub" => "https://github.com/am-kantox/#{@app}",
"Docs" => "https://hexdocs.pm/#{@app}"
}
]
end
defp docs do
[
main: "getting-started",
source_ref: "v#{@version}",
canonical: "http://hexdocs.pm/#{@app}",
logo: "stuff/#{@app}-48x48.png",
source_url: "https://github.com/am-kantox/#{@app}",
assets: "stuff/images",
extras: ~w[README.md stuff/background.md stuff/getting-started.md],
groups_for_modules: [
Helpers: [Tempus.Crontab, Tempus.Guards, Tempus.Sigils],
Core: [Tempus.Slot, Tempus.Slots],
Implementations: [Tempus.Slots.List, Tempus.Slots.Stream]
]
]
end
defp compilers(:test), do: Mix.compilers()
defp compilers(:ci), do: Mix.compilers()
defp compilers(_) do
if Application.get_env(:tempus, :telemetria?, false) do
[:telemetria | Mix.compilers()]
else
Mix.compilers()
end
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(:dev), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
end