forked from elixir-ecto/ecto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
92 lines (75 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
defmodule Ecto.Mixfile do
use Mix.Project
@version "2.1.0-dev"
@adapters [:pg, :mysql]
def project do
[app: :ecto,
version: @version,
elixir: "~> 1.3",
deps: deps(),
build_per_environment: false,
consolidate_protocols: false,
test_paths: test_paths(Mix.env),
xref: [exclude: [Mariaex, Ecto.Adapters.MySQL.Connection,
Postgrex, Ecto.Adapters.Postgres.Connection,
DBConnection, DBConnection.Ownership]],
# Custom testing
aliases: ["test.all": ["test", "test.adapters"],
"test.adapters": &test_adapters/1],
preferred_cli_env: ["test.all": :test],
# Hex
description: description(),
package: package(),
# Docs
name: "Ecto",
docs: [source_ref: "v#{@version}", main: "Ecto",
canonical: "http://hexdocs.pm/ecto",
source_url: "https://github.com/elixir-ecto/ecto",
extras: ["guides/Getting Started.md"]]]
end
def application do
[applications: [:logger, :decimal, :poolboy],
env: [json_library: Poison], mod: {Ecto.Application, []}]
end
defp deps do
[{:poolboy, "~> 1.5"},
{:decimal, "~> 1.1.2 or ~> 1.2"},
# Drivers
{:db_connection, "~> 1.0-rc.4", optional: true},
{:postgrex, "~> 0.12.0", optional: true},
{:mariaex, "~> 0.7.7", optional: true},
# Optional
{:sbroker, "~> 1.0-beta", optional: true},
{:poison, "~> 1.5 or ~> 2.0", optional: true},
# Docs
{:ex_doc, "~> 0.12", only: :docs},
{:inch_ex, ">= 0.0.0", only: :docs}]
end
defp test_paths(adapter) when adapter in @adapters, do: ["integration_test/#{adapter}"]
defp test_paths(_), do: ["test/ecto", "test/mix"]
defp description do
"""
A database wrapper and language integrated query for Elixir.
"""
end
defp package do
[maintainers: ["Eric Meadows-Jönsson", "José Valim", "James Fish", "Michał Muskała"],
licenses: ["Apache 2.0"],
links: %{"GitHub" => "https://github.com/elixir-ecto/ecto"},
files: ~w(mix.exs README.md CHANGELOG.md lib) ++
~w(integration_test/cases integration_test/sql integration_test/support)]
end
defp test_adapters(args) do
for env <- @adapters, do: env_run(env, args)
end
defp env_run(env, args) do
args = if IO.ANSI.enabled?, do: ["--color"|args], else: ["--no-color"|args]
IO.puts "==> Running tests for MIX_ENV=#{env} mix test"
{_, res} = System.cmd "mix", ["test"|args],
into: IO.binstream(:stdio, :line),
env: [{"MIX_ENV", to_string(env)}]
if res > 0 do
System.at_exit(fn _ -> exit({:shutdown, 1}) end)
end
end
end