-
Notifications
You must be signed in to change notification settings - Fork 7
/
mix.exs
111 lines (101 loc) · 2.66 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
defmodule AshUUID.MixProject do
use Mix.Project
@name :ash_uuid
@version "1.1.2"
@description "Tools for using UUID based id with Ash"
@source_url "https://github.com/zoonect-oss/ash_uuid"
def project do
[
app: @name,
version: @version,
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
preferred_cli_env: preferred_cli_env(),
cli: cli(),
dialyzer: dialyzer(),
deps: deps(),
package: package(),
docs: docs(),
name: Macro.camelize("#{@name}"),
description: @description
]
end
def application() do
case Mix.env() do
:test -> [mod: {AshUUID.Test.Application, []}]
_ -> []
end
end
defp elixirc_paths(:test), do: ~w(lib test/support)
defp elixirc_paths(_), do: ~w(lib)
defp dialyzer do
[
ignore_warnings: ".dialyzer-ignore.exs"
]
end
defp deps do
[
{:uniq, "~> 0.6"},
{:ash, "~> 3.0"},
{:ash_postgres, "~> 2.0 and >= 2.0.11"},
# Testing, documentation, and release tools
{:mix_test_interactive, ">= 0.0.0", only: :test, runtime: false},
{:mix_audit, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:credo, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:sobelow, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:doctor, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:ex_check, ">= 0.0.0", only: [:dev, :test]},
{:ex_doc, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:git_ops, ">= 0.0.0", only: :dev}
]
end
defp docs do
[
main: "readme",
source_ref: "v#{@version}",
formatters: ~w(html epub),
extras: ~w(README.md CHANGELOG.md)
]
end
defp package do
[
name: "#{@name}",
files: ~w(.formatter.exs config lib mix.exs README* LICENSE*),
maintainers: ~w(moissela),
licenses: ~w(MIT),
links: %{
GitHub: @source_url
}
]
end
def cli do
[
default_task: :compile,
preferred_envs: preferred_cli_env()
]
end
defp preferred_cli_env do
[
check: :test,
"hex.outdated": :test,
audit: :test,
"hex.audit": :test,
format: :test,
docs: :dev,
dialyzer: :dev,
credo: :dev,
sobelow: :dev,
doctor: :dev,
test: :test,
"test.interactive": :test,
"test.watch": :test,
"ash_postgres.create": :test,
"ash_postgres.generate_migrations": :test,
"ash_postgres.migrate": :test,
"ash_postgres.rollback": :test,
"ash_postgres.drop": :test
]
end
end