-
Notifications
You must be signed in to change notification settings - Fork 9
/
mix.exs
130 lines (120 loc) · 3.15 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
if File.exists?("blend/premix.exs") do
Code.compile_file("blend/premix.exs")
end
defmodule SEO.MixProject do
use Mix.Project
@version "0.1.11"
def project do
[
app: :phoenix_seo,
name: "SEO",
version: @version,
elixir: ">= 1.14.0",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
aliases: aliases(),
deps: deps(),
docs: docs(),
homepage_url: "https://hexdocs.pm/phoenix_seo",
source_url: "https://github.com/dbernheisel/phoenix_seo",
preferred_cli_env: [tests: :test],
package: package(),
description:
"Framework for Phoenix applications to optimize your site for search engines and displaying rich results when your URLs are shared across the internet."
]
|> Keyword.merge(maybe_lockfile_option())
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
def elixirc_paths(:test), do: ["lib", "test/support"]
def elixirc_paths(_), do: ["lib"]
defp package do
[
name: "phoenix_seo",
files: [
"lib",
"mix.exs",
"CHANGELOG*",
"README*",
"LICENSE*"
],
maintainers: ["David Bernheisel"],
licenses: ["MIT"],
links: %{
"GitHub" => "https://github.com/dbernheisel/phoenix_seo",
"Readme" => "https://github.com/dbernheisel/phoenix_seo/blob/#{@version}/README.md",
"Changelog" => "https://github.com/dbernheisel/phoenix_seo/blob/#{@version}/CHANGELOG.md"
}
]
end
defp docs do
[
main: "SEO",
assets: %{"assets" => "assets"},
logo: "priv/logomark-small.png",
source_ref: @version,
groups_for_modules: groups_for_modules(),
extras: ["CHANGELOG.md", "LICENSE"]
]
end
defp groups_for_modules do
[
Domains: [
SEO.Breadcrumb,
SEO.OpenGraph,
SEO.Site,
SEO.Twitter,
SEO.Facebook,
SEO.Unfurl
],
"Open Graph": [
SEO.OpenGraph.Article,
SEO.OpenGraph.Audio,
SEO.OpenGraph.Book,
SEO.OpenGraph.Image,
SEO.OpenGraph.Profile,
SEO.OpenGraph.Video
],
Breadcrumbs: [
SEO.Breadcrumb.List,
SEO.Breadcrumb.ListItem
],
Protocol: [
SEO.Breadcrumb.Build,
SEO.OpenGraph.Build,
SEO.Site.Build,
SEO.Twitter.Build,
SEO.Facebook.Build,
SEO.Unfurl.Build
]
]
end
defp aliases do
[
tests: ["format --check-formatted", "credo --strict", "test"]
]
end
defp deps do
[
{:phoenix_live_view, ">= 0.18.0"},
# Dev / Test
{:blend, "~> 0.4.1", only: [:dev, :test]},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.27", only: :dev, runtime: false},
{:jason, "~> 1.0", only: [:dev, :test]},
{:floki, "~> 0.35", only: [:dev, :test]},
{:makeup_eex, "~> 1.0", only: :dev, runtime: false}
]
end
defp maybe_lockfile_option do
case System.get_env("MIX_LOCKFILE") do
nil -> []
"" -> []
lockfile -> [lockfile: lockfile]
end
end
end