-
Notifications
You must be signed in to change notification settings - Fork 110
/
mix.exs
124 lines (113 loc) · 3.11 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
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
124
defmodule Crawly.Mixfile do
use Mix.Project
@version "0.11.0"
def project do
[
app: :crawly,
version: @version,
name: "Crawly",
source_url: "https://github.com/oltarasenko/crawly",
elixir: "~> 1.7",
description: description(),
package: package(),
test_coverage: [tool: ExCoveralls],
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
docs: docs(),
elixirc_options: [warnings_as_errors: true],
deps: deps(),
aliases: aliases()
]
end
defp aliases do
[
generate_documentation: &generate_documentation/1,
]
end
defp generate_documentation(_) do
System.cmd("mix", ["docs"])
System.cmd("mkdir", ["-p", "./doc/documentation/assets"])
System.cmd("cp", ["-r", "documentation/assets", "doc/documentation"])
end
defp elixirc_paths(:test), do: ["lib", "test"]
defp elixirc_paths(_), do: ["lib"]
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger, :sasl, :httpoison],
mod: {Crawly.Application, []}
]
end
defp description() do
"High-level web crawling & scraping framework for Elixir."
end
defp package() do
[
# This option is only needed when you don't want to use the OTP application name
name: "crawly",
licenses: ["Apache 2.0"],
links: %{
"GitHub" => "https://github.com/oltarasenko/crawly"
}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:httpoison, "~> 1.4"},
{:uuid, "~> 1.1"},
{:poison, "~> 3.1"},
{:new_gollum, "~> 0.3.0"},
{:plug_cowboy, "~> 2.0"},
{:epipe, "~> 1.0"},
{:credo, "~> 1.0.0", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.19", only: :dev, runtime: false},
{:earmark, "~> 1.2", only: :dev},
{:meck, "~> 0.8.13", only: :test},
{:excoveralls, "~> 0.10", only: :test}
]
end
defp docs do
[
source_ref: "v#{@version}",
logo: "documentation/assets/logo.png",
extra_section: "documentation",
main: "readme",
formatters: ["html"],
groups_for_modules: [
"Building Spiders": [
Crawly.Response,
Crawly.Request,
Crawly.Spider,
Crawly.ParsedItem
],
"Middlewares and Pipelines": ~r"Crawly\.(Pipeline|Middlewares)(.*)",
"Under the Hood": [
Crawly.Engine,
Crawly.Manager,
Crawly.Worker,
Crawly.DataStorage,
Crawly.DataStorage.Worker,
Crawly.RequestsStorage,
Crawly.RequestsStorage.Worker
]
],
extras: extras(),
nest_modules_by_prefix: [
Crawly.Middlewares,
Crawly.Pipelines
]
]
end
defp extras do
[
"documentation/tutorial.md",
"documentation/basic_concepts.md",
"documentation/configuration.md",
"documentation/http_api.md",
"documentation/ethical_aspects.md",
"documentation/experimental_ui.md",
"readme.md": [title: "Introduction", file: "README.md"]
]
end
end