-
Notifications
You must be signed in to change notification settings - Fork 2
/
mix.exs
133 lines (123 loc) · 3.46 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
defmodule Nimrag.MixProject do
use Mix.Project
@version "0.1.0"
def project do
[
app: :nimrag,
version: @version,
elixir: "~> 1.15",
elixirc_paths: elixirc_paths(Mix.env()),
elixirc_options: [
warnings_as_errors: !!System.get_env("CI")
],
consolidate_protocols: Mix.env() != :test,
deps: deps(),
package: package(),
name: "Nimrag",
source_url: "https://github.com/arathunku/nimrag",
homepage_url: "https://github.com/arathunku/nimrag",
docs: &docs/0,
description: """
Use Garmin API from Elixir! Fetch activities, steps, and more from Garmin Connect.
""",
aliases: aliases(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
check: :test,
coveralls: :test,
"coveralls.detail": :test,
"coveralls.html": :test
],
dialyzer: [
ignore_warnings: ".dialyzer_ignore.exs",
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
plt_add_apps: [:hammer],
flags: [:error_handling, :unknown],
# Error out when an ignore rule is no longer useful so we can remove it
list_unused_filters: true
]
]
end
def application do
if Application.get_env(:hammer, :backend) in [[], nil] do
Application.put_env(
:hammer,
:backend,
{Hammer.Backend.ETS,
[
expiry_ms: 60_000 * 60 * 2,
cleanup_interval_ms: 60_000 * 2
]}
)
end
[
# mod: {Nimrag.Application, []},
extra_applications: [:logger]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
{:req, "~> 0.5.0"},
{:oauther, "~> 1.1"},
{:jason, "~> 1.4"},
{:recase, "~> 0.7"},
{:schematic, "~> 0.3"},
{:hammer, "~> 6.2"},
{:plug, "~> 1.0", only: [:test]},
{:excoveralls, "~> 0.18.1", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.31", only: :dev, runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:styler, "~> 0.11", only: [:dev, :test], runtime: false}
]
end
defp aliases do
[
check: [
"clean",
"deps.unlock --check-unused",
"compile --warnings-as-errors",
"format --check-formatted",
"deps.unlock --check-unused",
"test --warnings-as-errors",
"dialyzer --format short",
"credo"
]
]
end
defp docs do
[
source_ref: "v#{@version}",
source_url: "https://github.com/arathunku/nimrag",
extras: extras(),
api_reference: false,
groups_for_extras: [
{"Livebook examples", Path.wildcard("examples/*")}
],
formatters: ["html"],
main: "readme",
skip_undefined_reference_warnings_on: ["CHANGELOG.md"]
]
end
def extras do
[
"README.md": [title: "Overview"],
"CHANGELOG.md": [title: "Changelog"],
# "CONTRIBUTING.md": [title: "Contributing"],
"LICENSE.md": [title: "License"]
] ++ Path.wildcard("examples/*.livemd")
end
defp package do
[
maintainers: ["@arathunku"],
licenses: ["MIT"],
links: %{
Changelog: "https://hexdocs.pm/nimrag/changelog.html",
GitHub: "https://github.com/arathunku/nimrag"
},
files: ~w(lib CHANGELOG.md LICENSE.md mix.exs README.md .formatter.exs)
]
end
end