-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmix.exs
115 lines (103 loc) · 3.42 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
defmodule EctoFoundationdb.MixProject do
use Mix.Project
def project do
[
app: :ecto_foundationdb,
version: "0.4.0",
description: "FoundationDB adapter for Ecto",
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
deps: deps(),
elixirc_paths: elixirc_paths(Mix.env()),
aliases: aliases(),
dialyzer: [
ignore_warnings: ".dialyzer_ignore.exs"
],
package: package(),
# Docs
name: "Ecto.Adapters.FoundationDB",
docs: docs()
]
end
defp package() do
[
licenses: ["Apache-2.0"],
links: %{
"GitHub" => "https://github.com/foundationdb-beam/ecto_foundationdb"
}
]
end
defp docs do
[
main: "Ecto.Adapters.FoundationDB",
source_url: "https://github.com/foundationdb-beam/ecto_foundationdb",
filter_modules:
~r/^Elixir.Ecto.Adapters.FoundationDB|EctoFoundationDB(.Database|.Exception.Unsupported|.Exception.IncorrectTenancy|.Future|.Index|.Indexer|.Layer|.Migrator|.Options|.QueryPlan|.Sandbox|.Tenant|.Tenant.DirectoryTenant|.Tenant.ManagedTenant)?$/,
extras: ["CHANGELOG.md", "TESTING.md", "notebooks/guide.livemd", "notebooks/watches.livemd"],
before_closing_head_tag: &docs_before_closing_head_tag/1,
before_closing_body_tag: &docs_before_closing_body_tag/1
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: extra_applications(Mix.env())
]
end
defp extra_applications(:test), do: [:logger, :runtime_tools]
defp extra_applications(_), do: [:logger]
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:erlfdb, "~> 0.2"},
{:ecto, "~> 3.12"},
{:jason, "~> 1.4"},
{:credo, "~> 1.6", only: [:dev, :test, :docs]},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.16", only: :dev, runtime: false},
{:benchee, "~> 1.0", only: :dev}
]
end
defp aliases do
[
lint: [
"format --check-formatted",
"deps.unlock --check-unused",
"credo --all --strict",
"dialyzer --format short"
]
]
end
defp docs_before_closing_head_tag(:html), do: docs_mermaid_js()
defp docs_before_closing_head_tag(:epub), do: ""
defp docs_before_closing_body_tag(:html), do: ""
defp docs_before_closing_body_tag(:epub), do: ""
defp docs_mermaid_js() do
"""
<script>
function mermaidLoaded() {
mermaid.initialize({
startOnLoad: false,
theme: document.body.className.includes("dark") ? "dark" : "default"
});
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).then(({svg, bindFunctions}) => {
graphEl.innerHTML = svg;
bindFunctions?.(graphEl);
preEl.insertAdjacentElement("afterend", graphEl);
preEl.remove();
});
}
}
</script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected]/dist/mermaid.min.js" onload="mermaidLoaded();"></script>
"""
end
end