-
Notifications
You must be signed in to change notification settings - Fork 1
/
mix.exs
67 lines (59 loc) · 2.17 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
defmodule NervesRpi3WifiPicam.MixProject do
use Mix.Project
@target System.get_env("MIX_TARGET") || "host"
def project do
[
app: :nerves_rpi3_wifi_picam,
version: "0.1.0",
elixir: "~> 1.4",
target: @target,
archives: [nerves_bootstrap: "~> 1.0"],
deps_path: "deps/#{@target}",
build_path: "_build/#{@target}",
lockfile: "mix.lock.#{@target}",
start_permanent: Mix.env() == :prod,
aliases: [loadconfig: [&bootstrap/1]],
deps: deps()
]
end
# Starting nerves_bootstrap adds the required aliases to Mix.Project.config()
# Aliases are only added if MIX_TARGET is set.
def bootstrap(args) do
Application.start(:nerves_bootstrap)
Mix.Task.run("loadconfig", args)
end
# Run "mix help compile.app" to learn about applications.
def application do
[
mod: {NervesRpi3WifiPicam.Application, []},
extra_applications: [:logger, :runtime_tools]
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:nerves, "~> 1.0", runtime: false},
{:shoehorn, "~> 0.2"}
] ++ deps(@target)
end
# Specify target specific dependencies
defp deps("host"), do: []
defp deps(target) do
[
{:nerves_runtime, "~> 0.4"},
{:nerves_init_gadget, "~> 0.3"},
{:picam, "~> 0.2.0"},
{:cowboy, "~> 1.0.0"},
{:plug, "~> 1.0"}
] ++ system(target)
end
defp system("rpi"), do: [{:nerves_system_rpi, "~> 1.0 or ~> 1.0-rc", runtime: false}]
defp system("rpi0"), do: [{:nerves_system_rpi0, "~> 1.0 or ~> 1.0-rc", runtime: false}]
defp system("rpi2"), do: [{:nerves_system_rpi2, "~> 1.0 or ~> 1.0-rc", runtime: false}]
defp system("rpi3"), do: [{:nerves_system_rpi3, "~> 1.0 or ~> 1.0-rc", runtime: false}]
defp system("bbb"), do: [{:nerves_system_bbb, "~> 1.0 or ~> 1.0-rc", runtime: false}]
defp system("ev3"), do: [{:nerves_system_ev3, "~> 1.0 or ~> 1.0-rc", runtime: false}]
defp system("qemu_arm"), do: [{:nerves_system_qemu_arm, "~> 1.0 or ~> 1.0-rc", runtime: false}]
defp system("x86_64"), do: [{:nerves_system_x86_64, "~> 1.0 or ~> 1.0-rc", runtime: false}]
defp system(target), do: Mix.raise("Unknown MIX_TARGET: #{target}")
end