forked from feda12/rummage_ecto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
111 lines (96 loc) · 2.62 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 Rummage.Ecto.Mixfile do
use Mix.Project
@version "2.0.0-rc.0"
@elixir "~> 1.6"
@url "https://github.com/annkissam/rummage_ecto"
def project do
[
app: :rummage_ecto,
version: @version,
elixir: @elixir,
deps: deps(),
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
# Test
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [coveralls: :test],
aliases: aliases(),
elixirc_paths: elixirc_paths(Mix.env),
# Hex
description: description(),
package: package(),
# Docs
name: "Rumamge.Ecto",
docs: docs(),
]
end
def application do
[
applications: [
:logger,
:ecto,
],
]
end
def package do
[
files: ["lib", "mix.exs", "README.md"],
maintainers: ["Adi Iyengar"],
licenses: ["MIT"],
links: %{"Github" => @url},
]
end
defp deps do
[
# Development Dependency
{:ecto, "~> 2.2"},
# Other Dependencies
{:credo, "~> 0.9.1", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.8", only: :test, runtime: false},
{:ex_doc, "~> 0.16", only: :dev, runtime: false},
{:inch_ex, "~> 0.5", only: [:dev, :test, :docs], runtime: false},
{:postgrex, "~> 0.13", only: :test, optional: true, runtime: false},
]
end
defp description do
"""
A library that allows searching, sorting and paginating ecto queries
"""
end
def docs do
[
main: "Rummage.Ecto",
source_url: @url,
extras: ["README.md",
"CHANGELOG.md",
"help/nomenclature.md",
"help/walkthrough.md"],
source_ref: "v#{@version}"
]
end
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
"test": ["ecto.setup --quite", "test"],
"test.watch.stale": &test_watch_stale/1,
]
end
defp test_watch_stale(_) do
System.cmd(
"sh",
["-c", "#{get_system_watcher()} lib/ test/ | mix test --stale --listen-on-stdin"],
into: IO.stream(:stdio, :line)
)
end
# Works only for Mac and Linux
defp get_system_watcher do
case System.cmd("uname", []) do
{"Linux\n", 0} -> "inotifywait -e modify -e create -e delete -mr" # For Linux systems inotify should work
{"Darwin\n", 0} -> "fswatch" # For Macs, fswatch comes directly installed
{kernel, 0} -> raise "Watcher not supported on kernel: #{kernel}"
end
end
defp elixirc_paths(:test), do: ["lib", "priv", "test/support"]
defp elixirc_paths(_), do: ["lib"]
end