forked from elixir-ecto/ecto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
89 lines (72 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
defmodule Ecto.Mixfile do
use Mix.Project
@version "2.0.0-dev"
@adapters [:pg]
def project do
[app: :ecto,
version: @version,
elixir: "~> 1.2-rc",
deps: deps,
build_per_environment: false,
consolidate_protocols: false,
test_paths: test_paths(Mix.env),
# 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",
source_url: "https://github.com/elixir-lang/ecto"]]
end
def application do
[applications: [:logger, :decimal, :poolboy],
env: [json_library: Poison], mod: {Ecto.Application, []}]
end
defp deps do
[{:poolboy, "~> 1.5"},
{:decimal, "~> 1.0"},
# Drivers
{:mariaex, "~> 0.6", optional: true},
{:postgrex, "~> 0.11-dev", github: "ericmj/postgrex", optional: true},
{:connection, "~> 1.0.2", override: true},
{:db_connection, "~> 0.2", override: true},
# Optional
{:sbroker, "~> 0.7", optional: true},
{:poison, "~> 1.0", optional: true},
# Docs
{:ex_doc, "~> 0.10", only: :docs},
{:earmark, "~> 0.1", 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
"""
Ecto is a domain specific language for writing queries and interacting with databases in 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-lang/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