-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmix.exs
77 lines (67 loc) · 1.72 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
defmodule Wootheex.MixProject do
use Mix.Project
def project do
[
app: :wootheex,
version: "0.1.1",
elixir: "~> 1.9",
start_permanent: Mix.env() == :prod,
description: description(),
deps: deps(),
package: package(),
docs: docs(),
compilers: compilers(),
rustler_crates: rustler_crates(),
source_url: "https://github.com/arikai/wootheex",
homepage_url: "https://github.com/arikai/wootheex"
]
end
def application do
[
extra_applications: [:logger]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:rustler, "~> 0.21.0"},
# Docs
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false}
]
end
defp description() do
"Fast User Agent parser based on Rust version of Project Woothee"
end
defp package do
[
files: ~w(mix.exs lib .formatter.exs
README* LICENSE*
native/wootheex_nif/Cargo*
native/wootheex_nif/.cargo
native/wootheex_nif/src),
licenses: ["Apache-2.0"],
links: %{
"GitHub" => "https://github.com/arikai/wootheex",
"woothee-rust" => "https://github.com/woothee/woothee-rust",
"Project Woothee" => "https://github.com/woothee/woothee"
}
]
end
defp docs do
[
main: "About", # The main page in the docs
extras: ["README.md": [filename: "About", title: "About"]]
]
end
defp compilers() do
[:rustler] ++ Mix.compilers
end
defp rustler_crates do
[wootheex_nif: [
path: "native/wootheex_nif",
mode: rustc_mode(Mix.env)
]]
end
defp rustc_mode(:prod), do: :release
defp rustc_mode(_), do: :debug
end