-
Notifications
You must be signed in to change notification settings - Fork 6
/
mix.exs
63 lines (54 loc) · 1.48 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
defmodule MakeupErlang.Mixfile do
use Mix.Project
@version "1.0.1"
@url "https://github.com/elixir-makeup/makeup_erlang"
def project do
[
app: :makeup_erlang,
version: @version,
elixir: "~> 1.6",
start_permanent: Mix.env() == :prod,
deps: deps(),
package: package(),
name: "Makeup Erlang",
description: description(),
aliases: [docs: &build_docs/1]
]
end
defp description do
"""
Erlang lexer for the Makeup syntax highlighter.
"""
end
defp package do
[
name: :makeup_erlang,
licenses: ["BSD-2-Clause"],
maintainers: ["Tiago Barroso <tmbb@campus.ul.pt>"],
links: %{"GitHub" => @url}
]
end
def application do
[
mod: {Makeup.Lexers.ErlangLexer.Application, []},
extra_applications: [:logger]
]
end
defp deps do
[
{:makeup, "~> 1.0"}
]
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, run \"mix escript.install hex ex_doc\""
end
paths = Path.join(Mix.Project.build_path(), "lib/*/ebin")
args = ["MakeupErlang", @version, Mix.Project.compile_path()]
opts = ~w[--main Makeup.Lexers.ErlangLexer --source-ref v#{@version} --source-url #{@url}]
System.cmd(ex_doc, args ++ ["--paths", paths] ++ opts)
Mix.shell().info("Docs built successfully")
end
end