-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmix.exs
More file actions
166 lines (151 loc) · 4.51 KB
/
Copy pathmix.exs
File metadata and controls
166 lines (151 loc) · 4.51 KB
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
defmodule ElixirTorrent.MixProject do
use Mix.Project
@version "0.6.6"
def project do
[
app: :elixir_torrent,
version: @version,
elixir: "~> 1.20",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
elixirc_options: elixirc_options(),
description: description(),
package: package(),
source_url: source_url(),
docs: docs(),
deps: deps(),
escript: escript(),
aliases: aliases(),
test_coverage: [tool: ExCoveralls],
# Defensive and staged protocol branches intentionally retain fallback
# clauses that Dialyzer proves unreachable with today's implementations.
dialyzer: [flags: [:no_match]]
]
end
def cli do
[preferred_envs: ["coveralls.json": :test]]
end
defp elixirc_options do
[
warnings_as_errors: true
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_env), do: ["lib"]
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger],
mod: {ElixirTorrentApplication, []}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:dialyxir, "~> 1.4", only: [:dev], runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:sobelow, "~> 0.15", only: [:dev, :test], runtime: false},
{:stream_data, "~> 1.2", only: :test},
{:propcheck, "~> 1.5", only: :test},
{:excoveralls, "~> 0.18.5", only: :test},
# PropEr 1.5.0 predates its OTP 29 warning fixes; keep the upstream fix immutable.
{:proper,
git: "https://github.com/proper-testing/proper.git",
ref: "eaa5eee5319478954e80bc7c16614d507f7842b4",
only: :test,
override: true},
{:bento, "~> 1.0.0"},
{:recon, "~> 2.5.6"},
{:logger_file_backend, "~> 0.0.14"},
{:logger_backends, "~> 1.0"},
{:httpoison, "~> 3.0"},
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false}
# {:dep_from_hexpm, "~> 0.3.0"},
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"},
]
end
defp escript do
[main_module: ElixirTorrent]
end
defp aliases do
[
sobelow: ["sobelow --exit medium --threshold medium --skip --no-router"],
quality: [
"compile --warnings-as-errors",
"dialyzer",
"credo --all",
"sobelow"
],
"deps.patch-test": [
"cmd elixir scripts/patch-propcheck.exs",
"cmd elixir scripts/patch-excoveralls.exs"
],
"test.stress": ["cmd scripts/test-stress.sh"],
"test.races": ["cmd scripts/test-races.sh"],
"test.properties": ["cmd scripts/test-properties.sh"],
"test.state-machines": ["cmd scripts/test-state-machines.sh"]
]
end
@spec description() :: String.t()
defp description do
"BitTorrent client engine for Elixir/OTP — download and seed with DHT, " <>
"magnet links, peer exchange, BitTorrent v2 and MSE/PE encryption, behind a small public API."
end
@spec source_url() :: String.t()
defp source_url do
"https://github.com/daniboybye/ElixirTorrent"
end
@spec hexdocs_url() :: String.t()
defp hexdocs_url do
"https://hexdocs.pm/elixir_torrent"
end
@spec changelog_url() :: String.t()
defp changelog_url do
"https://hexdocs.pm/elixir_torrent/changelog.html"
end
@spec package() :: keyword()
defp package do
[
licenses: ["MIT"],
links: %{
"GitHub" => source_url(),
"Documentation" => hexdocs_url(),
"Changelog" => changelog_url(),
"ElixirTorrent Web" => "https://github.com/daniboybye/ElixirTorrentWebUI"
},
files: [
"lib",
"config",
"mix.exs",
"mix.lock",
"README.md",
"PROTOCOL.md",
"CHANGELOG.md",
"CONTRIBUTING.md",
"SECURITY.md",
"LICENSE",
".formatter.exs"
]
]
end
@spec docs() :: keyword()
defp docs do
[
main: "readme",
name: "ElixirTorrent",
source_ref: "#{@version}",
extras: ["README.md", "PROTOCOL.md", "CHANGELOG.md", "CONTRIBUTING.md", "SECURITY.md"],
groups_for_extras: [
Introduction: ~r/README.md/,
Protocol: ~r/PROTOCOL.md/,
Project: ~r/(CHANGELOG|CONTRIBUTING|SECURITY).md/
],
groups_for_modules: [
"Public API": [ElixirTorrent, Torrents]
],
filter_modules: fn module, _metadata ->
module in [ElixirTorrent, Torrents]
end
]
end
end