-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmix.exs
More file actions
123 lines (107 loc) · 2.55 KB
/
Copy pathmix.exs
File metadata and controls
123 lines (107 loc) · 2.55 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
defmodule Tux.MixProject do
use Mix.Project
@version "0.4.0"
def project do
[
app: :tux,
version: @version,
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
consolidate_protocols: Mix.env() == :prod,
deps: deps(),
aliases: aliases(),
# Hex
package: package(),
description: "Create elegant commmand line interfaces with ease",
# Docs
name: "Tux",
docs: docs()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
defp package() do
[
licenses: ["Apache-2.0"],
links: %{
"Homepage" => "https://threatfender.com/tux/",
"GitHub" => "https://github.com/threatfender/tux"
},
files: ~w(lib mix.exs .formatter.exs CHANGELOG.md README.md LICENSE)
]
end
defp docs do
[
main: "Tux",
logo: "assets/logo.png",
source_url: "https://github.com/threatfender/tux",
source_ref: "master",
extras: ["CHANGELOG.md"],
# extra_section: "GUIDES",
groups_for_modules: [
"Command Creation": [
Tux.Dispatcher,
Tux.Command
],
"Command IO": [
Tux.Case,
Tux.Colors,
Tux.Config,
Tux.Env,
Tux.Error,
Tux.Help,
Tux.Prompt,
Tux.Result
],
Internals: [
Tux.Alert,
Tux.Alertable,
Tux.Errors,
Tux.Exec,
Tux.Exit,
Tux.Init,
Tux.Locator,
Tux.Quick,
Tux.Show
]
]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:credo, "~> 1.7", only: :dev, runtime: false},
{:sobelow, "~> 0.13", only: :dev, runtime: false},
{:dialyxir, "~> 1.4", only: :dev, runtime: false}
]
end
defp aliases do
[
"src.analyze": &analyze_src/1,
# Hex package
"pkg.build": &build_pkg/1,
"pkg.analyze": ["pkg.build", &analyze_pkg/1]
]
end
## Package source code
defp analyze_src(_) do
Mix.Task.run("sobelow")
Mix.Task.run("dialyzer")
Mix.Task.run("credo", ["--all"])
end
## Package archive
defp build_pkg(_) do
Mix.Task.run("hex.build")
end
defp analyze_pkg(_) do
archive = "tux-#{@version}.tar"
Mix.Shell.IO.info("\nAnalyzing #{archive}")
tarsize = File.stat!(archive).size
Mix.Shell.IO.info("- Size: #{tarsize / 1024} kb")
end
end