-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
142 lines (126 loc) · 4.06 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
defmodule Helios.MixProject do
use Mix.Project
@version "0.2.3"
@journal_adapters ["eventstore"]
def project do
[
app: :helios,
version: @version,
elixir: "~> 1.6",
start_permanent: Mix.env() == :prod,
test_paths: test_paths(System.get_env("JOURNAL_ADAPTER")),
build_per_environment: false,
deps: deps(),
aliases: ["test.all": ["test", "test.adapters"],
"test.adapters": &test_adapters/1],
# Hex
description: "A building blocks for CQRS segregated applications",
package: package(),
name: "Helios",
docs: docs(),
dialyzer: [ plt_add_apps: [:mix] ,
ignore_warnings: ".dialyzer_ignore.exs",
list_unused_filters: true
],
test_coverage: [tool: ExCoveralls],
referred_cli_env: [coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test]
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger, :crypto],
mod: {Helios, []}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ex_doc, ">= 0.0.0", only: [:test, :dev]},
{:elixir_uuid, "~> 1.2"},
{:libring, "~> 1.0"},
{:gen_state_machine, "~> 2.0"},
{:extreme, "~> 0.13", optinal: true},
{:dialyxir, "~> 1.0.0-rc.4", only: [:dev, :test], runtime: false, optinal: true},
{:credo, "~> 0.10.0", only: [:dev, :test], runtime: false},
{:poolboy, "~> 1.5"},
{:excoveralls, "~> 0.10", only: :test}
]
end
defp test_paths(journal_adapter) when journal_adapter in @journal_adapters,
do: ["integration_test/#{journal_adapter}"]
defp test_paths(_), do: ["test/helios"]
defp test_adapters(args) do
for env <- @journal_adapters, do: test_run(env, args)
end
defp test_run(adapter, args) do
args = if IO.ANSI.enabled?, do: ["--color"|args], else: ["--no-color"|args]
IO.puts "==> Running tests for adapter #{adapter} mix test"
{_, res} = System.cmd "mix", ["test" | args],
into: IO.binstream(:stdio, :line),
env: [{"MIX_ENV", "test"}, {"JOURNAL_ADAPTER", adapter}]
if res > 0 do
System.at_exit(fn _ -> exit({:shutdown, 1}) end)
end
end
defp package() do
[
maintainers: ["Milan Jarić"],
licenses: ["Apache 2.0"],
links: %{"GitHub" => "https://github.com/exponentially/helios"},
files:
~w(.formatter.exs mix.exs README.md CHANGELOG.md lib) ++
~w(integration_test/support)
]
end
defp docs() do
[
main: "your-first-aggregate",
source_ref: "v#{@version}",
canonical: "http://hexdocs.pm/helios",
# logo: "guides/images/e.png",
source_url: "https://github.com/exponentially/helios",
extras: [
"guides/Your First Aggregate.md",
"guides/Configuration.md",
"guides/Routing.md"
],
groups_for_modules: [
"Aggregate": [
Helios.Aggregate,
Helios.Aggregate.Server,
Helios.Aggregate.Supervisor
],
"Pipeline": [
Helios.Context,
Helios.Pipeline,
Helios.Pipeline.Adapter,
Helios.Pipeline.Builder,
Helios.Pipeline.Plug,
Helios.Plugs.Logger
],
"Event Journal": [
Helios.EventJournal,
Helios.EventJournal.Adapter,
Helios.EventJournal.Messages.EventData,
Helios.EventJournal.Messages.PersistedEvent,
Helios.EventJournal.Messages.Position,
Helios.EventJournal.Messages.ReadAllEventsResponse,
Helios.EventJournal.Messages.ReadStreamEventsResponse,
Helios.EventJournal.Messages.StreamMetadataResponse,
],
"Testing": [
Helios.Pipeline.Test,
],
"Endpoint": [
Helios.Endpoint,
Helios.Endpoint.Facade,
Helios.Endpoint.Supervisor,
]
]
]
end
end