-
Notifications
You must be signed in to change notification settings - Fork 381
/
mix.exs
198 lines (184 loc) · 5.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
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
defmodule Guardian.Mixfile do
@moduledoc false
use Mix.Project
@app :guardian
@version "2.3.2"
@url "https://github.com/ueberauth/guardian"
@maintainers [
"Daniel Neighman",
"Sonny Scroggin",
"Sean Callan",
"Yordis Prieto"
]
def project do
[
name: "Guardian",
app: @app,
version: @version,
elixir: "~> 1.13",
elixirc_paths: elixirc_paths(Mix.env()),
package: package(),
source_url: @url,
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
maintainers: @maintainers,
description: "Elixir Authentication framework",
homepage_url: @url,
docs: docs(),
deps: deps(),
xref: [exclude: [:phoenix]],
dialyzer: dialyxir(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
coveralls: :test,
"coveralls.html": :test
]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
def application do
[extra_applications: [:crypto, :logger]]
end
def docs do
[
source_ref: "v#{@version}",
main: "readme",
extra_section: "guides",
assets: "guides/assets",
formatters: ["html", "epub"],
groups_for_modules: groups_for_modules(),
extras: extras(),
groups_for_extras: groups_for_extras()
]
end
defp dialyxir do
[
plt_add_deps: :transitive,
plt_add_apps: [:mix],
flags: [:race_conditions, :no_opaque]
]
end
defp extras do
[
"README.md": [
title: "Readme"
],
"CHANGELOG.md": [
title: "Changelog"
],
"guides/introduction/overview.md": [
filename: "introduction-overview"
],
"guides/introduction/installation.md": [
filename: "introduction-installation"
],
"guides/introduction/implementation.md": [
filename: "introduction-implementation",
title: "Implementation Modules"
],
"guides/introduction/community.md": [
filename: "introduction-community"
],
"guides/tutorial/start-tutorial.md": [
filename: "tutorial-start",
title: "Getting Started with Guardian"
],
"guides/tokens/start-tokens.md": [
filename: "tokens-start",
title: "Start"
],
"guides/tokens/jwt/start.md": [
filename: "tokens-jwt-start",
title: "Start"
],
"guides/plug/start-plug.md": [
filename: "plug-start",
title: "Start"
],
"guides/plug/pipelines.md": [
filename: "plug-pipelines",
title: "Pipelines"
],
"guides/phoenix/start-phoenix.md": [
filename: "phoenix-start",
title: "Start"
],
"guides/permissions/start-permissions.md": [
filename: "permissions-start",
title: "Start"
],
"guides/upgrading/v1.0.md": [
filename: "upgrading-v1.0"
]
]
end
defp groups_for_extras do
[
Introduction: Path.wildcard("guides/introduction/*.md"),
Tutorial: Path.wildcard("guides/tutorial/*.md"),
Tokens: Path.wildcard("guides/tokens/*.md"),
"JWT Tokens": Path.wildcard("guides/tokens/jwt/*.md"),
Plug: Path.wildcard("guides/plug/*.md"),
Phoenix: Path.wildcard("guides/phoenix/*.md"),
Permissions: Path.wildcard("guides/permissions/*.md"),
"Upgrade Guides": ["CHANGELOG.md"] ++ Path.wildcard("guides/upgrading/*.md")
]
end
defp groups_for_modules do
# Ungrouped:
# - Guardian
[
Tokens: [
Guardian.Token,
Guardian.Token.Verify,
Guardian.Token.Jwt,
Guardian.Token.Jwt.Verify
],
Plugs: [
Guardian.Plug,
Guardian.Plug.Pipeline,
Guardian.Plug.EnsureAuthenticated,
Guardian.Plug.EnsureNotAuthenticated,
Guardian.Plug.LoadResource,
Guardian.Plug.VerifySession,
Guardian.Plug.VerifyHeader,
Guardian.Plug.VerifyCookie,
Guardian.Plug.SlidingCookie,
Guardian.Plug.Keys
],
Permissions: [
Guardian.Permissions,
Guardian.Permissions.PermissionEncoding,
Guardian.Permissions.BitwiseEncoding,
Guardian.Permissions.AtomEncoding,
Guardian.Permissions.TextEncoding
]
]
end
defp deps do
[
{:jose, "~> 1.11.9"},
# Optional dependencies
{:plug, "~> 1.3.3 or ~> 1.4", optional: true},
# Tools
{:credo, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:dialyxir, ">= 0.0.0", only: [:dev], runtime: false},
{:ex_doc, ">= 0.0.0", only: [:dev], runtime: false},
{:excoveralls, ">= 0.0.0", only: [:test], runtime: false},
{:inch_ex, ">= 0.0.0", only: [:dev], runtime: false},
{:jason, "~> 1.1", only: [:dev, :test], runtime: false}
]
end
defp package do
[
maintainers: @maintainers,
licenses: ["MIT"],
links: %{
Changelog: "https://hexdocs.pm/#{@app}/#{@version}/changelog.html",
GitHub: @url
},
files: ~w(lib CHANGELOG.md LICENSE mix.exs README.md)
]
end
end