-
Notifications
You must be signed in to change notification settings - Fork 3
/
mix.exs
97 lines (90 loc) · 2.4 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
defmodule SipHash.Mixfile do
use Mix.Project
@url_docs "http://hexdocs.pm/siphash"
@url_github "https://github.com/whitfin/siphash-elixir"
def project do
[
app: :siphash,
name: "SipHash",
description: "Elixir implementation of the SipHash hash family",
compilers: [ :make, :elixir, :app ],
package: %{
files: [
"c_src",
"lib",
"mix.exs",
"LICENSE",
"Makefile",
"README.md"
],
licenses: [ "MIT" ],
links: %{
"Docs" => @url_docs,
"GitHub" => @url_github
},
maintainers: [ "Isaac Whitfield" ]
},
version: "3.2.0",
elixir: "~> 1.1",
aliases: [
clean: [ "clean", "clean.make" ]
],
deps: deps(),
docs: [
extras: [ "README.md" ],
source_ref: "master",
source_url: @url_github
],
test_coverage: [
tool: ExCoveralls
],
preferred_cli_env: [
docs: :docs,
bench: :test,
coveralls: :test,
"coveralls.html": :test,
"coveralls.travis": :test
]
]
end
# Configuration for the OTP application
#
# Type "mix help compile.app" for more information
def application do
[applications: [:logger]]
end
# Dependencies can be Hex packages:
#
# {:mydep, "~> 0.3.0"}
#
# Or git/path repositories:
#
# {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
#
# Type "mix help deps" for more examples and options
defp deps do
[
# development dependencies
{ :benchfella, "~> 0.3", optional: true, only: [ :dev, :test ] },
{ :excoveralls, "~> 0.7", optional: true, only: [ :dev, :test ] },
{ :exprof, "~> 0.2", optional: true, only: [ :dev, :test ] },
# documentation dependencies
{ :ex_doc, "~> 0.18", optional: true, only: [ :docs ] }
]
end
end
defmodule Mix.Tasks.Clean.Make do
def run(_) do
{ _result, 0 } = System.cmd("make", ["clean"], stderr_to_stdout: true)
:ok
end
end
defmodule Mix.Tasks.Compile.Make do
def run(_) do
if !Application.get_env(:siphash, :disable_nifs) do
{ _result, 0 } = System.cmd("make", ["priv/siphash.so"], stderr_to_stdout: true)
Mix.Project.build_structure()
end
:ok
end
end