-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
129 lines (120 loc) · 3.8 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
defmodule Datadog.DataStreams.MixProject do
use Mix.Project
def project do
[
app: :data_streams,
name: "Data Streams Ex",
description: "DataDog data streams library for Elixir",
version: "1.2.2",
elixir: "~> 1.11",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
docs: docs(),
package: package(),
source_url: "https://github.com/stordco/data-streams-ex",
test_coverage: test_coverage(),
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.html": :test,
"coveralls.circle": :test
]
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger],
mod: {Datadog.DataStreams.Application, []}
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:benchee, "~> 1.0", only: [:dev, :test]},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.17.1", only: :test},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:doctor, "~> 0.21.0", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.30", only: [:dev, :test], runtime: false},
{:finch, ">= 0.1.0"},
{:jason, "~> 1.0"},
{:msgpax, "~> 2.4"},
{:opentelemetry_api, ">= 1.0.0"},
{:protobuf, ">= 0.10.0"}
]
end
# Used when packaging for publishing to Hex.pm
defp package do
[
files: ~w(lib mix.exs .formatter.exs README.md CHANGELOG.md),
licenses: ["MIT"],
links: %{
Changelog: "https://github.com/stordco/data-streams-ex/releases",
GitHub: "https://github.com/stordco/data-streams-ex"
}
]
end
# Include useful markdown files in built documentation
defp docs do
[
before_closing_body_tag: &before_closing_body_tag/1,
extras: ["README.md", "CHANGELOG.md"],
groups_for_modules: [
"Data Stream Integrations": [~r/Datadog.DataStreams.Integrations/],
"Data Streams": [~r/Datadog.DataStreams/],
Sketch: [~r/Datadog.Sketch/]
],
main: "readme",
nest_modules_by_prefix: [
Datadog.DataStreams.Integrations,
Datadog
],
skip_undefined_reference_warnings_on: ["CHANGELOG.md"]
]
end
defp before_closing_body_tag(:html) do
"""
<script src="https://cdn.jsdelivr.net/npm/mermaid@8.13.3/dist/mermaid.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
mermaid.initialize({ startOnLoad: false });
let id = 0;
for (const codeEl of document.querySelectorAll("pre code.mermaid")) {
const preEl = codeEl.parentElement;
const graphDefinition = codeEl.textContent;
const graphEl = document.createElement("div");
const graphId = "mermaid-graph-" + id++;
mermaid.render(graphId, graphDefinition, function (svgSource, bindListeners) {
graphEl.innerHTML = svgSource;
bindListeners && bindListeners(graphEl);
preEl.insertAdjacentElement("afterend", graphEl);
preEl.remove();
});
}
});
</script>
"""
end
defp before_closing_body_tag(_), do: ""
# Ignore modules that don't require test coverage. Worth noting that
# we test on Elixir versions < 1.13 which do not include the
# `ignore_modules` option.
defp test_coverage do
[
ignore_modules: [
~r/Enumerable/,
~r/Datadog.Sketch.Protobuf/,
~r/Msgpax/
],
summary: [
threshold: 0
],
tool: ExCoveralls
]
end
end