forked from elixir-ecto/ecto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
158 lines (136 loc) · 4.19 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
defmodule Ecto.MixProject do
use Mix.Project
@version "3.0.0-dev"
@adapters [:pg, :mysql]
def project do
[app: :ecto,
version: @version,
elixir: "~> 1.4",
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: "A database wrapper and language integrated query for Elixir",
package: package(),
# Docs
name: "Ecto",
docs: docs()]
end
def application do
[
applications: [:logger, :decimal, :poolboy, :crypto],
env: [postgres_map_type: "jsonb"],
mod: {Ecto.Application, []}
]
end
defp deps do
[
{:poolboy, "~> 1.5"},
{:decimal, "~> 1.5"},
# Drivers
{:db_connection, "~> 1.1", optional: true},
{:postgrex, "~> 0.14.0-dev", optional: true, github: "elixir-ecto/postgrex"},
{:mariaex, "~> 0.9.0-dev", optional: true, github: "xerions/mariaex"},
# Optional
{:sbroker, "~> 1.0", optional: true},
{:poison, "~> 2.2 or ~> 3.0", optional: true},
{:jason, "~> 1.0", optional: true},
# Docs
{:ex_doc, "~> 0.17", 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 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(.formatter.exs 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
defp docs do
[
main: "Ecto",
source_ref: "v#{@version}",
canonical: "http://hexdocs.pm/ecto",
logo: "guides/images/e.png",
source_url: "https://github.com/elixir-ecto/ecto",
extras: [
"guides/Getting Started.md",
"guides/Associations.md",
"guides/Testing with Ecto.md",
],
groups_for_modules: [
# Ecto,
# Ecto.Changeset,
# Ecto.Migration,
# Ecto.Migrator,
# Ecto.Multi,
# Ecto.Schema,
# Ecto.Schema.Metadata,
# Ecto.Type,
# Ecto.UUID,
"Repo and Queries": [
Ecto.LogEntry,
Ecto.Repo,
Ecto.Query,
Ecto.Query.API,
Ecto.Queryable,
Ecto.SubQuery
],
"Adapters": [
Ecto.Adapters.MySQL,
Ecto.Adapters.Postgres,
Ecto.Adapters.SQL,
Ecto.Adapters.SQL.Connection,
Ecto.Adapters.SQL.Sandbox,
],
"Adapter specification": [
Ecto.Adapter,
Ecto.Adapter.Migration,
Ecto.Adapter.Storage,
Ecto.Adapter.Structure,
Ecto.Adapter.Transaction,
],
"Association structs": [
Ecto.Association.BelongsTo,
Ecto.Association.Has,
Ecto.Association.HasThrough,
Ecto.Association.ManyToMany,
Ecto.Association.NotLoaded,
],
"Migration structs": [
Ecto.Migration.Command,
Ecto.Migration.Constraint,
Ecto.Migration.Index,
Ecto.Migration.Reference,
Ecto.Migration.Table,
]
]
]
end
end