-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
123 lines (105 loc) · 2.74 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 Gazet.MixProject do
use Mix.Project
@app :gazet
@name "Gazet"
@description "Publish and subscribe to the latest news ... uhm events"
@repo "https://github.com/alexandra-wolf/#{@app}"
def project do
[
app: @app,
elixir: ">= 1.7.4 and < 2.0.0",
elixirc_paths: elixirc_paths(Mix.env()),
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
test_coverage: [tool: ExCoveralls],
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
# Deps
dialyzer: dialyzer(),
# Docs
name: @name,
source_url: @repo,
homepage_url: @repo,
# Hex
description: @description,
docs: docs(),
package: package(),
version: version()
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
# Aliases are shortcuts or tasks specific to the current project.
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
"check.all": ["format --check-formatted", "credo", "dialyzer"]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
# Optional
{:nimble_options, "~> 1.0", optional: true},
# No Runtime
{:credo, ">= 1.0.0", only: :dev, runtime: false},
{:dialyxir, ">= 1.0.0", only: :dev, runtime: false},
{:ex_doc, "~> 0.29", only: :dev, runtime: false},
# Test
{:excoveralls, "~> 0.16", only: :test},
{:mox, "~> 1.0", only: :test}
]
end
defp dialyzer do
[
ignore_warnings: ".dialyzer_ignore.exs",
plt_add_apps: [],
plt_file: {:no_warn, ".dialyzer/dialyzer.plt"}
]
end
#######
# Hex #
#######
@extras Path.wildcard("pages/**/*.md")
def docs do
[
main: @name,
source_ref: "v#{version()}",
source_url: @repo,
extras: @extras,
groups_for_modules: []
]
end
def package do
[
files: ["lib", "mix.exs", "CHANGELOG*", "LICENSE*", "README*", "version"],
licenses: ["HL3-CL-ECO-EXTR-FFD-MIL-MY-SOC-SV-TAL"],
links: %{"GitHub" => @repo},
maintainers: ["Alexandra Wolf <alexwolf1991@>"]
]
end
@version_file "version"
def version do
cond do
File.exists?(@version_file) ->
@version_file
|> File.read!()
|> String.trim()
System.get_env("REQUIRE_VERSION_FILE") == "true" ->
exit("Version file (`#{@version_file}`) doesn't exist but is required!")
true ->
"0.0.0-dev"
end
end
end