-
Notifications
You must be signed in to change notification settings - Fork 5
/
mix.exs
160 lines (143 loc) · 3.87 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
defmodule Mneme.MixProject do
use Mix.Project
@app :mneme
@source_url "https://github.com/zachallaun/mneme"
def version, do: "0.9.4"
def project do
[
app: @app,
version: version(),
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(),
start_permanent: Mix.env() == :prod,
deps: deps(),
dialyzer: dialyzer(),
test_coverage: [tool: ExCoveralls, import_cover: "cover"],
aliases: aliases(),
preferred_cli_env: preferred_cli_env(),
# Hex
description: "Snapshot testing tool using familiar assertions",
package: package(),
# Docs
name: "Mneme",
docs: docs()
]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
{:owl, "~> 0.9"},
{:nimble_options, "~> 1.0"},
{:sourceror, "~> 1.0"},
{:rewrite, "~> 1.0"},
{:text_diff, "~> 0.1"},
{:file_system, "~> 1.0"},
{:igniter, "~> 0.4.0 or ~> 0.3.76"},
# Development / Test
{:benchee, "~> 1.0", only: :dev},
{:ecto, "~> 3.9", only: :test},
{:stream_data, "~> 1.0", only: [:dev, :test]},
{:dialyxir, "~> 1.2", only: [:dev, :test], runtime: false},
{:styler, "~> 1.0", only: [:dev, :test]},
{:time_zone_info, "~> 0.7", only: [:dev, :test]},
{:excoveralls, "~> 0.18", only: :test},
{:patch, "~> 0.13", only: :test},
{:mox, "~> 1.2", only: :test},
# Docs
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:makeup_json, ">= 0.0.0", only: :dev, runtime: false}
]
end
defp elixirc_paths, do: elixirc_paths(Mix.env())
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp aliases do
[
coveralls: [
&export_integration_coverage/1,
"coveralls --import-cover cover"
],
"coveralls.html": [
&export_integration_coverage/1,
"coveralls.html --import-cover cover"
],
"test.mneme_not_started": [
fn _ -> System.put_env("START_MNEME", "false") end,
"test --only mneme_not_started test/mneme_not_started_test.exs"
]
]
end
defp preferred_cli_env do
[
dialyzer: :test,
coveralls: :test,
"coveralls.html": :test,
"test.mneme_not_started": :test,
"mneme.test": :test,
"mneme.watch": :test
]
end
defp package do
[
name: "mneme",
licenses: ["MIT"],
links: %{"GitHub" => @source_url},
exclude_patterns: ["priv/plts"]
]
end
defp docs do
[
source_url: @source_url,
main: "readme",
assets: %{"docs/assets" => "assets"},
before_closing_body_tag: fn
:html -> ~S|<script src="assets/js/embedded-video.js"></script>|
_ -> ""
end,
extras: [
"README.md": [title: "Overview"],
"CHANGELOG.md": [title: "Changelog"],
"docs/guides/architecture.md": [title: "Under the hood"],
"docs/guides/vscode_setup.md": [title: "VS Code"],
"docs/guides/generated_patterns.md": [title: "Pattern generation"]
],
groups_for_extras: [
Guides: [
"README.md",
"docs/guides/generated_patterns.md"
],
"Editor Setup": [
"docs/guides/vscode_setup.md"
],
Internals: [
"docs/guides/architecture.md"
]
],
groups_for_docs: [
Setup: &(&1[:section] == :setup),
Assertions: &(&1[:section] == :assertion)
]
]
end
defp dialyzer do
[
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
plt_add_apps: [:mix, :ex_unit],
flags: [
# enable warnings:
:extra_return,
:missing_return,
:underspecs,
# disable warnings:
:no_return
]
]
end
defp export_integration_coverage(_) do
Application.put_env(:mneme, :export_integration_coverage, true)
end
end