-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
100 lines (90 loc) · 2.47 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 Fob.MixProject do
use Mix.Project
@source_url "https://github.com/NFIBrokerage/fob"
@version_file Path.join(__DIR__, ".version")
@external_resource @version_file
@version (case Regex.run(~r/^v([\d\.\w-]+)/, File.read!(@version_file),
capture: :all_but_first
) do
[version] -> version
nil -> "0.0.0"
end)
def project do
[
app: :fob,
version: @version,
elixir: "~> 1.6",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
preferred_cli_env: [
credo: :test,
coveralls: :test,
"coveralls.html": :test,
bless: :test,
test: :test
],
test_coverage: [tool: Chaps],
package: package(),
description: description(),
source_url: @source_url,
name: "Fob",
docs: docs(),
aliases: aliases()
]
end
defp elixirc_paths(env) when env in [:dev, :test], do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
def application do
[]
end
defp deps do
[
{:ecto, "~> 3.0"},
# docs
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
# test
{:ecto_sql, "~> 3.0", only: [:dev, :test]},
{:postgrex, ">= 0.0.0", only: [:dev, :test]},
{:bless, "~> 1.2", only: :test},
{:credo, "~> 1.0", only: [:dev, :test]},
{:chaps, "~> 0.17", only: :test}
]
end
defp package do
[
name: "fob",
files: ~w(lib .formatter.exs mix.exs README.md .version),
licenses: ["Apache-2.0"],
links: %{
"GitHub" => @source_url,
"Changelog" => @source_url <> "/blobs/main/CHANGELOG.md"
}
]
end
defp description do
"A minimalistic keyset pagination library for Ecto queries"
end
defp docs do
[
# do you reference other projects in your documentation? if so, add
# them to the :deps key here. for an example, see
# https://github.com/NFIBrokerage/projection/blob/5f406872d00156e2b94cfa9fae8e92a1aa4c177b/mix.exs#L88-L90
deps: [],
extras: [
"CHANGELOG.md"
],
groups_for_extras: [
Guides: Path.wildcard("guides/*.md")
]
]
end
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.reset --quiet", "ecto.migrate", "test"]
]
end
end
# Generated by Elixir.Gaas.Generators.Simple.LibraryMix