-
Notifications
You must be signed in to change notification settings - Fork 1
/
mix.exs
123 lines (108 loc) · 2.92 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
defmodule RTC.MixProject do
use Mix.Project
@scm_url "https://github.com/rtc-org/rtc-ex"
@version File.read!("VERSION") |> String.trim()
def project do
[
app: :rtc,
version: @version,
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
aliases: aliases(),
preferred_cli_env: [
check: :test,
"test.sparql_client": :test
],
# Dialyzer
dialyzer: dialyzer(),
# Hex
package: package(),
description: description(),
# Docs
name: "RTC.ex",
docs: [
main: "RTC",
source_url: @scm_url,
source_ref: "v#{@version}",
extras: ["CHANGELOG.md"]
],
# ExCoveralls
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
check: :test,
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test,
earl_reports: :test
]
]
end
defp description do
"""
An implementation of RDF Triple Compounds (RTC) in Elixir.
"""
end
defp package do
[
maintainers: ["Marcel Otto"],
licenses: ["MIT"],
links: %{
"GitHub" => @scm_url,
"Spec" => "https://w3id.org/rtc",
"Guide" => "https://rdf-elixir.dev/rtc-ex",
"Changelog" => @scm_url <> "/blob/main/CHANGELOG.md"
},
files: ~w[lib priv mix.exs .formatter.exs VERSION *.md]
]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
rdf_ex_dep(:rdf, "~> 2.0"),
rdf_ex_dep(:sparql_client, "~> 0.5", optional: true),
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.34", only: :dev, runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.18", only: :test},
# This dependency is needed for ExCoveralls when OTP < 25
{:castore, "~> 1.0", only: :test},
{:benchee, "~> 1.3", only: :dev}
]
end
defp rdf_ex_dep(dep, version, opts \\ nil) do
case System.get_env("RDF_EX_PACKAGES_SRC") do
"LOCAL" -> {dep, path: "../../../RDF.ex/src/#{dep}"}
_ -> if opts, do: {dep, version, opts}, else: {dep, version}
end
end
defp dialyzer do
[
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
ignore_warnings: ".dialyzer_ignore",
# Error out when an ignore rule is no longer useful so we can remove it
list_unused_filters: true
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp aliases do
[
"test.sparql_client": "test --only sparql_client",
check: [
"clean",
"deps.unlock --check-unused",
"compile --warnings-as-errors",
"format --check-formatted",
"test --warnings-as-errors",
"credo"
]
]
end
end