This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
75 lines (67 loc) · 1.83 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
defmodule HeatingBrain.MixProject do
use Mix.Project
def project do
[
aliases: aliases(),
app: :heating_brain,
compilers: [:phoenix] ++ Mix.compilers(),
deps: deps(),
dialyzer: dialyzer(),
elixir: "~> 1.13",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
version: version()
]
end
defp aliases do
[
check: [
"compile",
"format --check-formatted",
"dialyzer",
"hex.audit",
"credo suggest --all"
]
]
end
def application do
[
extra_applications: [:logger, :runtime_tools],
included_applications: [:mnesia],
mod: {HeatingBrain.Application, []}
]
end
defp deps do
[
{:credo, "~> 1.6", only: [:dev], runtime: false},
{:dialyxir, "~> 1.1", only: [:dev], runtime: false},
{:jason, "~> 1.3"},
{:phoenix, "~> 1.6"},
{:phoenix_html, "~> 3.2"},
{:phoenix_live_reload, "~> 1.3", only: :dev},
{:phoenix_live_view, "~> 0.17"},
{:phoenix_pubsub, "~> 2.0"},
{:plug_cowboy, "~> 2.5"},
{:stream_data, "~> 0.5", only: [:dev, :test], runtime: false},
{:tzdata, "~> 1.1"}
]
end
defp dialyzer do
[
plt_add_apps: [:mnesia],
plt_add_deps: :transitive,
flags: [
:error_handling,
:race_conditions,
:underspecs
]
]
end
defp elixirc_paths(:prod), do: ["lib"]
defp elixirc_paths(:dev), do: ["lib", "test/support/filesystem_mock.ex"]
defp elixirc_paths(:test), do: ["lib", "test"]
defp version, do: "1.0.0-#{Mix.env()}+#{String.slice(git_sha(), 0, 9)}"
defp git_sha, do: File.dir?(".git") |> git_sha()
defp git_sha(true), do: ({_, 0} = System.cmd("git", ["rev-parse", "HEAD"])) |> elem(0)
defp git_sha(_), do: File.read!("VERSION_SHA") |> String.trim()
end