-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
96 lines (87 loc) · 2.28 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
defmodule Kinext.MixProject do
use Mix.Project
def project do
[
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
dialyzer: [
ignore_warnings: ".dialyzer_ignore.exs",
list_unused_filters: true,
plt_file: {:no_warn, "kinext.plt"}
],
app: :kinext,
version: "0.2.0",
elixir: "~> 1.9",
start_permanent: Mix.env() == :prod,
deps: deps(),
aliases: aliases(),
compilers: [:my_nifs] ++ Mix.compilers(),
description: description(),
package: package()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
defp description do
"Elixir wrapper for Xbox 360 Kinect"
end
defp package do
[
build_tools: ["make"],
files: ["lib", "native/nifs", "Makefile", "README.md", "mix.exs"],
licenses: ["MIT"],
links: %{"GitHub" => "https://github.com/TheFirstAvenger/kinext"}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:ex_image_info, "~> 0.2.4"},
{:git_hooks, "~> 0.4.1", only: :dev, runtime: false},
{:excoveralls, "~> 0.12.2", only: :test},
{:credo, "~> 1.3.1", only: :dev, runtime: false},
{:mix_test_watch, "~> 1.0.2", only: :dev, runtime: false},
{:dialyxir, "~> 1.0.0-rc.7", only: :dev, runtime: false},
{:ex_doc, "~> 0.21.3", only: :dev, runtime: false}
]
end
defp aliases do
[]
end
end
defmodule Mix.Tasks.Compile.MyNifs do
def run(_args) do
{result, errcode} = System.cmd("make", [], stderr_to_stdout: true)
IO.binwrite(result)
if errcode == 0 do
{:ok, []}
else
# raise "nif compile make returned #{errcode}"
{:error,
[
%Mix.Task.Compiler.Diagnostic{
compiler_name: "my_nifs",
details: result,
file: "Makefile",
message: "nif compile make returned #{errcode}",
position: 1,
severity: :error
}
]}
end
end
def clean do
if File.exists?("native/kinext.so") do
File.rm!("native/kinext.so")
end
end
end