-
Notifications
You must be signed in to change notification settings - Fork 23
/
mix.exs
115 lines (106 loc) · 2.81 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
defmodule UAInspector.MixProject do
use Mix.Project
@url_changelog "https://hexdocs.pm/ua_inspector/changelog.html"
@url_github "https://github.com/elixir-inspector/ua_inspector"
@version "3.11.0-dev"
def project do
[
app: :ua_inspector,
name: "UAInspector",
version: @version,
elixir: "~> 1.9",
aliases: aliases(),
deps: deps(),
description: "User agent parser library",
dialyzer: dialyzer(),
docs: docs(),
package: package(),
preferred_cli_env: [
"bench.parse": :bench,
"bench.parse_client": :bench,
"bench.parse_device": :bench,
"bench.parse_os": :bench,
coveralls: :test,
"coveralls.detail": :test
],
test_coverage: [tool: ExCoveralls]
]
end
def application do
[
extra_applications: extra_applications(Mix.env()) ++ [:logger],
mod: {UAInspector.Application, []}
]
end
defp aliases() do
[
"bench.parse": "run bench/parse.exs",
"bench.parse_client": "run bench/parse_client.exs",
"bench.parse_device": "run bench/parse_device.exs",
"bench.parse_os": "run bench/parse_os.exs"
]
end
defp deps do
[
{:benchee, "~> 1.3", only: :bench, runtime: false},
{:credo, "~> 1.7", only: :dev, runtime: false},
{:dialyxir, "~> 1.4", only: :dev, runtime: false},
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:excoveralls, "~> 0.16.0", only: :test, runtime: false},
{:hackney, "~> 1.0"},
{:yamerl, "~> 0.7"}
]
end
defp dialyzer do
[
flags: [
:error_handling,
:underspecs,
:unmatched_returns
],
plt_add_apps: [:mix],
plt_core_path: "plts",
plt_local_path: "plts"
]
end
defp docs do
[
extras: [
"CHANGELOG.md",
LICENSE: [title: "License"],
"README.md": [title: "Overview"]
],
groups_for_modules: [
"Database Downloader": [
UAInspector.Downloader,
UAInspector.Downloader.Adapter
],
"Result Structs": [
UAInspector.Result,
UAInspector.Result.Bot,
UAInspector.Result.BotProducer,
UAInspector.Result.Client,
UAInspector.Result.Device,
UAInspector.Result.OS
]
],
main: "UAInspector",
source_url: @url_github,
source_ref: "v#{@version}",
skip_undefined_reference_warnings_on: ["CHANGELOG.md"],
formatters: ["html"]
]
end
defp extra_applications(:test), do: [:inets]
defp extra_applications(_), do: []
defp package do
[
files: ["CHANGELOG.md", "LICENSE", "mix.exs", "README.md", "lib", "priv"],
licenses: ["Apache-2.0"],
links: %{
"Changelog" => @url_changelog,
"GitHub" => @url_github
}
]
end
end