forked from elixir-tesla/tesla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
146 lines (131 loc) · 4.12 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
defmodule Tesla.Mixfile do
use Mix.Project
@source_url "https://github.com/teamon/tesla"
@version "1.6.1"
def project do
[
app: :tesla,
version: @version,
description: description(),
package: package(),
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
lockfile: lockfile(System.get_env("LOCKFILE")),
test_coverage: [tool: ExCoveralls],
dialyzer: [
plt_core_path: "_build/#{Mix.env()}",
plt_add_apps: [:mix, :inets, :idna, :ssl_verify_fun, :ex_unit],
plt_add_deps: :project
],
docs: docs()
]
end
# Configuration for the OTP application
#
# Type `mix help compile.app` for more information
def application do
[extra_applications: [:logger, :ssl, :inets]]
end
defp description do
"HTTP client library, with support for middleware and multiple adapters."
end
defp package do
[
maintainers: ["Tymon Tobolski"],
licenses: ["MIT"],
links: %{"GitHub" => "https://github.com/teamon/tesla"}
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp lockfile(nil), do: "mix.lock"
defp lockfile(lockfile), do: "test/lockfiles/#{lockfile}.lock"
defp deps do
[
{:mime, "~> 1.0 or ~> 2.0"},
# http clients
{:ibrowse, "4.4.0", optional: true},
{:hackney, "~> 1.6", optional: true},
{:gun, "~> 1.3", optional: true},
{:finch, "~> 0.13", optional: true},
{:castore, "~> 0.1 or ~> 1.0", optional: true},
{:mint, "~> 1.0", optional: true},
# json parsers
{:jason, ">= 1.0.0", optional: true},
{:poison, ">= 1.0.0", optional: true},
{:exjsx, ">= 3.0.0", optional: true},
# messagepack parsers
{:msgpax, "~> 2.3", optional: true},
# other
{:fuse, "~> 2.4", optional: true},
{:telemetry, "~> 0.4 or ~> 1.0", optional: true},
# testing & docs
{:opentelemetry_process_propagator, "~> 0.1", only: [:test, :dev]},
{:excoveralls, "~> 0.8", only: :test},
{:httparrot, "~> 1.3", only: :test},
{:ex_doc, "~> 0.21", only: :dev, runtime: false},
{:mix_test_watch, "~> 1.0", only: :dev},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:inch_ex, "~> 2.0", only: :docs},
# override httparrot dependencies
{:cowlib, "~> 2.9", only: :test, override: true},
{:ranch, "~> 1.8", only: :test, override: true}
]
end
defp docs do
[
main: "readme",
source_url: @source_url,
source_ref: "v#{@version}",
extras: ["README.md", "LICENSE"],
groups_for_modules: [
Behaviours: [
Tesla.Adapter,
Tesla.Middleware
],
Adapters: [
Tesla.Adapter.Finch,
Tesla.Adapter.Gun,
Tesla.Adapter.Hackney,
Tesla.Adapter.Httpc,
Tesla.Adapter.Ibrowse,
Tesla.Adapter.Mint
],
Middlewares: [
Tesla.Middleware.BaseUrl,
Tesla.Middleware.BasicAuth,
Tesla.Middleware.BearerAuth,
Tesla.Middleware.Compression,
Tesla.Middleware.CompressRequest,
Tesla.Middleware.DecodeFormUrlencoded,
Tesla.Middleware.DecodeJson,
Tesla.Middleware.DecodeRels,
Tesla.Middleware.DecompressResponse,
Tesla.Middleware.DigestAuth,
Tesla.Middleware.EncodeFormUrlencoded,
Tesla.Middleware.EncodeJson,
Tesla.Middleware.FollowRedirects,
Tesla.Middleware.FormUrlencoded,
Tesla.Middleware.Fuse,
Tesla.Middleware.Headers,
Tesla.Middleware.JSON,
Tesla.Middleware.KeepRequest,
Tesla.Middleware.Logger,
Tesla.Middleware.MethodOverride,
Tesla.Middleware.Opts,
Tesla.Middleware.PathParams,
Tesla.Middleware.Query,
Tesla.Middleware.Retry,
Tesla.Middleware.Telemetry,
Tesla.Middleware.Timeout
]
],
nest_modules_by_prefix: [
Tesla.Adapter,
Tesla.Middleware
]
]
end
end