-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
51 lines (45 loc) · 1.21 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
defmodule CommendableComments.MixProject do
use Mix.Project
@vsn "0.1.0"
@github "https://github.com/Ajwah/commendable_comments"
@module_name "CommendableComments"
def project do
[
app: :commendable_comments,
version: @vsn,
description: "Document the why of your Elixir code-base.",
package: %{
licenses: ["Apache-2.0"],
source_url: @github,
links: %{"GitHub" => @github}
},
docs: [
main: @module_name,
extras: ["README.md"]
],
aliases: [docs: &build_docs/1],
elixir: "~> 1.10",
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[]
end
defp build_docs(_) do
Mix.Task.run("compile")
ex_doc = Path.join(Mix.path_for(:escripts), "ex_doc")
unless File.exists?(ex_doc) do
raise "cannot build docs because escript for ex_doc is not installed"
end
args = [@module_name, @vsn, Mix.Project.compile_path()]
opts = ~w[--main #{@module_name} --source-ref v#{@vsn} --source-url #{@github}]
System.cmd(ex_doc, args ++ opts)
Mix.shell().info("Docs built successfully")
end
end