-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmix.exs
133 lines (122 loc) · 3.41 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
defmodule Zenohex.MixProject do
use Mix.Project
@version "0.3.2"
@source_url "https://github.com/biyooon-ex/zenohex"
def project do
[
app: :zenohex,
version: @version,
elixir: "~> 1.13",
description: "Zenoh client library for elixir.",
package: package(),
start_permanent: Mix.env() == :prod,
deps: deps(),
elixirc_paths: elixirc_paths(Mix.env()),
# Docs
name: "Zenohex",
source_url: @source_url,
docs: docs(),
test_coverage: test_coverage(),
dialyzer: dialyzer(),
aliases: [
{:test, [&suggest/1, "test"]},
{:"test.watch", [&suggest/1, "test.watch"]}
]
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:rustler_precompiled, "~> 0.8.2"},
{:rustler, "== 0.34.0", optional: true},
{:ex_doc, "~> 0.33", only: :dev},
{:mix_test_watch, "~> 1.2", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:toml, "~> 0.7", runtime: false}
]
end
defp package() do
[
name: "zenohex",
files: [
"lib/zenohex.ex",
"lib/zenohex/config",
"lib/zenohex/*.ex",
"native/zenohex_nif/.cargo",
"native/zenohex_nif/src",
"native/zenohex_nif/Cargo*",
"LICENSE",
"README.md",
"checksum-*.exs",
"mix.exs"
],
maintainers: ["s-hosoai"],
licenses: ["MIT"],
links: %{"GitHub" => @source_url}
]
end
defp docs() do
[
extras: ["README.md", "LICENSE"],
main: "readme",
groups_for_modules: [
Configs: [
Zenohex.Config,
Zenohex.Config.Connect,
Zenohex.Config.Scouting
],
Options: [
Zenohex.Publisher.Options,
Zenohex.Query.Options,
Zenohex.Queryable.Options,
Zenohex.Subscriber.Options
]
]
]
end
defp test_coverage() do
[
ignore_modules: [Zenohex.Nif],
# WHY: see https://github.com/biyooon-ex/zenohex/issues/77
summary: [threshold: 80]
]
end
defp dialyzer() do
[
plt_file: {:no_warn, "priv/plts/project.plt"},
plt_core_path: "priv/plts/core.plt"
]
end
defp suggest(_args) do
if is_nil(System.get_env("API_OPEN_SESSION_DELAY")) do
"""
====================================================================
HEY, ZENOHEX DEVELOPER. IF YOU WANNA REDUCE TEST TIME, DO FOLLOWINGS
export API_OPEN_SESSION_DELAY=0 && mix compile --force
====================================================================
"""
|> String.trim_trailing()
|> Mix.shell().info()
end
if is_nil(System.get_env("SCOUTING_DELAY")) do
"""
====================================================================
HEY, ZENOHEX DEVELOPER. IF YOU WANNA REDUCE TEST TIME,
YOU CAN ADJUST SCOUTING DELAY, LIKE FOLLOWINGS
SCOUTING_DELAY=30 mix test
====================================================================
"""
|> String.trim_trailing()
|> Mix.shell().info()
end
end
end