-
Notifications
You must be signed in to change notification settings - Fork 20
/
mix.exs
97 lines (85 loc) · 2.26 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
defmodule PhoenixPlayground.MixProject do
use Mix.Project
@source_url "https://github.com/phoenix-playground/phoenix_playground"
@version "0.1.7"
def project do
[
app: :phoenix_playground,
version: @version,
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
package: package(),
aliases: aliases(),
docs: docs(),
deps: deps()
]
end
def application do
[
extra_applications: [:logger],
mod: {PhoenixPlayground.Application, []}
]
end
defp package do
[
description: "Phoenix Playground makes it easy to create single-file Phoenix applications",
licenses: ["Apache-2.0"],
links: %{
"GitHub" => @source_url,
"Changelog" => "https://hexdocs.pm/phoenix_playground/changelog.html"
}
]
end
defp aliases do
[
docs: ["docs.setup", "docs", "docs.teardown"],
"docs.setup": &docs_setup/1,
"docs.teardown": &docs_teardown/1
]
end
defp docs do
[
main: "readme",
source_url: @source_url,
source_ref: "v#{@version}",
extras: [
"README.md",
"CHANGELOG.md"
],
assets: %{"assets" => "assets"},
skip_code_autolink_to: [
"PhoenixPlayground.start_link/1"
]
]
end
defp docs_setup(_) do
tmp = "#{__DIR__}/tmp"
File.mkdir_p!(tmp)
File.cp!("#{__DIR__}/README.md", "#{tmp}/README.md")
File.write!("#{__DIR__}/README.md", [
File.read!("#{__DIR__}/README.md"),
"\n\n",
for path <- Path.wildcard("examples/*.exs") do
"[`#{path}`]: https://github.com/phoenix-playground/phoenix_playground/blob/v#{@version}/#{path}\n"
end
])
end
defp docs_teardown(_) do
tmp = "#{__DIR__}/tmp"
File.rename!("#{tmp}/README.md", "#{__DIR__}/README.md")
end
defp deps do
[
{:phoenix, "~> 1.0"},
{:phoenix_live_view, "~> 0.20.0 or ~> 1.0-rc"},
{:bandit, "~> 1.0"},
{:jason, "~> 1.0"},
{:floki, "~> 0.35"},
# Don't start phoenix_live_reload in case someone just wants PhoenixPlayground.Test.
# Instead, manually start it in PhoenixPlayground.start_link/1.
{:phoenix_live_reload, "~> 1.5", runtime: false},
# dev-only
{:ex_doc, ">= 0.0.0", only: :dev}
]
end
end