-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmix.exs
100 lines (89 loc) · 2.48 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 Exandra.MixProject do
use Mix.Project
@version "0.13.0"
@repo_url "https://github.com/vinniefranco/exandra"
@description """
Exandra is an Elixir library that brings the power of Scylla/Cassandra to Ecto.
"""
def project do
[
app: :exandra,
version: @version,
elixir: "~> 1.15",
description: @description,
package: package(),
start_permanent: Mix.env() == :prod,
deps: deps(),
elixirc_paths: elixirc_paths(Mix.env()),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
"test.cassandra": :test,
"test.scylla": :test,
"test.all": :test,
"coveralls.html": :test
],
aliases: aliases(),
xref: [exclude: [XandraClusterMock, XandraMock]],
docs: [
main: "Exandra",
source_ref: "v#{@version}",
source_url: @repo_url,
groups_for_modules: [
"Ecto types": [
Exandra.UDT,
Exandra.Counter,
Exandra.Map,
Exandra.Set,
Exandra.Inet,
Exandra.Tuple
]
]
]
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: []
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_other), do: ["lib"]
defp package do
[
maintainers: ["Vincent Franco"],
licenses: ["MIT"],
links: %{"GitHub" => @repo_url}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:decimal, "~> 1.6 or ~> 2.0"},
{:ecto, "~> 3.12"},
{:ecto_sql, "~> 3.12"},
{:jason, "~> 1.4"},
{:nimble_options, "~> 1.0"},
{:xandra, "~> 0.19.0"},
# DEV DEPS ------
{:mox, "~> 1.0", only: :test},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.17.1", only: :test},
{:ex_doc, "~> 0.29", only: :dev, runtime: false}
]
end
defp aliases do
[
"test.cassandra": [&print_tests_banner(&1, :cassandra), "test"],
"test.scylla": [&print_tests_banner(&1, :scylla), "cmd EXANDRA_PORT=9043 mix test --color"],
"test.all": fn args ->
Mix.Task.run(:"test.cassandra", args)
Mix.Task.run(:"test.scylla", args)
end
]
end
defp print_tests_banner(_argv, db) do
IO.puts(IO.ANSI.format([:bright, :cyan, "==> Running tests for #{db}"]))
end
end