-
Notifications
You must be signed in to change notification settings - Fork 45
/
mix.exs
83 lines (74 loc) · 2.24 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
defmodule Zigler.MixProject do
use Mix.Project
def zig_version, do: "0.13.0"
def project do
env = Mix.env()
[
app: :zigler,
version: "0.13.3",
elixir: "~> 1.14",
start_permanent: env == :prod,
elixirc_paths: elixirc_paths(env),
deps: deps(),
package: [
description: "Zig nif library",
licenses: ["MIT"],
# we need to package the zig BEAM adapters and the c include files as a part
# of the hex packaging system.
files: ~w[lib mix.exs README* LICENSE* VERSIONS* priv/beam],
links: %{
"GitHub" => "https://github.com/E-xyza/zigler",
"Zig" => "https://ziglang.org/"
}
],
dialyzer: [plt_add_deps: :transitive],
preferred_cli_env: [dialyzer: :dev],
source_url: "https://github.com/E-xyza/zigler/",
docs: docs(),
aliases: [docs: "zig_doc"],
test_elixirc_options: [
debug_info: true,
docs: true
]
]
end
defp docs do
[
main: "Zig",
extras: ["README.md" | guides(Mix.env())],
groups_for_extras: [Guides: Path.wildcard("guides/*.md")],
zig_doc: [beam: [file: "priv/beam/beam.zig"]]
]
end
defp guides(:dev) do
"guides"
|> File.ls!()
|> Enum.sort()
|> Enum.filter(&String.ends_with?(&1, ".md"))
|> Enum.map(&Path.join("guides", &1))
end
defp guides(_), do: []
def application, do: [extra_applications: [:logger, :inets, :crypto, :public_key, :ssl]]
defp elixirc_paths(:dev), do: ["lib"]
defp elixirc_paths(:test), do: ["lib", "test/_support"]
defp elixirc_paths(_), do: ["lib"]
def deps do
[
# credo
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
# dialyzer
{:dialyxir, "~> 0.5", only: [:dev], runtime: false},
# to parse the zig JSON
{:jason, "~> 1.4"},
# zig parser is pinned to a version of zig parser because versions of zig parser
# are pinned to zig versions
{:zig_parser, "~> 0.4.0"},
# utility to help manage type protocols
{:protoss, "~> 0.2"},
{:zig_get, "== 0.13.1"},
# documentation
{:markdown_formatter, "~> 0.6", only: :dev, runtime: false},
{:zig_doc, "~> 0.4.0", only: :dev, runtime: false}
]
end
end