-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathmix.exs
70 lines (61 loc) · 1.7 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
defmodule ElixirAle.MixProject do
use Mix.Project
def project do
[
app: :elixir_ale,
version: "1.2.1",
elixir: "~> 1.6",
name: "elixir_ale",
description: description(),
package: package(),
source_url: "https://github.com/fhunleth/elixir_ale",
compilers: [:elixir_make] ++ Mix.compilers(),
make_clean: ["clean"],
docs: [extras: ["README.md"]],
aliases: [docs: ["docs", ©_images/1], format: ["format", &format_c/1]],
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
deps: deps()
]
end
def application, do: []
defp description do
"Elixir access to hardware GPIO, I2C, and SPI interfaces."
end
defp package do
%{
files: [
"lib",
"src/*.[ch]",
"src/linux/i2c-dev.h",
"mix.exs",
"README.md",
"LICENSE",
"Makefile"
],
maintainers: ["Frank Hunleth"],
licenses: ["Apache-2.0"],
links: %{"GitHub" => "https://github.com/fhunleth/elixir_ale"}
}
end
defp deps do
[
{:elixir_make, "~> 0.4", runtime: false},
{:ex_doc, "~> 0.19", only: [:dev, :test], runtime: false},
{:dialyxir, "1.0.0-rc.4", only: [:dev, :test], runtime: false}
]
end
# Copy the images referenced by docs, since ex_doc doesn't do this.
defp copy_images(_) do
File.cp_r("assets", "doc/assets")
end
defp format_c([]) do
astyle =
System.find_executable("astyle") ||
Mix.raise("""
Could not format C code since astyle is not available.
""")
System.cmd(astyle, ["-n", "src/*.c", "src/*.h"], into: IO.stream(:stdio, :line))
end
defp format_c(_args), do: true
end