forked from wojtekmach/docs_chunks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
80 lines (71 loc) · 2.47 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
defmodule DocsChunks.MixProject do
use Mix.Project
@version "0.1.0"
def project do
[
app: :docs_chunks,
version: @version,
elixir: "~> 1.9",
language: :erlang,
escript: escript(),
aliases: aliases()
]
end
def application() do
[
extra_applications: [:xmerl]
]
end
def escript() do
[main_module: :docs_chunks_cli]
end
defp aliases() do
[
all_docs: [
"docs", "telemetry_docs", "hex_core_docs", "brod_docs", "hackney_docs", "otp_docs"
],
docs: [
"escript.build",
"cmd ./docs_chunks -project",
"cmd ex_doc docs_chunks #{@version} _build/dev/lib/docs_chunks/ebin --main docs_chunks --output docs/docs_chunks"
],
otp: [
"escript.build",
"cmd ./docs_chunks -otp-xml-stdlib ~/src/otp"
],
otp_docs: [
"otp",
"cmd ex_doc stdlib 22.1.4 ~/.asdf/installs/erlang/22.1.4/lib/stdlib-3.10/ebin/ --main array --output docs/stdlib"
],
telemetry_chunks: ["escript.build", &telemetry_chunks/1],
telemetry_docs: [
"telemetry_chunks",
"cmd ex_doc telemetry 0.4.0 ../telemetry/_build/default/lib/telemetry/ebin --main telemetry --output docs/telemetry -u https://github.com/beam-telemetry/telemetry --source-ref v0.4.0 --source-root ../telemetry"
],
hex_core_chunks: ["escript.build", &hex_core_chunks/1],
hex_core_docs: [
"hex_core_chunks",
"cmd ex_doc hex_core 0.6.1 ../hex_core/_build/default/lib/hex_core/ebin --main hex_core --output docs/hex_core"
],
brod_chunks: ["escript.build", &brod_chunks/1],
brod_docs: [
"brod_chunks",
"cmd ex_doc brod master ../brod/_build/default/lib/brod/ebin --main brod --output docs/brod"
],
hackney_chunks: ["escript.build", &hackney_chunks/1],
hackney_docs: [
"hackney_chunks",
"cmd ex_doc hackney 1.15.2 ../hackney/_build/default/lib/hackney/ebin --main hackney --output docs/hackney"
]
]
end
defp telemetry_chunks(_), do: docs_chunks("../telemetry")
defp hex_core_chunks(_), do: docs_chunks("../hex_core")
defp brod_chunks(_), do: docs_chunks("../brod")
defp hackney_chunks(_), do: docs_chunks("../hackney")
defp docs_chunks(path) do
{_, 0} = System.cmd("rebar3", ~w(compile), cd: path, into: IO.stream(:stdio, :line))
bin = "../docs_chunks/docs_chunks"
{_, _} = System.cmd(bin, ~w(-project), cd: path, into: IO.stream(:stdio, :line))
end
end