-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
144 lines (129 loc) · 3.3 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
defmodule Ontogen.CLI.MixProject do
use Mix.Project
@scm_url "https://github.com/ontogen/cli"
@version File.read!("VERSION") |> String.trim()
def project do
[
app: :ontogen_cli,
version: @version,
elixir: "~> 1.16",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
aliases: aliases(),
releases: releases(),
escript: [
main_module: Ontogen.CLI,
name: "og"
],
preferred_cli_env: [
check: :test,
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
test_coverage: [tool: ExCoveralls],
# Hex
package: package(),
description: description(),
# Docs
name: "Ontogen CLI",
docs: docs()
]
end
defp description do
"""
CLI for the Ontogen version control system for RDF datasets.
"""
end
defp package do
[
maintainers: ["Marcel Otto"],
licenses: ["MIT"],
links: %{
"Homepage" => "https://ontogen.io",
"GitHub" => @scm_url,
"Changelog" => @scm_url <> "/blob/main/CHANGELOG.md"
},
files: ~w[lib priv mix.exs .formatter.exs VERSION *.md]
]
end
def releases do
[
og: [
steps: [:assemble, &Burrito.wrap/1],
burrito: [
targets: [
macos_arm: [os: :darwin, cpu: :aarch64],
macos_intel: [os: :darwin, cpu: :x86_64],
linux_arm: [os: :linux, cpu: :aarch64],
linux_intel: [os: :linux, cpu: :x86_64],
windows: [os: :windows, cpu: :x86_64]
]
]
]
]
end
def application do
[
extra_applications: [:logger],
mod: {Ontogen.CLI, []}
]
end
defp deps do
[
ontogen_dep(:ontogen, "~> 0.1.2"),
rdf_ex_dep(:rdf, "~> 2.0"),
rdf_ex_dep(:json_ld, ">= 0.3.9"),
rdf_ex_dep(:rdf_xml, "~> 1.2"),
rdf_ex_dep(:prov, "~> 0.1"),
{:optimus, "~> 0.5"},
{:burrito, "~> 1.1"},
{:hackney, "~> 1.17"},
{:ex_doc, "~> 0.34", only: [:dev, :test], runtime: false},
{:excoveralls, "~> 0.18", only: :test},
# This dependency is needed for ExCoveralls when OTP < 25
{:castore, "~> 1.0"}
]
end
defp ontogen_dep(dep, version) do
case System.get_env("ONTOGEN_PACKAGES_SRC") do
"LOCAL" -> {dep, path: "../#{dep}"}
_ -> {dep, version}
end
end
defp rdf_ex_dep(dep, version) do
case System.get_env("RDF_EX_PACKAGES_SRC") do
"LOCAL" -> {dep, path: "../../../RDF.ex/src/#{dep}"}
_ -> {dep, version}
end
end
defp docs do
[
main: "Ontogen.CLI",
source_url: @scm_url,
source_ref: "v#{@version}",
logo: "logo.png",
skip_undefined_reference_warnings_on: ["CHANGELOG.md"],
extras: [
{:"README.md", [title: "About"]},
{:"CHANGELOG.md", [title: "CHANGELOG"]},
{:"LICENSE.md", [title: "License"]}
]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp aliases do
[
check: [
"clean",
"deps.unlock --check-unused",
"compile --warnings-as-errors",
"format --check-formatted",
"test --warnings-as-errors"
]
]
end
end