-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmix.exs
More file actions
106 lines (95 loc) · 2.36 KB
/
Copy pathmix.exs
File metadata and controls
106 lines (95 loc) · 2.36 KB
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
defmodule Unity.MixProject do
use Mix.Project
@version "1.1.0"
@source_url "https://github.com/elixir-localize/unity"
def project do
[
app: :unity,
version: @version,
elixir: "~> 1.17",
name: "Unity",
source_url: @source_url,
docs: docs(),
description: description(),
package: package(),
start_permanent: Mix.env() == :prod,
escript: escript(),
deps: deps(),
aliases: aliases(),
dialyzer: [
flags: [
:error_handling,
:unknown,
:underspecs,
:extra_return,
:missing_return
]
]
]
end
defp aliases do
[
test: ["localize.download_locales en de ja", "test"]
]
end
def application do
[
extra_applications: [:logger]
]
end
defp escript do
[main_module: Unity.CLI]
end
defp description do
"""
An Elixir unit conversion calculator inspired by the Unix `units` utility.
Parses and evaluates unit expressions with locale-aware output powered by Localize.
"""
end
defp package do
[
licenses: ["Apache-2.0"],
links: links(),
files: ~w(lib priv .formatter.exs mix.exs README.md CHANGELOG.md LICENSE.md)
]
end
def links do
%{
"GitHub" => "https://github.com/elixir-localize/unity",
"Readme" => "https://github.com/elixir-localize/unity/blob/v#{@version}/README.md",
"Changelog" => "https://github.com/elixir-localize/unity/blob/v#{@version}/CHANGELOG.md"
}
end
defp docs do
[
main: "readme",
formatters: ["html", "markdown"],
extras: [
"README.md",
"CHANGELOG.md",
"guides/exploring_unity.md",
"guides/conformance.md",
"guides/importing_gnu_units_definitions.md"
],
groups_for_extras: [Guides: ~r/guides\/.*/],
source_ref: "v#{@version}"
]
end
defp deps do
[
{:localize, "~> 1.0"},
{:marcli, "~> 0.3", optional: true},
{:nimble_parsec, "~> 1.0"},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.34", only: :release, runtime: false}
] ++ maybe_json_polyfill()
end
defp maybe_json_polyfill do
if Code.ensure_loaded?(:json) do
[]
else
[{:json_polyfill, "~> 0.2 or ~> 1.0"}]
end
end
end