-
Notifications
You must be signed in to change notification settings - Fork 81
/
mix.exs
142 lines (124 loc) · 3.84 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
defmodule Mix.Tasks.Compile.Appsignal do
use Mix.Task
def run(_args) do
{_, _} = Code.eval_file("mix_helpers.exs")
Mix.Appsignal.Helper.install()
{:ok, []}
end
end
defmodule Appsignal.Mixfile do
use Mix.Project
def project do
[
app: :appsignal,
version: "1.13.4",
name: "AppSignal",
description: description(),
package: package(),
source_url: "https://github.com/appsignal/appsignal-elixir",
homepage_url: "https://appsignal.com",
test_paths: test_paths(Mix.env()),
elixir: "~> 1.0",
compilers: compilers(Mix.env()),
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
docs: [main: "Appsignal", logo: "logo.png"],
dialyzer: [
plt_add_deps: :transitive,
plt_add_apps: [:mix],
ignore_warnings: "dialyzer.ignore-warnings"
]
]
end
defp description do
"Collects error and performance data from your Elixir applications and sends it to AppSignal"
end
defp package do
%{
files: [
"lib",
"c_src/*.[ch]",
"mix.exs",
"mix_helpers.exs",
"*.md",
"LICENSE",
"Makefile",
"agent.exs",
"priv/cacert.pem"
],
maintainers: ["Jeff Kreeftmeijer", "Tom de Bruijn"],
licenses: ["MIT"],
links: %{"GitHub" => "https://github.com/appsignal/appsignal-elixir"}
}
end
def application do
[mod: {Appsignal, []}, applications: [:logger, :decorator, :hackney]]
end
defp compilers(:test_phoenix), do: [:phoenix] ++ compilers(:prod)
defp compilers(_), do: [:appsignal] ++ Mix.compilers()
defp test_paths(:test_phoenix), do: ["test/appsignal", "test/mix", "test/phoenix"]
defp test_paths(_), do: ["test/appsignal", "test/mix"]
defp elixirc_paths(env) do
case test?(env) do
true -> ["lib", "test/support"]
false -> ["lib"]
end
end
defp test?(:test), do: true
defp test?(:test_phoenix), do: true
defp test?(:test_no_nif), do: true
defp test?(:bench), do: true
defp test?(_), do: false
defp deps do
system_version = System.version()
poison_version =
case Version.compare(system_version, "1.6.0") do
:lt -> ">= 1.3.0 and < 4.0.0"
_ -> ">= 1.3.0"
end
phoenix_version =
case Version.compare(system_version, "1.4.0") do
:lt -> ">= 1.2.0 and < 1.4.0"
_ -> ">= 1.2.0"
end
decorator_version =
case Version.compare(system_version, "1.5.0") do
:lt -> "~> 1.2.3"
_ -> "~> 1.2.3 or ~> 1.3"
end
[
{:benchee, "~> 1.0", only: :bench},
{:hackney, "~> 1.6"},
{:jason, "~> 1.0", optional: true},
{:poison, poison_version, optional: true},
{:decorator, decorator_version},
{:phoenix, phoenix_version, optional: true, only: [:prod, :test_phoenix, :dev]},
{:bypass, "~> 0.6.0", only: [:test, :test_phoenix, :test_no_nif]},
{:plug_cowboy, "~> 1.0", only: [:test, :test_phoenix, :test_no_nif]},
{:ex_doc, "~> 0.12", only: :dev, runtime: false},
{:credo, "~> 1.0.0", only: [:test, :dev], runtime: false},
{:dialyxir, "~> 1.0.0-rc4", only: [:dev], runtime: false},
{:telemetry, "~> 0.4"}
] ++ plug_dep() ++ live_view_dep()
end
defp plug_dep do
case Version.compare(System.version(), "1.5.0") do
:lt ->
[
{:plug, ">= 1.1.0 and < 1.9.0", optional: true},
{:plug_crypto, "~> 1.0.0", optional: true}
]
_ ->
case Version.compare(System.version(), "1.7.0") do
:lt -> [{:plug, ">= 1.1.0 and < 1.10.0", optional: true}]
_ -> [{:plug, ">= 1.1.0", optional: true}]
end
end
end
defp live_view_dep do
case Version.compare(System.version(), "1.7.0") do
:lt -> []
_ -> [{:phoenix_live_view, "~> 0.9", optional: true, only: [:prod, :test_phoenix, :dev]}]
end
end
end