-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
146 lines (135 loc) · 3.96 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
defmodule ColouredFlow.MixProject do
use Mix.Project
@version "0.1.0"
@repo_url "https://github.com/Byzanteam/coloured_flow"
def project do
[
app: :coloured_flow,
version: @version,
elixir: "~> 1.17",
start_permanent: Mix.env() == :prod,
deps: deps(),
elixirc_paths: elixirc_paths(Mix.env()),
aliases: aliases(),
dialyzer: dialyzer(),
test_coverage: test_coverage(),
# Docs
name: "ColouredFlow",
source_url: @repo_url,
homepage_url: @repo_url,
docs: docs(),
package: package()
]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: [:dev], runtime: false},
{:ecto, "~> 3.0"},
{:ecto_sql, "~> 3.12"},
{:ex_doc, "~> 0.31", only: :dev, runtime: false},
{:ex_machina, "~> 2.8.0", only: :test},
{:jason, "~> 1.0"},
{:jet_credo, [github: "Byzanteam/jet_credo", only: [:dev, :test], runtime: false]},
{:kino, "~> 0.14.1", only: [:dev, :test]},
{:postgrex, ">= 0.0.0"},
{:telemetry, "~> 1.0"},
{:typed_structor, "~> 0.4"}
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp aliases do
[
check: ["format", "deps.unlock --check-unused", "credo --strict", "dialyzer"]
]
end
defp dialyzer do
[
plt_local_path: "priv/plts/coloured_flow.plt",
plt_core_path: "priv/plts/core.plt"
]
end
defp test_coverage do
[
ignore_modules: [
ColouredFlow.Runner.Enactment.Registry,
ColouredFlow.Runner.Storage.Schemas.Types,
ColouredFlow.Runner.Supervisor,
Inspect.ColouredFlow.Expression.Scope,
TypedStructor.Plugins.DocFields,
~r/ColouredFlow.Runner.Migrations.*/
]
]
end
defp docs do
[
main: "ColouredFlow",
source_url: @repo_url,
source_ref: "v#{@version}",
extras: ["README.md"],
nest_modules_by_prefix: [
ColouredFlow.Builder,
ColouredFlow.Definition,
ColouredFlow.EnabledBindingElements,
ColouredFlow.Enactment,
ColouredFlow.Expression,
ColouredFlow.Notation,
ColouredFlow.Runner,
ColouredFlow.Runner.Enactment,
ColouredFlow.Runner.Storage,
ColouredFlow.Validators
],
groups_for_docs: [
enactment: &(&1[:group] == :enactment),
snapshot: &(&1[:group] == :snapshot),
workitem: &(&1[:group] == :workitem)
],
before_closing_body_tag: fn
:html ->
"""
<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,
formatters: ["html"]
]
end
defp package do
[
name: "coloured_flow",
description: "A workflow based on coloured petri net",
licenses: ["MIT"],
links: %{
"GitHub" => @repo_url
}
]
end
end