-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmix.exs
100 lines (85 loc) · 2.26 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
defmodule Ecto.Rescope.MixProject do
use Mix.Project
@version "0.1.2"
def project do
[
app: :ecto_rescope,
version: @version,
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
# Hex
description: "Extends Ecto to allow rescoping of the default schema query",
package: package(),
# Docs
name: "Ecto.Rescope",
docs: docs(),
# Code Quality
preferred_cli_env: [
test: :test,
"ecto.gen.migration": :test,
"ecto.create": :test,
"ecto.drop": :test,
"ecto.migrate": :test,
"ecto.reset": :test,
"ecto.rollback": :test,
"ecto.setup": :test
],
dialyzer: [plt_add_apps: [:mix], ignore_warnings: "dialyzer.ignore_warnings"]
]
end
def application do
[
extra_applications: [:logger]
]
end
## PRIVATE FUNCTIONS
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate", "test"]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp deps do
[
{:ex_doc, "~> 0.20", only: :dev, runtime: false},
{:ecto_sql, "~> 3.0", only: [:dev, :test]},
{:postgrex, ">= 0.0.0", only: [:dev, :test]},
{:dialyxir, "~> 1.0.0-rc.6", only: [:dev, :test], runtime: false}
]
end
defp docs do
[
main: "Ecto.Rescope",
source_ref: "v#{@version}",
canonical: "http://hexdocs.pm/ecto_rescope",
extra_section: "GUIDES",
source_url: "https://github.com/erikreedstrom/ecto_rescope",
extras: extras(),
groups_for_extras: groups_for_extras(),
groups_for_modules: groups_for_modules()
]
end
def extras() do
["README.md"]
end
defp groups_for_extras do
[]
end
defp groups_for_modules do
[]
end
defp package do
[
maintainers: ["Erik Reedstrom", "Christian Green"],
licenses: ["Apache 2.0"],
links: %{"GitHub" => "https://github.com/erikreedstrom/ecto_rescope"},
files: ~w(lib .formatter.exs mix.exs README* LICENSE* CHANGELOG*)
]
end
end