-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmix.exs
66 lines (57 loc) · 1.54 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
defmodule EZProfiler.MixFile do
use Mix.Project
def project do
[
app: :ezprofiler,
version: "1.3.1",
elixir: "~> 1.11",
escript: escript(),
package: package(),
description: description(),
name: "ezprofiler",
aliases: aliases(),
deps: deps()
]
end
def application do
[
extra_applications: [:tools, :runtime_tools]
]
end
defp escript do
[
main_module: EZProfiler,
embed_elixir: false,
shebang: make_shebang()
]
end
defp aliases do
[
compile: ["escript.build", "run priv/dep_clean.exs"]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ex_doc, "~> 0.28.4", only: :dev, runtime: false}
]
end
defp description() do
"Provides a simple to use profiling mechanism to inspect the behavior of an application on a target VM.
This runs as a stand-alone `escript` for both for ease of use and to minimize impact on the target VM.
Requires ezprofiler_deps: https://github.com/nhpip/ezprofiler_deps"
end
defp package() do
[
files: ~w(lib mix.exs README* LICENSE*),
licenses: ["MIT"],
links: %{"GitHub" => "https://github.com/nhpip/ezprofiler"}
]
end
defp make_shebang() do
erlang_path = :code.lib_dir() |> to_string()
elixir_path = :code.lib_dir(:elixir) |> to_string()
logger_path = :code.lib_dir(:logger) |> to_string()
"#! /usr/bin/env -S ERL_LIBS=" <> erlang_path <> ":" <> elixir_path <> ":" <> logger_path <>" escript\n"
end
end